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" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // Returns whether the URL for the current navigation entry should be | 90 // Returns whether the URL for the current navigation entry should be |
91 // in the location bar. | 91 // in the location bar. |
92 virtual bool ShouldDisplayURL() const = 0; | 92 virtual bool ShouldDisplayURL() const = 0; |
93 | 93 |
94 // Returns true if a call to GetText() would return an empty string instead of | 94 // Returns true if a call to GetText() would return an empty string instead of |
95 // the URL that would have otherwise been displayed because the host/origin is | 95 // the URL that would have otherwise been displayed because the host/origin is |
96 // instead being displayed in the origin chip. This returns false when we | 96 // instead being displayed in the origin chip. This returns false when we |
97 // wouldn't have displayed a URL to begin with (e.g. for the NTP). | 97 // wouldn't have displayed a URL to begin with (e.g. for the NTP). |
98 virtual bool WouldOmitURLDueToOriginChip() const = 0; | 98 virtual bool WouldOmitURLDueToOriginChip() const = 0; |
99 | 99 |
| 100 // Returns true if the origin should be shown based on the current state of |
| 101 // the ToolbarModel. |
| 102 bool ShouldShowOriginChip() const; |
| 103 |
100 // Whether the text in the omnibox is currently being edited. | 104 // Whether the text in the omnibox is currently being edited. |
101 void set_input_in_progress(bool input_in_progress) { | 105 void set_input_in_progress(bool input_in_progress) { |
102 input_in_progress_ = input_in_progress; | 106 input_in_progress_ = input_in_progress; |
103 } | 107 } |
104 bool input_in_progress() const { return input_in_progress_; } | 108 bool input_in_progress() const { return input_in_progress_; } |
105 | 109 |
106 // Whether the origin chip should be enabled. | 110 // Whether the origin chip should be enabled. |
107 void set_origin_chip_enabled(bool enabled) { | 111 void set_origin_chip_enabled(bool enabled) { |
108 origin_chip_enabled_ = enabled; | 112 origin_chip_enabled_ = enabled; |
109 } | 113 } |
(...skipping 14 matching lines...) Expand all Loading... |
124 | 128 |
125 private: | 129 private: |
126 bool input_in_progress_; | 130 bool input_in_progress_; |
127 bool origin_chip_enabled_; | 131 bool origin_chip_enabled_; |
128 bool url_replacement_enabled_; | 132 bool url_replacement_enabled_; |
129 | 133 |
130 DISALLOW_COPY_AND_ASSIGN(ToolbarModel); | 134 DISALLOW_COPY_AND_ASSIGN(ToolbarModel); |
131 }; | 135 }; |
132 | 136 |
133 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_H_ | 137 #endif // CHROME_BROWSER_UI_TOOLBAR_TOOLBAR_MODEL_H_ |
OLD | NEW |