Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(202)

Side by Side Diff: chrome/browser/ui/toolbar/toolbar_model_impl.cc

Issue 1539043002: Pull SecurityStateModel out into a component (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/toolbar/toolbar_model_impl.h" 5 #include "chrome/browser/ui/toolbar/toolbar_model_impl.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "build/build_config.h" 10 #include "build/build_config.h"
11 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h" 11 #include "chrome/browser/autocomplete/chrome_autocomplete_scheme_classifier.h"
12 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/browser/search/search.h" 13 #include "chrome/browser/search/search.h"
14 #include "chrome/browser/ssl/chrome_security_state_model_client.h" 14 #include "chrome/browser/ssl/chrome_security_state_model_client.h"
15 #include "chrome/browser/ssl/security_state_model.h"
16 #include "chrome/browser/ui/toolbar/toolbar_model_delegate.h" 15 #include "chrome/browser/ui/toolbar/toolbar_model_delegate.h"
17 #include "chrome/common/pref_names.h" 16 #include "chrome/common/pref_names.h"
18 #include "chrome/common/url_constants.h" 17 #include "chrome/common/url_constants.h"
19 #include "chrome/grit/generated_resources.h" 18 #include "chrome/grit/generated_resources.h"
20 #include "components/google/core/browser/google_util.h" 19 #include "components/google/core/browser/google_util.h"
21 #include "components/omnibox/browser/autocomplete_classifier.h" 20 #include "components/omnibox/browser/autocomplete_classifier.h"
22 #include "components/omnibox/browser/autocomplete_input.h" 21 #include "components/omnibox/browser/autocomplete_input.h"
23 #include "components/omnibox/browser/autocomplete_match.h" 22 #include "components/omnibox/browser/autocomplete_match.h"
23 #include "components/security_state/security_state_model.h"
24 #include "components/url_formatter/elide_url.h" 24 #include "components/url_formatter/elide_url.h"
25 #include "components/url_formatter/url_formatter.h" 25 #include "components/url_formatter/url_formatter.h"
26 #include "content/public/browser/cert_store.h" 26 #include "content/public/browser/cert_store.h"
27 #include "content/public/browser/navigation_controller.h" 27 #include "content/public/browser/navigation_controller.h"
28 #include "content/public/browser/navigation_entry.h" 28 #include "content/public/browser/navigation_entry.h"
29 #include "content/public/browser/web_contents.h" 29 #include "content/public/browser/web_contents.h"
30 #include "content/public/browser/web_ui.h" 30 #include "content/public/browser/web_ui.h"
31 #include "content/public/common/content_constants.h" 31 #include "content/public/common/content_constants.h"
32 #include "content/public/common/ssl_status.h" 32 #include "content/public/common/ssl_status.h"
33 #include "grit/components_scaled_resources.h" 33 #include "grit/components_scaled_resources.h"
34 #include "grit/theme_resources.h" 34 #include "grit/theme_resources.h"
35 #include "net/cert/cert_status_flags.h" 35 #include "net/cert/cert_status_flags.h"
36 #include "net/cert/x509_certificate.h" 36 #include "net/cert/x509_certificate.h"
37 #include "net/ssl/ssl_connection_status_flags.h" 37 #include "net/ssl/ssl_connection_status_flags.h"
38 #include "ui/base/l10n/l10n_util.h" 38 #include "ui/base/l10n/l10n_util.h"
39 #include "ui/gfx/text_elider.h" 39 #include "ui/gfx/text_elider.h"
40 #include "ui/gfx/vector_icons_public.h" 40 #include "ui/gfx/vector_icons_public.h"
41 41
42 using content::NavigationController; 42 using content::NavigationController;
43 using content::NavigationEntry; 43 using content::NavigationEntry;
44 using content::WebContents; 44 using content::WebContents;
45 using security_state::SecurityStateModel;
45 46
46 ToolbarModelImpl::ToolbarModelImpl(ToolbarModelDelegate* delegate) 47 ToolbarModelImpl::ToolbarModelImpl(ToolbarModelDelegate* delegate)
47 : delegate_(delegate) { 48 : delegate_(delegate) {
48 } 49 }
49 50
50 ToolbarModelImpl::~ToolbarModelImpl() { 51 ToolbarModelImpl::~ToolbarModelImpl() {
51 } 52 }
52 53
53 // ToolbarModelImpl Implementation. 54 // ToolbarModelImpl Implementation.
54 base::string16 ToolbarModelImpl::GetText() const { 55 base::string16 ToolbarModelImpl::GetText() const {
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 277
277 // Otherwise, extract search terms for HTTPS pages that do not have a security 278 // Otherwise, extract search terms for HTTPS pages that do not have a security
278 // error. 279 // error.
279 SecurityStateModel::SecurityLevel security_level = 280 SecurityStateModel::SecurityLevel security_level =
280 GetSecurityLevel(ignore_editing); 281 GetSecurityLevel(ignore_editing);
281 return ((security_level == SecurityStateModel::NONE) || 282 return ((security_level == SecurityStateModel::NONE) ||
282 (security_level == SecurityStateModel::SECURITY_ERROR)) 283 (security_level == SecurityStateModel::SECURITY_ERROR))
283 ? base::string16() 284 ? base::string16()
284 : search_terms; 285 : search_terms;
285 } 286 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/toolbar/toolbar_model_impl.h ('k') | chrome/browser/ui/views/browser_dialogs_views_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698