| 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 // Uses GetBuiltInHorizontalPaddingForChildViews() to optionally add |
| 144 // additional padding (via an empty border) to |view|. This should be called |
| 145 // during creation on all child views which are potentially touchable so that |
| 146 // when touch is enabled they will have sufficient padding. |
| 147 static void InitTouchableLocationBarChildView(views::View* view); |
| 148 |
| 143 // Initializes the LocationBarView. | 149 // Initializes the LocationBarView. |
| 144 void Init(); | 150 void Init(); |
| 145 | 151 |
| 146 // True if this instance has been initialized by calling Init, which can only | 152 // 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. | 153 // be called when the receiving instance is attached to a view container. |
| 148 bool IsInitialized() const; | 154 bool IsInitialized() const; |
| 149 | 155 |
| 150 // Returns the appropriate color for the desired kind, based on the user's | 156 // Returns the appropriate color for the desired kind, based on the user's |
| 151 // system theme. | 157 // system theme. |
| 152 SkColor GetColor(ToolbarModel::SecurityLevel security_level, | 158 SkColor GetColor(ToolbarModel::SecurityLevel security_level, |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 | 331 |
| 326 // Returns the height of the control without the top and bottom | 332 // Returns the height of the control without the top and bottom |
| 327 // edges(i.e. the height of the edit control inside). If | 333 // edges(i.e. the height of the edit control inside). If |
| 328 // |use_preferred_size| is true this will be the preferred height, | 334 // |use_preferred_size| is true this will be the preferred height, |
| 329 // otherwise it will be the current height. | 335 // otherwise it will be the current height. |
| 330 int GetInternalHeight(bool use_preferred_size); | 336 int GetInternalHeight(bool use_preferred_size); |
| 331 | 337 |
| 332 // Returns the position and width that the popup should be, and also the left | 338 // Returns the position and width that the popup should be, and also the left |
| 333 // edge that the results should align themselves to (which will leave some | 339 // edge that the results should align themselves to (which will leave some |
| 334 // border on the left of the popup). | 340 // border on the left of the popup). |
| 335 void GetOmniboxPopupPositioningInfo( | 341 void GetOmniboxPopupPositioningInfo(gfx::Point* top_left_screen_coord, |
| 336 gfx::Point* top_left_screen_coord, | 342 int* popup_width, |
| 337 int* popup_width, | 343 int* left_margin, |
| 338 int* left_margin, | 344 int* right_margin); |
| 339 int* right_margin); | |
| 340 | 345 |
| 341 // Space between items in the location bar, as well as between items and the | 346 // Space between items in the location bar, as well as between items and the |
| 342 // edges. | 347 // edges. |
| 343 static int GetItemPadding(); | 348 static int GetItemPadding(); |
| 344 | 349 |
| 345 // Thickness of the edges of the omnibox background images, in normal mode. | 350 // Thickness of the edges of the omnibox background images, in normal mode. |
| 346 static const int kNormalEdgeThickness; | 351 static const int kNormalEdgeThickness; |
| 347 // The same, but for popup mode. | 352 // The same, but for popup mode. |
| 348 static const int kPopupEdgeThickness; | 353 static const int kPopupEdgeThickness; |
| 349 // Amount of padding built into the standard omnibox icons. | 354 // Amount of padding built into the standard omnibox icons. |
| 350 static const int kIconInternalPadding; | 355 static const int kIconInternalPadding; |
| 351 // Space between the edge and a bubble. | 356 // Space between the edge and a bubble. |
| 352 static const int kBubblePadding; | 357 static const int kBubblePadding; |
| 353 | 358 |
| 354 protected: | 359 protected: |
| 355 virtual void OnFocus() OVERRIDE; | 360 virtual void OnFocus() OVERRIDE; |
| 356 | 361 |
| 357 private: | 362 private: |
| 358 typedef std::vector<ContentSettingImageView*> ContentSettingViews; | 363 typedef std::vector<ContentSettingImageView*> ContentSettingViews; |
| 359 | 364 |
| 360 friend class PageActionImageView; | 365 friend class PageActionImageView; |
| 361 friend class PageActionWithBadgeView; | 366 friend class PageActionWithBadgeView; |
| 362 typedef std::vector<PageActionWithBadgeView*> PageActionViews; | 367 typedef std::vector<PageActionWithBadgeView*> PageActionViews; |
| 363 | 368 |
| 369 // Returns the number of pixels of built-in padding to the left and right for |
| 370 // child views. This is nonzero when touch UI is enabled so as to space out |
| 371 // child views for easier targeting. See InitTouchableLocationBarChildView(). |
| 372 static int GetBuiltInHorizontalPaddingForChildViews(); |
| 373 |
| 364 // Returns the thickness of any visible left and right edge, in pixels. | 374 // Returns the thickness of any visible left and right edge, in pixels. |
| 365 int GetHorizontalEdgeThickness() const; | 375 int GetHorizontalEdgeThickness() const; |
| 366 | 376 |
| 367 // The same, but for the top and bottom edges. | 377 // The same, but for the top and bottom edges. |
| 368 int vertical_edge_thickness() const { | 378 int vertical_edge_thickness() const { |
| 369 return is_popup_mode_ ? kPopupEdgeThickness : kNormalEdgeThickness; | 379 return is_popup_mode_ ? kPopupEdgeThickness : kNormalEdgeThickness; |
| 370 } | 380 } |
| 371 | 381 |
| 372 // Update the visibility state of the Content Blocked icons to reflect what is | 382 // Update the visibility state of the Content Blocked icons to reflect what is |
| 373 // actually blocked on the current page. | 383 // actually blocked on the current page. |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 SelectedKeywordView* selected_keyword_view_; | 477 SelectedKeywordView* selected_keyword_view_; |
| 468 | 478 |
| 469 // View responsible for showing suggested text. This is NULL when there is no | 479 // View responsible for showing suggested text. This is NULL when there is no |
| 470 // suggested text. | 480 // suggested text. |
| 471 views::Label* suggested_text_view_; | 481 views::Label* suggested_text_view_; |
| 472 | 482 |
| 473 // Shown if the selected url has a corresponding keyword. | 483 // Shown if the selected url has a corresponding keyword. |
| 474 KeywordHintView* keyword_hint_view_; | 484 KeywordHintView* keyword_hint_view_; |
| 475 | 485 |
| 476 // The voice search icon. | 486 // The voice search icon. |
| 477 MicSearchView* mic_search_view_; | 487 views::ImageButton* mic_search_view_; |
| 478 | 488 |
| 479 // The content setting views. | 489 // The content setting views. |
| 480 ContentSettingViews content_setting_views_; | 490 ContentSettingViews content_setting_views_; |
| 481 | 491 |
| 482 // The zoom icon. | 492 // The zoom icon. |
| 483 ZoomView* zoom_view_; | 493 ZoomView* zoom_view_; |
| 484 | 494 |
| 485 // A bubble that shows after successful submission of the Autofill dialog. | 495 // A bubble that shows after successful submission of the Autofill dialog. |
| 486 AutofillCreditCardView* autofill_credit_card_view_; | 496 AutofillCreditCardView* autofill_credit_card_view_; |
| 487 | 497 |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 // in the right location. | 530 // in the right location. |
| 521 int animation_offset_; | 531 int animation_offset_; |
| 522 | 532 |
| 523 // Used to register for notifications received by NotificationObserver. | 533 // Used to register for notifications received by NotificationObserver. |
| 524 content::NotificationRegistrar registrar_; | 534 content::NotificationRegistrar registrar_; |
| 525 | 535 |
| 526 DISALLOW_COPY_AND_ASSIGN(LocationBarView); | 536 DISALLOW_COPY_AND_ASSIGN(LocationBarView); |
| 527 }; | 537 }; |
| 528 | 538 |
| 529 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ | 539 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ |
| OLD | NEW |