Chromium Code Reviews| 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 24 matching lines...) Expand all Loading... | |
| 35 class AutofillCreditCardView; | 35 class AutofillCreditCardView; |
| 36 class CommandUpdater; | 36 class CommandUpdater; |
| 37 class ContentSettingBubbleModelDelegate; | 37 class ContentSettingBubbleModelDelegate; |
| 38 class ContentSettingImageView; | 38 class ContentSettingImageView; |
| 39 class EVBubbleView; | 39 class EVBubbleView; |
| 40 class ExtensionAction; | 40 class ExtensionAction; |
| 41 class GURL; | 41 class GURL; |
| 42 class InstantController; | 42 class InstantController; |
| 43 class KeywordHintView; | 43 class KeywordHintView; |
| 44 class LocationIconView; | 44 class LocationIconView; |
| 45 class MicSearchView; | |
| 46 class OpenPDFInReaderView; | 45 class OpenPDFInReaderView; |
| 47 class PageActionWithBadgeView; | 46 class PageActionWithBadgeView; |
| 48 class PageActionImageView; | 47 class PageActionImageView; |
| 49 class Profile; | 48 class Profile; |
| 50 class ScriptBubbleIconView; | 49 class ScriptBubbleIconView; |
| 51 class SelectedKeywordView; | 50 class SelectedKeywordView; |
| 52 class StarView; | 51 class StarView; |
| 53 class TemplateURLService; | 52 class TemplateURLService; |
| 54 class ZoomView; | 53 class ZoomView; |
| 55 | 54 |
| 56 namespace views { | 55 namespace views { |
| 57 class BubbleDelegateView; | 56 class BubbleDelegateView; |
| 57 class ImageButton; | |
| 58 class Label; | 58 class Label; |
| 59 class Widget; | 59 class Widget; |
| 60 } | 60 } |
| 61 | 61 |
| 62 ///////////////////////////////////////////////////////////////////////////// | 62 ///////////////////////////////////////////////////////////////////////////// |
| 63 // | 63 // |
| 64 // LocationBarView class | 64 // LocationBarView class |
| 65 // | 65 // |
| 66 // The LocationBarView class is a View subclass that paints the background | 66 // The LocationBarView class is a View subclass that paints the background |
| 67 // of the URL bar strip and contains its content. | 67 // of the URL bar strip and contains its content. |
| (...skipping 65 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 // This function should be called if you want to make LocationBarView | |
| 144 // touchable. | |
|
Peter Kasting
2013/08/09 20:57:28
This is still confusing. This has nothing to do w
tfarina
2013/08/10 02:13:40
Done.
| |
| 145 static void InitTouchableLocationBarView(views::View* view); | |
|
Peter Kasting
2013/08/09 20:57:28
Nit: Perhaps for clarity, this should end "...Chil
tfarina
2013/08/10 02:13:40
Done.
| |
| 146 | |
| 143 // Initializes the LocationBarView. | 147 // Initializes the LocationBarView. |
| 144 void Init(); | 148 void Init(); |
| 145 | 149 |
| 146 // True if this instance has been initialized by calling Init, which can only | 150 // 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. | 151 // be called when the receiving instance is attached to a view container. |
| 148 bool IsInitialized() const; | 152 bool IsInitialized() const; |
| 149 | 153 |
| 150 // Returns the appropriate color for the desired kind, based on the user's | 154 // Returns the appropriate color for the desired kind, based on the user's |
| 151 // system theme. | 155 // system theme. |
| 152 SkColor GetColor(ToolbarModel::SecurityLevel security_level, | 156 SkColor GetColor(ToolbarModel::SecurityLevel security_level, |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 326 | 330 |
| 327 // Returns the height of the control without the top and bottom | 331 // Returns the height of the control without the top and bottom |
| 328 // edges(i.e. the height of the edit control inside). If | 332 // edges(i.e. the height of the edit control inside). If |
| 329 // |use_preferred_size| is true this will be the preferred height, | 333 // |use_preferred_size| is true this will be the preferred height, |
| 330 // otherwise it will be the current height. | 334 // otherwise it will be the current height. |
| 331 int GetInternalHeight(bool use_preferred_size); | 335 int GetInternalHeight(bool use_preferred_size); |
| 332 | 336 |
| 333 // Returns the position and width that the popup should be, and also the left | 337 // 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 | 338 // edge that the results should align themselves to (which will leave some |
| 335 // border on the left of the popup). | 339 // border on the left of the popup). |
| 336 void GetOmniboxPopupPositioningInfo( | 340 void GetOmniboxPopupPositioningInfo(gfx::Point* top_left_screen_coord, |
| 337 gfx::Point* top_left_screen_coord, | 341 int* popup_width, |
| 338 int* popup_width, | 342 int* left_margin, |
| 339 int* left_margin, | 343 int* right_margin); |
| 340 int* right_margin); | |
| 341 | 344 |
| 342 // Space between items in the location bar, as well as between items and the | 345 // Space between items in the location bar, as well as between items and the |
| 343 // edges. | 346 // edges. |
| 344 static int GetItemPadding(); | 347 static int GetItemPadding(); |
| 345 | 348 |
| 346 // Thickness of the edges of the omnibox background images, in normal mode. | 349 // Thickness of the edges of the omnibox background images, in normal mode. |
| 347 static const int kNormalEdgeThickness; | 350 static const int kNormalEdgeThickness; |
| 348 // The same, but for popup mode. | 351 // The same, but for popup mode. |
| 349 static const int kPopupEdgeThickness; | 352 static const int kPopupEdgeThickness; |
| 350 // Amount of padding built into the standard omnibox icons. | 353 // Amount of padding built into the standard omnibox icons. |
| 351 static const int kIconInternalPadding; | 354 static const int kIconInternalPadding; |
| 352 // Space between the edge and a bubble. | 355 // Space between the edge and a bubble. |
| 353 static const int kBubblePadding; | 356 static const int kBubblePadding; |
| 354 | 357 |
| 355 protected: | 358 protected: |
| 356 virtual void OnFocus() OVERRIDE; | 359 virtual void OnFocus() OVERRIDE; |
| 357 | 360 |
| 358 private: | 361 private: |
| 359 typedef std::vector<ContentSettingImageView*> ContentSettingViews; | 362 typedef std::vector<ContentSettingImageView*> ContentSettingViews; |
| 360 | 363 |
| 361 friend class PageActionImageView; | 364 friend class PageActionImageView; |
| 362 friend class PageActionWithBadgeView; | 365 friend class PageActionWithBadgeView; |
| 363 typedef std::vector<PageActionWithBadgeView*> PageActionViews; | 366 typedef std::vector<PageActionWithBadgeView*> PageActionViews; |
| 364 | 367 |
| 368 // Returns the number of pixels of built-in padding to the left and | |
| 369 // right for child views. This is used to increase the area in Location Bar to | |
| 370 // make it more touchable. | |
|
Peter Kasting
2013/08/09 20:57:28
Nit: This comment likewise has problems. We're no
tfarina
2013/08/10 02:13:40
Done.
| |
| 371 static int GetBuiltInHorizontalPaddingForChildViews(); | |
| 372 | |
| 365 // Returns the thickness of any visible left and right edge, in pixels. | 373 // Returns the thickness of any visible left and right edge, in pixels. |
| 366 int GetHorizontalEdgeThickness() const; | 374 int GetHorizontalEdgeThickness() const; |
| 367 | 375 |
| 368 // The same, but for the top and bottom edges. | 376 // The same, but for the top and bottom edges. |
| 369 int vertical_edge_thickness() const { | 377 int vertical_edge_thickness() const { |
| 370 return is_popup_mode_ ? kPopupEdgeThickness : kNormalEdgeThickness; | 378 return is_popup_mode_ ? kPopupEdgeThickness : kNormalEdgeThickness; |
| 371 } | 379 } |
| 372 | 380 |
| 373 // Update the visibility state of the Content Blocked icons to reflect what is | 381 // Update the visibility state of the Content Blocked icons to reflect what is |
| 374 // actually blocked on the current page. | 382 // actually blocked on the current page. |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 468 SelectedKeywordView* selected_keyword_view_; | 476 SelectedKeywordView* selected_keyword_view_; |
| 469 | 477 |
| 470 // View responsible for showing suggested text. This is NULL when there is no | 478 // View responsible for showing suggested text. This is NULL when there is no |
| 471 // suggested text. | 479 // suggested text. |
| 472 views::Label* suggested_text_view_; | 480 views::Label* suggested_text_view_; |
| 473 | 481 |
| 474 // Shown if the selected url has a corresponding keyword. | 482 // Shown if the selected url has a corresponding keyword. |
| 475 KeywordHintView* keyword_hint_view_; | 483 KeywordHintView* keyword_hint_view_; |
| 476 | 484 |
| 477 // The voice search icon. | 485 // The voice search icon. |
| 478 MicSearchView* mic_search_view_; | 486 views::ImageButton* mic_search_view_; |
| 479 | 487 |
| 480 // The content setting views. | 488 // The content setting views. |
| 481 ContentSettingViews content_setting_views_; | 489 ContentSettingViews content_setting_views_; |
| 482 | 490 |
| 483 // The zoom icon. | 491 // The zoom icon. |
| 484 ZoomView* zoom_view_; | 492 ZoomView* zoom_view_; |
| 485 | 493 |
| 486 // A bubble that shows after successful submission of the Autofill dialog. | 494 // A bubble that shows after successful submission of the Autofill dialog. |
| 487 AutofillCreditCardView* autofill_credit_card_view_; | 495 AutofillCreditCardView* autofill_credit_card_view_; |
| 488 | 496 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 521 // in the right location. | 529 // in the right location. |
| 522 int animation_offset_; | 530 int animation_offset_; |
| 523 | 531 |
| 524 // Used to register for notifications received by NotificationObserver. | 532 // Used to register for notifications received by NotificationObserver. |
| 525 content::NotificationRegistrar registrar_; | 533 content::NotificationRegistrar registrar_; |
| 526 | 534 |
| 527 DISALLOW_COPY_AND_ASSIGN(LocationBarView); | 535 DISALLOW_COPY_AND_ASSIGN(LocationBarView); |
| 528 }; | 536 }; |
| 529 | 537 |
| 530 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ | 538 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ |
| OLD | NEW |