| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_TOOLBAR_TOOLBAR_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_VIEW_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "base/observer_list.h" | 11 #include "base/observer_list.h" |
| 12 #include "chrome/browser/command_observer.h" | 12 #include "chrome/browser/command_observer.h" |
| 13 #include "chrome/browser/ui/toolbar/app_menu_icon_controller.h" | 13 #include "chrome/browser/ui/toolbar/app_menu_icon_controller.h" |
| 14 #include "chrome/browser/ui/toolbar/back_forward_menu_model.h" | 14 #include "chrome/browser/ui/toolbar/back_forward_menu_model.h" |
| 15 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 15 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 16 #include "components/prefs/pref_member.h" | 16 #include "components/prefs/pref_member.h" |
| 17 #include "components/translate/core/browser/translate_step.h" |
| 18 #include "components/translate/core/common/translate_errors.h" |
| 17 #include "ui/base/accelerators/accelerator.h" | 19 #include "ui/base/accelerators/accelerator.h" |
| 18 #include "ui/views/accessible_pane_view.h" | 20 #include "ui/views/accessible_pane_view.h" |
| 19 #include "ui/views/controls/button/menu_button.h" | 21 #include "ui/views/controls/button/menu_button.h" |
| 20 #include "ui/views/controls/button/menu_button_listener.h" | 22 #include "ui/views/controls/button/menu_button_listener.h" |
| 21 #include "ui/views/view.h" | 23 #include "ui/views/view.h" |
| 22 | 24 |
| 23 class AppMenuButton; | 25 class AppMenuButton; |
| 24 class BackButton; | 26 class BackButton; |
| 25 class Browser; | 27 class Browser; |
| 26 class BrowserActionsContainer; | 28 class BrowserActionsContainer; |
| 27 class HomeButton; | 29 class HomeButton; |
| 28 class ReloadButton; | 30 class ReloadButton; |
| 29 class ToolbarButton; | 31 class ToolbarButton; |
| 30 | 32 |
| 33 namespace autofill { |
| 34 class SaveCardBubbleController; |
| 35 class SaveCardBubbleView; |
| 36 } |
| 37 |
| 31 namespace bookmarks { | 38 namespace bookmarks { |
| 32 class BookmarkBubbleObserver; | 39 class BookmarkBubbleObserver; |
| 33 } | 40 } |
| 34 | 41 |
| 35 namespace extensions { | 42 namespace extensions { |
| 36 class Command; | 43 class Command; |
| 37 class Extension; | 44 class Extension; |
| 38 } | 45 } |
| 39 | 46 |
| 40 // The Browser Window's toolbar. | 47 // The Browser Window's toolbar. |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // Returns true if the app menu is focused. | 80 // Returns true if the app menu is focused. |
| 74 bool IsAppMenuFocused(); | 81 bool IsAppMenuFocused(); |
| 75 | 82 |
| 76 virtual bool GetAcceleratorInfo(int id, ui::Accelerator* accel); | 83 virtual bool GetAcceleratorInfo(int id, ui::Accelerator* accel); |
| 77 | 84 |
| 78 // Shows a bookmark bubble and anchors it appropriately. | 85 // Shows a bookmark bubble and anchors it appropriately. |
| 79 void ShowBookmarkBubble(const GURL& url, | 86 void ShowBookmarkBubble(const GURL& url, |
| 80 bool already_bookmarked, | 87 bool already_bookmarked, |
| 81 bookmarks::BookmarkBubbleObserver* observer); | 88 bookmarks::BookmarkBubbleObserver* observer); |
| 82 | 89 |
| 83 // Returns the view to which the "Save credit card" bubble should be anchored. | 90 // Shows a bubble offering to save a credit card and anchors it appropriately. |
| 84 views::View* GetSaveCreditCardBubbleAnchor(); | 91 autofill::SaveCardBubbleView* ShowSaveCreditCardBubble( |
| 92 content::WebContents* contents, |
| 93 autofill::SaveCardBubbleController* controller, |
| 94 bool is_user_gesture); |
| 85 | 95 |
| 86 // Returns the view to which the Translate bubble should be anchored. | 96 // Shows the translate bubble and anchors it appropriately. |
| 87 views::View* GetTranslateBubbleAnchor(); | 97 void ShowTranslateBubble(content::WebContents* web_contents, |
| 88 | 98 translate::TranslateStep step, |
| 89 // Adds |anchor_view| as an observer of |bubble_widget| to track its | 99 translate::TranslateErrors::Type error_type, |
| 90 // visibility. | 100 bool is_user_gesture); |
| 91 void OnBubbleCreatedForAnchor(views::View* anchor_view, | |
| 92 views::Widget* bubble_widget); | |
| 93 | 101 |
| 94 // Returns the maximum width the browser actions container can have. | 102 // Returns the maximum width the browser actions container can have. |
| 95 int GetMaxBrowserActionsWidth() const; | 103 int GetMaxBrowserActionsWidth() const; |
| 96 | 104 |
| 97 // Accessors. | 105 // Accessors. |
| 98 Browser* browser() const { return browser_; } | 106 Browser* browser() const { return browser_; } |
| 99 BrowserActionsContainer* browser_actions() const { return browser_actions_; } | 107 BrowserActionsContainer* browser_actions() const { return browser_actions_; } |
| 100 ReloadButton* reload_button() const { return reload_; } | 108 ReloadButton* reload_button() const { return reload_; } |
| 101 LocationBarView* location_bar() const { return location_bar_; } | 109 LocationBarView* location_bar() const { return location_bar_; } |
| 102 AppMenuButton* app_menu_button() const { return app_menu_button_; } | 110 AppMenuButton* app_menu_button() const { return app_menu_button_; } |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 | 222 |
| 215 // The display mode used when laying out the toolbar. | 223 // The display mode used when laying out the toolbar. |
| 216 const DisplayMode display_mode_; | 224 const DisplayMode display_mode_; |
| 217 | 225 |
| 218 content::NotificationRegistrar registrar_; | 226 content::NotificationRegistrar registrar_; |
| 219 | 227 |
| 220 DISALLOW_IMPLICIT_CONSTRUCTORS(ToolbarView); | 228 DISALLOW_IMPLICIT_CONSTRUCTORS(ToolbarView); |
| 221 }; | 229 }; |
| 222 | 230 |
| 223 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_VIEW_H_ | 231 #endif // CHROME_BROWSER_UI_VIEWS_TOOLBAR_TOOLBAR_VIEW_H_ |
| OLD | NEW |