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_TOOLBAR_WRENCH_MENU_MODEL_H_ | 5 #ifndef CHROME_BROWSER_UI_TOOLBAR_WRENCH_MENU_MODEL_H_ |
6 #define CHROME_BROWSER_UI_TOOLBAR_WRENCH_MENU_MODEL_H_ | 6 #define CHROME_BROWSER_UI_TOOLBAR_WRENCH_MENU_MODEL_H_ |
7 | 7 |
8 #include "base/file_path.h" | 8 #include "base/file_path.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" |
| 11 #include "content/public/browser/host_zoom_map.h" |
11 #include "content/public/browser/notification_observer.h" | 12 #include "content/public/browser/notification_observer.h" |
12 #include "content/public/browser/notification_registrar.h" | 13 #include "content/public/browser/notification_registrar.h" |
13 #include "ui/base/accelerators/accelerator.h" | 14 #include "ui/base/accelerators/accelerator.h" |
14 #include "ui/base/models/button_menu_item_model.h" | 15 #include "ui/base/models/button_menu_item_model.h" |
15 #include "ui/base/models/simple_menu_model.h" | 16 #include "ui/base/models/simple_menu_model.h" |
16 | 17 |
17 class BookmarkSubMenuModel; | 18 class BookmarkSubMenuModel; |
18 class Browser; | 19 class Browser; |
19 class GlobalError; | 20 class GlobalError; |
20 class RecentTabsSubMenuModel; | 21 class RecentTabsSubMenuModel; |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 // menu content and then another menu break. If the new menu type is used, | 148 // menu content and then another menu break. If the new menu type is used, |
148 // |new_menu| should be set to true. | 149 // |new_menu| should be set to true. |
149 void CreateZoomMenu(bool new_menu); | 150 void CreateZoomMenu(bool new_menu); |
150 | 151 |
151 // Various GlobalError objects share a single menu item. This helper routine | 152 // Various GlobalError objects share a single menu item. This helper routine |
152 // returns the GlobalError object that is currently displaying a message in | 153 // returns the GlobalError object that is currently displaying a message in |
153 // that item, otherwise returns NULL if we should display one of the default | 154 // that item, otherwise returns NULL if we should display one of the default |
154 // messages. | 155 // messages. |
155 GlobalError* GetActiveSignedInServiceError() const; | 156 GlobalError* GetActiveSignedInServiceError() const; |
156 | 157 |
| 158 void OnZoomLevelChanged(const std::string& host); |
| 159 |
157 // Models for the special menu items with buttons. | 160 // Models for the special menu items with buttons. |
158 scoped_ptr<ui::ButtonMenuItemModel> edit_menu_item_model_; | 161 scoped_ptr<ui::ButtonMenuItemModel> edit_menu_item_model_; |
159 scoped_ptr<ui::ButtonMenuItemModel> zoom_menu_item_model_; | 162 scoped_ptr<ui::ButtonMenuItemModel> zoom_menu_item_model_; |
160 | 163 |
161 // Label of the zoom label in the zoom menu item. | 164 // Label of the zoom label in the zoom menu item. |
162 string16 zoom_label_; | 165 string16 zoom_label_; |
163 | 166 |
164 // Tools menu. | 167 // Tools menu. |
165 scoped_ptr<ToolsMenuModel> tools_menu_model_; | 168 scoped_ptr<ToolsMenuModel> tools_menu_model_; |
166 | 169 |
167 // Bookmark submenu. | 170 // Bookmark submenu. |
168 scoped_ptr<BookmarkSubMenuModel> bookmark_sub_menu_model_; | 171 scoped_ptr<BookmarkSubMenuModel> bookmark_sub_menu_model_; |
169 | 172 |
170 // Recent Tabs submenu. | 173 // Recent Tabs submenu. |
171 scoped_ptr<RecentTabsSubMenuModel> recent_tabs_sub_menu_model_; | 174 scoped_ptr<RecentTabsSubMenuModel> recent_tabs_sub_menu_model_; |
172 | 175 |
173 ui::AcceleratorProvider* provider_; // weak | 176 ui::AcceleratorProvider* provider_; // weak |
174 | 177 |
175 Browser* browser_; // weak | 178 Browser* browser_; // weak |
176 TabStripModel* tab_strip_model_; // weak | 179 TabStripModel* tab_strip_model_; // weak |
177 | 180 |
| 181 content::HostZoomMap::ZoomLevelChangedCallback zoom_callback_; |
178 content::NotificationRegistrar registrar_; | 182 content::NotificationRegistrar registrar_; |
179 | 183 |
180 DISALLOW_COPY_AND_ASSIGN(WrenchMenuModel); | 184 DISALLOW_COPY_AND_ASSIGN(WrenchMenuModel); |
181 }; | 185 }; |
182 | 186 |
183 #endif // CHROME_BROWSER_UI_TOOLBAR_WRENCH_MENU_MODEL_H_ | 187 #endif // CHROME_BROWSER_UI_TOOLBAR_WRENCH_MENU_MODEL_H_ |
OLD | NEW |