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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 class SelectedKeywordView; | 46 class SelectedKeywordView; |
| 47 class StarView; | 47 class StarView; |
| 48 class TemplateURLService; | 48 class TemplateURLService; |
| 49 class TranslateIconView; | 49 class TranslateIconView; |
| 50 class ZoomView; | 50 class ZoomView; |
| 51 | 51 |
| 52 namespace content { | 52 namespace content { |
| 53 struct SSLStatus; | 53 struct SSLStatus; |
| 54 } | 54 } |
| 55 | 55 |
| 56 namespace gfx { | |
| 57 class SlideAnimation; | |
| 58 } | |
| 59 | |
| 56 namespace views { | 60 namespace views { |
| 57 class BubbleDelegateView; | 61 class BubbleDelegateView; |
| 58 class ImageButton; | 62 class ImageButton; |
| 59 class ImageView; | 63 class ImageView; |
| 60 class Label; | 64 class Label; |
| 61 class Widget; | 65 class Widget; |
| 62 } | 66 } |
| 63 | 67 |
| 64 ///////////////////////////////////////////////////////////////////////////// | 68 ///////////////////////////////////////////////////////////////////////////// |
| 65 // | 69 // |
| 66 // LocationBarView class | 70 // LocationBarView class |
| 67 // | 71 // |
| 68 // The LocationBarView class is a View subclass that paints the background | 72 // The LocationBarView class is a View subclass that paints the background |
| 69 // of the URL bar strip and contains its content. | 73 // of the URL bar strip and contains its content. |
| 70 // | 74 // |
| 71 ///////////////////////////////////////////////////////////////////////////// | 75 ///////////////////////////////////////////////////////////////////////////// |
| 72 class LocationBarView : public LocationBar, | 76 class LocationBarView : public LocationBar, |
| 73 public LocationBarTesting, | 77 public LocationBarTesting, |
| 74 public views::View, | 78 public views::View, |
| 75 public views::ButtonListener, | 79 public views::ButtonListener, |
| 76 public views::DragController, | 80 public views::DragController, |
| 81 public gfx::AnimationDelegate, | |
| 77 public OmniboxEditController, | 82 public OmniboxEditController, |
| 78 public DropdownBarHostDelegate, | 83 public DropdownBarHostDelegate, |
| 79 public TemplateURLServiceObserver, | 84 public TemplateURLServiceObserver, |
| 80 public SearchModelObserver, | 85 public SearchModelObserver, |
| 81 public ui_zoom::ZoomEventManagerObserver { | 86 public ui_zoom::ZoomEventManagerObserver { |
| 82 public: | 87 public: |
| 83 // The location bar view's class name. | 88 // The location bar view's class name. |
| 84 static const char kViewClassName[]; | 89 static const char kViewClassName[]; |
| 85 | 90 |
| 86 // Returns the offset used during dropdown animation. | 91 // Returns the offset used during dropdown animation. |
| (...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 340 void ShowFirstRunBubble() override; | 345 void ShowFirstRunBubble() override; |
| 341 GURL GetDestinationURL() const override; | 346 GURL GetDestinationURL() const override; |
| 342 WindowOpenDisposition GetWindowOpenDisposition() const override; | 347 WindowOpenDisposition GetWindowOpenDisposition() const override; |
| 343 ui::PageTransition GetPageTransition() const override; | 348 ui::PageTransition GetPageTransition() const override; |
| 344 void AcceptInput() override; | 349 void AcceptInput() override; |
| 345 void FocusSearch() override; | 350 void FocusSearch() override; |
| 346 void UpdateContentSettingsIcons() override; | 351 void UpdateContentSettingsIcons() override; |
| 347 void UpdateManagePasswordsIconAndBubble() override; | 352 void UpdateManagePasswordsIconAndBubble() override; |
| 348 void UpdatePageActions() override; | 353 void UpdatePageActions() override; |
| 349 void UpdateBookmarkStarVisibility() override; | 354 void UpdateBookmarkStarVisibility() override; |
| 355 void UpdateLocationBarState(bool visible, bool animation) override; | |
| 350 bool ShowPageActionPopup(const extensions::Extension* extension, | 356 bool ShowPageActionPopup(const extensions::Extension* extension, |
| 351 bool grant_active_tab) override; | 357 bool grant_active_tab) override; |
| 352 void UpdateOpenPDFInReaderPrompt() override; | 358 void UpdateOpenPDFInReaderPrompt() override; |
| 353 void UpdateGeneratedCreditCardView() override; | 359 void UpdateGeneratedCreditCardView() override; |
| 354 void SaveStateToContents(content::WebContents* contents) override; | 360 void SaveStateToContents(content::WebContents* contents) override; |
| 355 const OmniboxView* GetOmniboxView() const override; | 361 const OmniboxView* GetOmniboxView() const override; |
| 356 LocationBarTesting* GetLocationBarForTesting() override; | 362 LocationBarTesting* GetLocationBarForTesting() override; |
| 357 | 363 |
| 358 // LocationBarTesting: | 364 // LocationBarTesting: |
| 359 int PageActionCount() override; | 365 int PageActionCount() override; |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 376 | 382 |
| 377 // views::DragController: | 383 // views::DragController: |
| 378 void WriteDragDataForView(View* sender, | 384 void WriteDragDataForView(View* sender, |
| 379 const gfx::Point& press_pt, | 385 const gfx::Point& press_pt, |
| 380 OSExchangeData* data) override; | 386 OSExchangeData* data) override; |
| 381 int GetDragOperationsForView(View* sender, const gfx::Point& p) override; | 387 int GetDragOperationsForView(View* sender, const gfx::Point& p) override; |
| 382 bool CanStartDragForView(View* sender, | 388 bool CanStartDragForView(View* sender, |
| 383 const gfx::Point& press_pt, | 389 const gfx::Point& press_pt, |
| 384 const gfx::Point& p) override; | 390 const gfx::Point& p) override; |
| 385 | 391 |
| 392 // gfx::AnimationDelegate: | |
| 393 void AnimationProgressed(const gfx::Animation* animation) override; | |
| 394 void AnimationEnded(const gfx::Animation* animation) override; | |
| 395 | |
| 386 // OmniboxEditController: | 396 // OmniboxEditController: |
| 387 void OnChanged() override; | 397 void OnChanged() override; |
| 388 void OnSetFocus() override; | 398 void OnSetFocus() override; |
| 389 InstantController* GetInstant() override; | 399 InstantController* GetInstant() override; |
| 390 const ToolbarModel* GetToolbarModel() const override; | 400 const ToolbarModel* GetToolbarModel() const override; |
| 391 | 401 |
| 392 // DropdownBarHostDelegate: | 402 // DropdownBarHostDelegate: |
| 393 void SetFocusAndSelection(bool select_all) override; | 403 void SetFocusAndSelection(bool select_all) override; |
| 394 void SetAnimationOffset(int offset) override; | 404 void SetAnimationOffset(int offset) override; |
| 395 | 405 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 461 | 471 |
| 462 // The page action icon views. | 472 // The page action icon views. |
| 463 PageActionViews page_action_views_; | 473 PageActionViews page_action_views_; |
| 464 | 474 |
| 465 // The icon for Translate. | 475 // The icon for Translate. |
| 466 TranslateIconView* translate_icon_view_; | 476 TranslateIconView* translate_icon_view_; |
| 467 | 477 |
| 468 // The star. | 478 // The star. |
| 469 StarView* star_view_; | 479 StarView* star_view_; |
| 470 | 480 |
| 481 // Animation to control showing / hiding the location bar. | |
| 482 scoped_ptr<gfx::SlideAnimation> size_animation_; | |
|
Peter Kasting
2015/04/01 20:27:43
Why a scoped_ptr? Seems like this could just be a
benwells
2015/04/02 00:36:54
Done.
| |
| 483 | |
| 471 // Whether we're in popup mode. This value also controls whether the location | 484 // Whether we're in popup mode. This value also controls whether the location |
| 472 // bar is read-only. | 485 // bar is read-only. |
| 473 const bool is_popup_mode_; | 486 const bool is_popup_mode_; |
| 474 | 487 |
| 475 // True if we should show a focus rect while the location entry field is | 488 // True if we should show a focus rect while the location entry field is |
| 476 // focused. Used when the toolbar is in full keyboard accessibility mode. | 489 // focused. Used when the toolbar is in full keyboard accessibility mode. |
| 477 bool show_focus_rect_; | 490 bool show_focus_rect_; |
| 478 | 491 |
| 479 // This is in case we're destroyed before the model loads. We need to make | 492 // This is in case we're destroyed before the model loads. We need to make |
| 480 // Add/RemoveObserver calls. | 493 // Add/RemoveObserver calls. |
| 481 TemplateURLService* template_url_service_; | 494 TemplateURLService* template_url_service_; |
| 482 | 495 |
| 483 // Tracks this preference to determine whether bookmark editing is allowed. | 496 // Tracks this preference to determine whether bookmark editing is allowed. |
| 484 BooleanPrefMember edit_bookmarks_enabled_; | 497 BooleanPrefMember edit_bookmarks_enabled_; |
| 485 | 498 |
| 486 // During dropdown animation, the host clips the widget and draws only the | 499 // During dropdown animation, the host clips the widget and draws only the |
| 487 // bottom part of it. The view needs to know the pixel offset at which we are | 500 // bottom part of it. The view needs to know the pixel offset at which we are |
| 488 // drawing the widget so that we can draw the curved edges that attach to the | 501 // drawing the widget so that we can draw the curved edges that attach to the |
| 489 // toolbar in the right location. | 502 // toolbar in the right location. |
| 490 int dropdown_animation_offset_; | 503 int dropdown_animation_offset_; |
| 491 | 504 |
| 492 // This is a debug state variable that stores if the WebContents was null | 505 // This is a debug state variable that stores if the WebContents was null |
| 493 // during the last RefreshPageAction. | 506 // during the last RefreshPageAction. |
| 494 bool web_contents_null_at_last_refresh_; | 507 bool web_contents_null_at_last_refresh_; |
| 495 | 508 |
| 496 DISALLOW_COPY_AND_ASSIGN(LocationBarView); | 509 DISALLOW_COPY_AND_ASSIGN(LocationBarView); |
| 497 }; | 510 }; |
| 498 | 511 |
| 499 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ | 512 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ |
| OLD | NEW |