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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
133 | 133 |
134 LocationBarView(Browser* browser, | 134 LocationBarView(Browser* browser, |
135 Profile* profile, | 135 Profile* profile, |
136 CommandUpdater* command_updater, | 136 CommandUpdater* command_updater, |
137 ToolbarModel* model, | 137 ToolbarModel* model, |
138 Delegate* delegate, | 138 Delegate* delegate, |
139 bool is_popup_mode); | 139 bool is_popup_mode); |
140 | 140 |
141 virtual ~LocationBarView(); | 141 virtual ~LocationBarView(); |
142 | 142 |
143 // Call this from the constructor (or during early initialization). | |
Peter Kasting
2013/08/06 20:32:42
This comment is misleading, it sounds as if it ref
tfarina
2013/08/07 18:42:53
Done.
| |
144 static void InitTouchableLocationBarView(views::View* view); | |
145 | |
143 // Initializes the LocationBarView. | 146 // Initializes the LocationBarView. |
144 void Init(); | 147 void Init(); |
145 | 148 |
146 // True if this instance has been initialized by calling Init, which can only | 149 // True if this instance has been initialized by calling Init, which can only |
147 // be called when the receiving instance is attached to a view container. | 150 // be called when the receiving instance is attached to a view container. |
148 bool IsInitialized() const; | 151 bool IsInitialized() const; |
149 | 152 |
150 // Returns the appropriate color for the desired kind, based on the user's | 153 // Returns the appropriate color for the desired kind, based on the user's |
151 // system theme. | 154 // system theme. |
152 SkColor GetColor(ToolbarModel::SecurityLevel security_level, | 155 SkColor GetColor(ToolbarModel::SecurityLevel security_level, |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
326 | 329 |
327 // Returns the height of the control without the top and bottom | 330 // Returns the height of the control without the top and bottom |
328 // edges(i.e. the height of the edit control inside). If | 331 // edges(i.e. the height of the edit control inside). If |
329 // |use_preferred_size| is true this will be the preferred height, | 332 // |use_preferred_size| is true this will be the preferred height, |
330 // otherwise it will be the current height. | 333 // otherwise it will be the current height. |
331 int GetInternalHeight(bool use_preferred_size); | 334 int GetInternalHeight(bool use_preferred_size); |
332 | 335 |
333 // Returns the position and width that the popup should be, and also the left | 336 // Returns the position and width that the popup should be, and also the left |
334 // edge that the results should align themselves to (which will leave some | 337 // edge that the results should align themselves to (which will leave some |
335 // border on the left of the popup). | 338 // border on the left of the popup). |
336 void GetOmniboxPopupPositioningInfo( | 339 void GetOmniboxPopupPositioningInfo(gfx::Point* top_left_screen_coord, |
337 gfx::Point* top_left_screen_coord, | 340 int* popup_width, |
338 int* popup_width, | 341 int* left_margin, |
339 int* left_margin, | 342 int* right_margin); |
340 int* right_margin); | |
341 | 343 |
342 // Space between items in the location bar, as well as between items and the | 344 // Space between items in the location bar, as well as between items and the |
343 // edges. | 345 // edges. |
344 static int GetItemPadding(); | 346 static int GetItemPadding(); |
345 | 347 |
346 // Thickness of the edges of the omnibox background images, in normal mode. | 348 // Thickness of the edges of the omnibox background images, in normal mode. |
347 static const int kNormalEdgeThickness; | 349 static const int kNormalEdgeThickness; |
348 // The same, but for popup mode. | 350 // The same, but for popup mode. |
349 static const int kPopupEdgeThickness; | 351 static const int kPopupEdgeThickness; |
350 // Amount of padding built into the standard omnibox icons. | 352 // Amount of padding built into the standard omnibox icons. |
351 static const int kIconInternalPadding; | 353 static const int kIconInternalPadding; |
352 // Space between the edge and a bubble. | 354 // Space between the edge and a bubble. |
353 static const int kBubblePadding; | 355 static const int kBubblePadding; |
354 | 356 |
355 protected: | 357 protected: |
356 virtual void OnFocus() OVERRIDE; | 358 virtual void OnFocus() OVERRIDE; |
357 | 359 |
358 private: | 360 private: |
359 typedef std::vector<ContentSettingImageView*> ContentSettingViews; | 361 typedef std::vector<ContentSettingImageView*> ContentSettingViews; |
360 | 362 |
361 friend class PageActionImageView; | 363 friend class PageActionImageView; |
362 friend class PageActionWithBadgeView; | 364 friend class PageActionWithBadgeView; |
363 typedef std::vector<PageActionWithBadgeView*> PageActionViews; | 365 typedef std::vector<PageActionWithBadgeView*> PageActionViews; |
364 | 366 |
367 // Returns the number of pixels of built-in padding to the left and | |
368 // right of the image for this view. | |
Peter Kasting
2013/08/06 20:32:42
Nit: Also need to update this comment.
tfarina
2013/08/07 18:42:53
Done.
| |
369 static int GetBuiltInHorizontalPaddingForChildViews(); | |
370 | |
365 // Returns the thickness of any visible left and right edge, in pixels. | 371 // Returns the thickness of any visible left and right edge, in pixels. |
366 int GetHorizontalEdgeThickness() const; | 372 int GetHorizontalEdgeThickness() const; |
367 | 373 |
368 // The same, but for the top and bottom edges. | 374 // The same, but for the top and bottom edges. |
369 int vertical_edge_thickness() const { | 375 int vertical_edge_thickness() const { |
370 return is_popup_mode_ ? kPopupEdgeThickness : kNormalEdgeThickness; | 376 return is_popup_mode_ ? kPopupEdgeThickness : kNormalEdgeThickness; |
371 } | 377 } |
372 | 378 |
373 // Update the visibility state of the Content Blocked icons to reflect what is | 379 // Update the visibility state of the Content Blocked icons to reflect what is |
374 // actually blocked on the current page. | 380 // actually blocked on the current page. |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
521 // in the right location. | 527 // in the right location. |
522 int animation_offset_; | 528 int animation_offset_; |
523 | 529 |
524 // Used to register for notifications received by NotificationObserver. | 530 // Used to register for notifications received by NotificationObserver. |
525 content::NotificationRegistrar registrar_; | 531 content::NotificationRegistrar registrar_; |
526 | 532 |
527 DISALLOW_COPY_AND_ASSIGN(LocationBarView); | 533 DISALLOW_COPY_AND_ASSIGN(LocationBarView); |
528 }; | 534 }; |
529 | 535 |
530 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ | 536 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ |
OLD | NEW |