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