| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 static const char kViewClassName[]; | 121 static const char kViewClassName[]; |
| 122 | 122 |
| 123 LocationBarView(Browser* browser, | 123 LocationBarView(Browser* browser, |
| 124 Profile* profile, | 124 Profile* profile, |
| 125 CommandUpdater* command_updater, | 125 CommandUpdater* command_updater, |
| 126 Delegate* delegate, | 126 Delegate* delegate, |
| 127 bool is_popup_mode); | 127 bool is_popup_mode); |
| 128 | 128 |
| 129 ~LocationBarView() override; | 129 ~LocationBarView() override; |
| 130 | 130 |
| 131 // Returns the color for the location bar border in MD windows and non-MD |
| 132 // popup windows, given the window's |incognito| state. |
| 133 static SkColor GetBorderColor(bool incognito); |
| 134 |
| 131 // Initializes the LocationBarView. | 135 // Initializes the LocationBarView. |
| 132 void Init(); | 136 void Init(); |
| 133 | 137 |
| 134 // True if this instance has been initialized by calling Init, which can only | 138 // True if this instance has been initialized by calling Init, which can only |
| 135 // be called when the receiving instance is attached to a view container. | 139 // be called when the receiving instance is attached to a view container. |
| 136 bool IsInitialized() const; | 140 bool IsInitialized() const; |
| 137 | 141 |
| 138 // Returns the appropriate color for the desired kind, based on the user's | 142 // Returns the appropriate color for the desired kind, based on the user's |
| 139 // system theme. | 143 // system theme. |
| 140 SkColor GetColor(ColorKind kind) const; | 144 SkColor GetColor(ColorKind kind) const; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 209 | 213 |
| 210 LocationIconView* location_icon_view() { return location_icon_view_; } | 214 LocationIconView* location_icon_view() { return location_icon_view_; } |
| 211 | 215 |
| 212 // Return the point suitable for anchoring location-bar-anchored bubbles at. | 216 // Return the point suitable for anchoring location-bar-anchored bubbles at. |
| 213 // The point will be returned in the coordinates of the LocationBarView. | 217 // The point will be returned in the coordinates of the LocationBarView. |
| 214 gfx::Point GetLocationBarAnchorPoint() const; | 218 gfx::Point GetLocationBarAnchorPoint() const; |
| 215 | 219 |
| 216 OmniboxViewViews* omnibox_view() { return omnibox_view_; } | 220 OmniboxViewViews* omnibox_view() { return omnibox_view_; } |
| 217 const OmniboxViewViews* omnibox_view() const { return omnibox_view_; } | 221 const OmniboxViewViews* omnibox_view() const { return omnibox_view_; } |
| 218 | 222 |
| 219 // Returns the height of the control without the top and bottom | |
| 220 // edges(i.e. the height of the edit control inside). If | |
| 221 // |use_preferred_size| is true this will be the preferred height, | |
| 222 // otherwise it will be the current height. | |
| 223 int GetInternalHeight(bool use_preferred_size); | |
| 224 | |
| 225 // Returns the position and width that the popup should be, and also the left | 223 // Returns the position and width that the popup should be, and also the left |
| 226 // edge that the results should align themselves to (which will leave some | 224 // edge that the results should align themselves to (which will leave some |
| 227 // border on the left of the popup). |top_edge_overlap| specifies the number | 225 // border on the left of the popup). |top_edge_overlap| specifies the number |
| 228 // of pixels the top edge of the popup should overlap the bottom edge of | 226 // of pixels the top edge of the popup should overlap the bottom edge of |
| 229 // the toolbar. | 227 // the toolbar. |
| 230 void GetOmniboxPopupPositioningInfo(gfx::Point* top_left_screen_coord, | 228 void GetOmniboxPopupPositioningInfo(gfx::Point* top_left_screen_coord, |
| 231 int* popup_width, | 229 int* popup_width, |
| 232 int* left_margin, | 230 int* left_margin, |
| 233 int* right_margin, | 231 int* right_margin, |
| 234 int top_edge_overlap); | 232 int top_edge_overlap); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 friend class PageActionImageView; | 266 friend class PageActionImageView; |
| 269 friend class PageActionWithBadgeView; | 267 friend class PageActionWithBadgeView; |
| 270 typedef std::vector<ExtensionAction*> PageActions; | 268 typedef std::vector<ExtensionAction*> PageActions; |
| 271 typedef std::vector<PageActionWithBadgeView*> PageActionViews; | 269 typedef std::vector<PageActionWithBadgeView*> PageActionViews; |
| 272 | 270 |
| 273 // Helper for GetMinimumWidth(). Calculates the incremental minimum width | 271 // Helper for GetMinimumWidth(). Calculates the incremental minimum width |
| 274 // |view| should add to the trailing width after the omnibox. | 272 // |view| should add to the trailing width after the omnibox. |
| 275 int IncrementalMinimumWidth(views::View* view) const; | 273 int IncrementalMinimumWidth(views::View* view) const; |
| 276 | 274 |
| 277 // Returns the thickness of any visible edge, in pixels. | 275 // Returns the thickness of any visible edge, in pixels. |
| 278 int GetEdgeThickness() const; | 276 int GetHorizontalEdgeThickness() const; |
| 277 int GetVerticalEdgeThickness() const; |
| 279 | 278 |
| 280 // The vertical padding to be applied to all contained views. | 279 // Returns the total amount of space reserved above or below the content, |
| 281 int VerticalPadding() const; | 280 // which is the vertical edge thickness plus the padding next to it. If |
| 281 // |for_bubble| is true, this computes the relevant value for bubbles as |
| 282 // opposed to normal content (e.g. the omnibox). |
| 283 int GetVerticalEdgeThicknessWithPadding(bool for_bubble) const; |
| 282 | 284 |
| 283 // Updates |location_icon_view_| based on the current state and theme. | 285 // Updates |location_icon_view_| based on the current state and theme. |
| 284 void RefreshLocationIcon(); | 286 void RefreshLocationIcon(); |
| 285 | 287 |
| 286 // Updates the visibility state of the Content Blocked icons to reflect what | 288 // Updates the visibility state of the Content Blocked icons to reflect what |
| 287 // is actually blocked on the current page. Returns true if the visibility | 289 // is actually blocked on the current page. Returns true if the visibility |
| 288 // of at least one of the views in |content_setting_views_| changed. | 290 // of at least one of the views in |content_setting_views_| changed. |
| 289 bool RefreshContentSettingViews(); | 291 bool RefreshContentSettingViews(); |
| 290 | 292 |
| 291 // Clears |page_action_views_| and removes the elements from the view | 293 // Clears |page_action_views_| and removes the elements from the view |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 474 BooleanPrefMember edit_bookmarks_enabled_; | 476 BooleanPrefMember edit_bookmarks_enabled_; |
| 475 | 477 |
| 476 // This is a debug state variable that stores if the WebContents was null | 478 // This is a debug state variable that stores if the WebContents was null |
| 477 // during the last RefreshPageAction. | 479 // during the last RefreshPageAction. |
| 478 bool web_contents_null_at_last_refresh_; | 480 bool web_contents_null_at_last_refresh_; |
| 479 | 481 |
| 480 DISALLOW_COPY_AND_ASSIGN(LocationBarView); | 482 DISALLOW_COPY_AND_ASSIGN(LocationBarView); |
| 481 }; | 483 }; |
| 482 | 484 |
| 483 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ | 485 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ |
| OLD | NEW |