| OLD | NEW |
| 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 #ifndef CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_H_ |
| 6 #define CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_H_ | 6 #define CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 #include "url/gurl.h" | 12 #include "url/gurl.h" |
| 13 | 13 |
| 14 namespace net { | 14 namespace net { |
| 15 class X509Certificate; | 15 class X509Certificate; |
| 16 } | 16 } |
| 17 | 17 |
| 18 // This class is the model used by the toolbar, location bar and autocomplete | 18 // This class is the model used by the toolbar, location bar and autocomplete |
| 19 // edit. It populates its states from the current navigation entry retrieved | 19 // edit. It populates its states from the current navigation entry retrieved |
| 20 // from the navigation controller returned by GetNavigationController(). | 20 // from the navigation controller returned by GetNavigationController(). |
| 21 class ToolbarModel { | 21 class ToolbarModel { |
| 22 public: | 22 public: |
| 23 // TODO(wtc): unify ToolbarModel::SecurityLevel with SecurityStyle. We | 23 // TODO(wtc): unify ToolbarModel::SecurityLevel with SecurityStyle. We |
| 24 // don't need two sets of security UI levels. SECURITY_STYLE_AUTHENTICATED | 24 // don't need two sets of security UI levels. SECURITY_STYLE_AUTHENTICATED |
| 25 // needs to be refined into three levels: warning, standard, and EV. | 25 // needs to be refined into three levels: warning, standard, and EV. |
| 26 // |
| 27 // A Java counterpart will be generated for this enum. |
| 28 // GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.ui.toolbar |
| 29 // GENERATED_JAVA_CLASS_NAME_OVERRIDE: ToolbarModelSecurityLevel |
| 26 enum SecurityLevel { | 30 enum SecurityLevel { |
| 27 #define DEFINE_TOOLBAR_MODEL_SECURITY_LEVEL(name,value) name = value, | 31 // HTTP/no URL/user is editing |
| 28 #include "chrome/browser/ui/toolbar/toolbar_model_security_level_list.h" | 32 NONE = 0, |
| 29 #undef DEFINE_TOOLBAR_MODEL_SECURITY_LEVEL | 33 |
| 34 // HTTPS with valid EV cert |
| 35 EV_SECURE = 1, |
| 36 |
| 37 // HTTPS (non-EV) |
| 38 SECURE = 2, |
| 39 |
| 40 // HTTPS, but unable to check certificate revocation status or with insecure |
| 41 // content on the page |
| 42 SECURITY_WARNING = 3, |
| 43 |
| 44 // HTTPS, but the certificate verification chain is anchored on a |
| 45 // certificate that was installed by the system administrator |
| 46 SECURITY_POLICY_WARNING = 4, |
| 47 |
| 48 // Attempted HTTPS and failed, page not authenticated |
| 49 SECURITY_ERROR = 5, |
| 50 |
| 51 NUM_SECURITY_LEVELS = 6, |
| 30 }; | 52 }; |
| 31 | 53 |
| 32 virtual ~ToolbarModel(); | 54 virtual ~ToolbarModel(); |
| 33 | 55 |
| 34 // Returns the text to be displayed in the toolbar for the current page. | 56 // Returns the text to be displayed in the toolbar for the current page. |
| 35 // The text is formatted in various ways: | 57 // The text is formatted in various ways: |
| 36 // - If the current page's URL is a search URL for the user's default search | 58 // - If the current page's URL is a search URL for the user's default search |
| 37 // engine, the query will be extracted and returned for display instead | 59 // engine, the query will be extracted and returned for display instead |
| 38 // of the URL. | 60 // of the URL. |
| 39 // - If the origin chip is enabled and visible, the text will be empty. | 61 // - If the origin chip is enabled and visible, the text will be empty. |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 | 152 |
| 131 private: | 153 private: |
| 132 bool input_in_progress_; | 154 bool input_in_progress_; |
| 133 bool origin_chip_enabled_; | 155 bool origin_chip_enabled_; |
| 134 bool url_replacement_enabled_; | 156 bool url_replacement_enabled_; |
| 135 | 157 |
| 136 DISALLOW_COPY_AND_ASSIGN(ToolbarModel); | 158 DISALLOW_COPY_AND_ASSIGN(ToolbarModel); |
| 137 }; | 159 }; |
| 138 | 160 |
| 139 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_H_ | 161 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_H_ |
| OLD | NEW |