chromium/chrome/browser/ssl/chrome_security_state_model_delegate.cc

// Copyright 2015 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/ssl/chrome_security_state_model_delegate.h"

#include "chrome/browser/ssl/chrome_security_state_tab_helper.h"
#include "components/security_state/core/security_state.h"
#include "content/public/browser/web_contents.h"

security_state::SecurityLevel
ChromeSecurityStateModelDelegate::GetSecurityLevel(
    content::WebContents* web_contents) const {
  DCHECK(web_contents);
  ChromeSecurityStateTabHelper::CreateForWebContents(web_contents);
  SecurityStateTabHelper* helper =
      SecurityStateTabHelper::FromWebContents(web_contents);
  DCHECK(helper);
  return helper->GetSecurityLevel();
}