OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 111 |
112 protected: | 112 protected: |
113 virtual ~Delegate() {} | 113 virtual ~Delegate() {} |
114 }; | 114 }; |
115 | 115 |
116 enum ColorKind { | 116 enum ColorKind { |
117 BACKGROUND = 0, | 117 BACKGROUND = 0, |
118 TEXT, | 118 TEXT, |
119 SELECTED_TEXT, | 119 SELECTED_TEXT, |
120 DEEMPHASIZED_TEXT, | 120 DEEMPHASIZED_TEXT, |
121 SECURITY_TEXT, | 121 EV_BUBBLE_TEXT_AND_BORDER, |
122 }; | 122 }; |
123 | 123 |
124 LocationBarView(Browser* browser, | 124 LocationBarView(Browser* browser, |
125 Profile* profile, | 125 Profile* profile, |
126 CommandUpdater* command_updater, | 126 CommandUpdater* command_updater, |
127 Delegate* delegate, | 127 Delegate* delegate, |
128 bool is_popup_mode); | 128 bool is_popup_mode); |
129 | 129 |
130 ~LocationBarView() override; | 130 ~LocationBarView() override; |
131 | 131 |
132 // Initializes the LocationBarView. | 132 // Initializes the LocationBarView. |
133 void Init(); | 133 void Init(); |
134 | 134 |
135 // True if this instance has been initialized by calling Init, which can only | 135 // True if this instance has been initialized by calling Init, which can only |
136 // be called when the receiving instance is attached to a view container. | 136 // be called when the receiving instance is attached to a view container. |
137 bool IsInitialized() const; | 137 bool IsInitialized() const; |
138 | 138 |
139 // Returns the appropriate color for the desired kind, based on the user's | 139 // Returns the appropriate color for the desired kind, based on the user's |
140 // system theme. | 140 // system theme. |
141 SkColor GetColor(SecurityStateModel::SecurityLevel security_level, | 141 SkColor GetColor(ColorKind kind) const; |
142 ColorKind kind) const; | 142 |
| 143 // Returns the color to be used for security text in the context of |
| 144 // |security_level|. |
| 145 SkColor GetSecureTextColor( |
| 146 SecurityStateModel::SecurityLevel security_level) const; |
143 | 147 |
144 // Returns the delegate. | 148 // Returns the delegate. |
145 Delegate* delegate() const { return delegate_; } | 149 Delegate* delegate() const { return delegate_; } |
146 | 150 |
147 // See comment in browser_window.h for more info. | 151 // See comment in browser_window.h for more info. |
148 void ZoomChangedForActiveTab(bool can_show_bubble); | 152 void ZoomChangedForActiveTab(bool can_show_bubble); |
149 | 153 |
150 // The zoom icon. It may not be visible. | 154 // The zoom icon. It may not be visible. |
151 ZoomView* zoom_view() { return zoom_view_; } | 155 ZoomView* zoom_view() { return zoom_view_; } |
152 | 156 |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
240 // LocationBar: | 244 // LocationBar: |
241 void FocusLocation(bool select_all) override; | 245 void FocusLocation(bool select_all) override; |
242 void Revert() override; | 246 void Revert() override; |
243 OmniboxView* GetOmniboxView() override; | 247 OmniboxView* GetOmniboxView() override; |
244 | 248 |
245 // views::View: | 249 // views::View: |
246 bool HasFocus() const override; | 250 bool HasFocus() const override; |
247 void GetAccessibleState(ui::AXViewState* state) override; | 251 void GetAccessibleState(ui::AXViewState* state) override; |
248 gfx::Size GetPreferredSize() const override; | 252 gfx::Size GetPreferredSize() const override; |
249 void Layout() override; | 253 void Layout() override; |
| 254 void OnNativeThemeChanged(const ui::NativeTheme* theme) override; |
250 | 255 |
251 // ChromeOmniboxEditController: | 256 // ChromeOmniboxEditController: |
252 void UpdateWithoutTabRestore() override; | 257 void UpdateWithoutTabRestore() override; |
253 void ShowURL() override; | 258 void ShowURL() override; |
254 ToolbarModel* GetToolbarModel() override; | 259 ToolbarModel* GetToolbarModel() override; |
255 content::WebContents* GetWebContents() override; | 260 content::WebContents* GetWebContents() override; |
256 | 261 |
257 // ZoomEventManagerObserver: | 262 // ZoomEventManagerObserver: |
258 // Updates the view for the zoom icon when default zoom levels change. | 263 // Updates the view for the zoom icon when default zoom levels change. |
259 void OnDefaultZoomLevelChanged() override; | 264 void OnDefaultZoomLevelChanged() override; |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
479 int dropdown_animation_offset_; | 484 int dropdown_animation_offset_; |
480 | 485 |
481 // This is a debug state variable that stores if the WebContents was null | 486 // This is a debug state variable that stores if the WebContents was null |
482 // during the last RefreshPageAction. | 487 // during the last RefreshPageAction. |
483 bool web_contents_null_at_last_refresh_; | 488 bool web_contents_null_at_last_refresh_; |
484 | 489 |
485 DISALLOW_COPY_AND_ASSIGN(LocationBarView); | 490 DISALLOW_COPY_AND_ASSIGN(LocationBarView); |
486 }; | 491 }; |
487 | 492 |
488 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ | 493 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ |
OLD | NEW |