OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_VIEWS_TOOLBAR_VIEW_H__ | 5 #ifndef CHROME_BROWSER_VIEWS_TOOLBAR_VIEW_H__ |
6 #define CHROME_BROWSER_VIEWS_TOOLBAR_VIEW_H__ | 6 #define CHROME_BROWSER_VIEWS_TOOLBAR_VIEW_H__ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
11 #include "chrome/browser/back_forward_menu_model.h" | 11 #include "chrome/browser/back_forward_menu_model.h" |
12 #include "chrome/browser/controller.h" | 12 #include "chrome/browser/controller.h" |
13 #include "chrome/browser/encoding_menu_controller_delegate.h" | 13 #include "chrome/browser/encoding_menu_controller_delegate.h" |
14 #include "chrome/browser/views/dom_view.h" | 14 #include "chrome/browser/views/dom_view.h" |
15 #include "chrome/browser/views/go_button.h" | 15 #include "chrome/browser/views/go_button.h" |
16 #include "chrome/browser/views/location_bar_view.h" | 16 #include "chrome/browser/views/location_bar_view.h" |
| 17 #include "chrome/common/notification_service.h" |
17 #include "chrome/common/pref_member.h" | 18 #include "chrome/common/pref_member.h" |
18 #include "chrome/views/menu.h" | 19 #include "chrome/views/menu.h" |
19 #include "chrome/views/menu_button.h" | 20 #include "chrome/views/menu_button.h" |
20 #include "chrome/views/view.h" | 21 #include "chrome/views/view.h" |
21 #include "chrome/views/view_menu_delegate.h" | 22 #include "chrome/views/view_menu_delegate.h" |
22 | 23 |
23 class Browser; | 24 class Browser; |
24 class Profile; | 25 class Profile; |
25 class ToolbarStarToggle; | 26 class ToolbarStarToggle; |
26 | 27 |
27 /////////////////////////////////////////////////////////////////////////////// | 28 /////////////////////////////////////////////////////////////////////////////// |
28 // | 29 // |
29 // BrowserToolbarView class | 30 // BrowserToolbarView class |
30 // | 31 // |
31 // The BrowserToolbarView is responsible for constructing the content of and | 32 // The BrowserToolbarView is responsible for constructing the content of and |
32 // rendering the Toolbar used in the Browser Window | 33 // rendering the Toolbar used in the Browser Window |
33 // | 34 // |
34 /////////////////////////////////////////////////////////////////////////////// | 35 /////////////////////////////////////////////////////////////////////////////// |
35 class BrowserToolbarView : public views::View, | 36 class BrowserToolbarView : public views::View, |
36 public EncodingMenuControllerDelegate, | 37 public EncodingMenuControllerDelegate, |
37 public views::ViewMenuDelegate, | 38 public views::ViewMenuDelegate, |
38 public views::DragController, | 39 public views::DragController, |
39 public LocationBarView::Delegate, | 40 public LocationBarView::Delegate, |
40 public NotificationObserver { | 41 public NotificationObserver, |
| 42 public views::BaseButton::ButtonListener { |
41 public: | 43 public: |
42 BrowserToolbarView(CommandController* controller, Browser* browser); | 44 BrowserToolbarView(CommandController* controller, Browser* browser); |
43 virtual ~BrowserToolbarView(); | 45 virtual ~BrowserToolbarView(); |
44 | 46 |
45 // Create the contents of the Browser Toolbar | 47 // Create the contents of the Browser Toolbar |
46 void Init(Profile* profile); | 48 void Init(Profile* profile); |
47 | 49 |
48 // views::View | 50 // views::View |
49 virtual void Layout(); | 51 virtual void Layout(); |
50 virtual void DidGainFocus(); | 52 virtual void DidGainFocus(); |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
105 virtual TabContents* GetTabContents(); | 107 virtual TabContents* GetTabContents(); |
106 | 108 |
107 Browser* browser() { return browser_; } | 109 Browser* browser() { return browser_; } |
108 | 110 |
109 private: | 111 private: |
110 // NotificationObserver | 112 // NotificationObserver |
111 virtual void Observe(NotificationType type, | 113 virtual void Observe(NotificationType type, |
112 const NotificationSource& source, | 114 const NotificationSource& source, |
113 const NotificationDetails& details); | 115 const NotificationDetails& details); |
114 | 116 |
| 117 virtual void ButtonPressed(views::BaseButton* sender); |
| 118 |
115 // DragController methods for the star button. These allow the drag if the | 119 // DragController methods for the star button. These allow the drag if the |
116 // user hasn't edited the text, the url is valid and should be displayed. | 120 // user hasn't edited the text, the url is valid and should be displayed. |
117 virtual void WriteDragData(View* sender, | 121 virtual void WriteDragData(View* sender, |
118 int press_x, | 122 int press_x, |
119 int press_y, | 123 int press_y, |
120 OSExchangeData* data); | 124 OSExchangeData* data); |
121 virtual int GetDragOperations(View* sender, int x, int y); | 125 virtual int GetDragOperations(View* sender, int x, int y); |
122 | 126 |
123 // Set up the various Views in the toolbar | 127 // Set up the various Views in the toolbar |
124 void CreateLeftSideControls(); | 128 void CreateLeftSideControls(); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 // navigation). | 168 // navigation). |
165 views::View* acc_focused_view_; | 169 views::View* acc_focused_view_; |
166 | 170 |
167 // Controls | 171 // Controls |
168 views::Button* back_; | 172 views::Button* back_; |
169 views::Button* forward_; | 173 views::Button* forward_; |
170 views::Button* reload_; | 174 views::Button* reload_; |
171 views::Button* home_; | 175 views::Button* home_; |
172 ToolbarStarToggle* star_; | 176 ToolbarStarToggle* star_; |
173 LocationBarView* location_bar_; | 177 LocationBarView* location_bar_; |
| 178 views::ToggleButton* threedee_; |
174 GoButton* go_; | 179 GoButton* go_; |
175 views::MenuButton* page_menu_; | 180 views::MenuButton* page_menu_; |
176 views::MenuButton* app_menu_; | 181 views::MenuButton* app_menu_; |
177 Profile* profile_; | 182 Profile* profile_; |
178 Browser* browser_; | 183 Browser* browser_; |
179 | 184 |
180 // Current tab we're showing state for. | 185 // Current tab we're showing state for. |
181 TabContents* tab_; | 186 TabContents* tab_; |
182 | 187 |
183 // Controls whether or not a home button should be shown on the toolbar. | 188 // Controls whether or not a home button should be shown on the toolbar. |
184 BooleanPrefMember show_home_button_; | 189 BooleanPrefMember show_home_button_; |
185 | 190 |
186 // The display mode used when laying out the toolbar. | 191 // The display mode used when laying out the toolbar. |
187 DisplayMode display_mode_; | 192 DisplayMode display_mode_; |
188 }; | 193 }; |
189 | 194 |
190 #endif // CHROME_BROWSER_VIEWS_TOOLBAR_VIEW_H__ | 195 #endif // CHROME_BROWSER_VIEWS_TOOLBAR_VIEW_H__ |
191 | 196 |
OLD | NEW |