| 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 COMPONENTS_TOOLBAR_TOOLBAR_MODEL_H_ | 5 #ifndef COMPONENTS_TOOLBAR_TOOLBAR_MODEL_H_ |
| 6 #define COMPONENTS_TOOLBAR_TOOLBAR_MODEL_H_ | 6 #define COMPONENTS_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 gfx { |
| 15 enum class VectorIconId; |
| 16 } |
| 17 |
| 14 namespace net { | 18 namespace net { |
| 15 class X509Certificate; | 19 class X509Certificate; |
| 16 } | 20 } |
| 17 | 21 |
| 18 // This class is the model used by the toolbar, location bar and autocomplete | 22 // 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 | 23 // edit. It populates its states from the current navigation entry retrieved |
| 20 // from the navigation controller returned by GetNavigationController(). | 24 // from the navigation controller returned by GetNavigationController(). |
| 21 class ToolbarModel { | 25 class ToolbarModel { |
| 22 public: | 26 public: |
| 23 virtual ~ToolbarModel(); | 27 virtual ~ToolbarModel(); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 // Returns true if a call to GetText() would return something other than the | 61 // Returns true if a call to GetText() would return something other than the |
| 58 // URL because of search term replacement. | 62 // URL because of search term replacement. |
| 59 bool WouldReplaceURL() const; | 63 bool WouldReplaceURL() const; |
| 60 | 64 |
| 61 // Returns the resource_id of the icon to show to the left of the address, | 65 // Returns the resource_id of the icon to show to the left of the address, |
| 62 // based on the current URL. When search term replacement is active, this | 66 // based on the current URL. When search term replacement is active, this |
| 63 // returns a search icon. This doesn't cover specialized icons while the | 67 // returns a search icon. This doesn't cover specialized icons while the |
| 64 // user is editing; see OmniboxView::GetIcon(). | 68 // user is editing; see OmniboxView::GetIcon(). |
| 65 virtual int GetIcon() const = 0; | 69 virtual int GetIcon() const = 0; |
| 66 | 70 |
| 71 // Like GetIcon(), but gets the vector asset ID. |
| 72 virtual gfx::VectorIconId GetVectorIcon() const = 0; |
| 73 |
| 67 // Returns the name of the EV cert holder. This returns an empty string if | 74 // Returns the name of the EV cert holder. This returns an empty string if |
| 68 // the security level is not EV_SECURE. | 75 // the security level is not EV_SECURE. |
| 69 virtual base::string16 GetEVCertName() const = 0; | 76 virtual base::string16 GetEVCertName() const = 0; |
| 70 | 77 |
| 71 // Returns whether the URL for the current navigation entry should be | 78 // Returns whether the URL for the current navigation entry should be |
| 72 // in the location bar. | 79 // in the location bar. |
| 73 virtual bool ShouldDisplayURL() const = 0; | 80 virtual bool ShouldDisplayURL() const = 0; |
| 74 | 81 |
| 75 // Whether the text in the omnibox is currently being edited. | 82 // Whether the text in the omnibox is currently being edited. |
| 76 void set_input_in_progress(bool input_in_progress) { | 83 void set_input_in_progress(bool input_in_progress) { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 90 ToolbarModel(); | 97 ToolbarModel(); |
| 91 | 98 |
| 92 private: | 99 private: |
| 93 bool input_in_progress_; | 100 bool input_in_progress_; |
| 94 bool url_replacement_enabled_; | 101 bool url_replacement_enabled_; |
| 95 | 102 |
| 96 DISALLOW_COPY_AND_ASSIGN(ToolbarModel); | 103 DISALLOW_COPY_AND_ASSIGN(ToolbarModel); |
| 97 }; | 104 }; |
| 98 | 105 |
| 99 #endif // COMPONENTS_TOOLBAR_TOOLBAR_MODEL_H_ | 106 #endif // COMPONENTS_TOOLBAR_TOOLBAR_MODEL_H_ |
| OLD | NEW |