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 RecentTabsSubMenuModel; | 20 class RecentTabsSubMenuModel; |
20 class TabStripModel; | 21 class TabStripModel; |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // clipboard menu content and the finalizing menu break. If the last break | 141 // clipboard menu content and the finalizing menu break. If the last break |
141 // is not needed it can be suppressed by setting |new_menu| | 142 // is not needed it can be suppressed by setting |new_menu| |
142 // to false. | 143 // to false. |
143 void CreateCutCopyPasteMenu(bool new_menu); | 144 void CreateCutCopyPasteMenu(bool new_menu); |
144 | 145 |
145 // Appends everything needed for the zoom menu: a menu break, then the zoom | 146 // Appends everything needed for the zoom menu: a menu break, then the zoom |
146 // menu content and then another menu break. If the new menu type is used, | 147 // menu content and then another menu break. If the new menu type is used, |
147 // |new_menu| should be set to true. | 148 // |new_menu| should be set to true. |
148 void CreateZoomMenu(bool new_menu); | 149 void CreateZoomMenu(bool new_menu); |
149 | 150 |
| 151 void OnZoomLevelChanged(const std::string& host); |
| 152 |
150 // Models for the special menu items with buttons. | 153 // Models for the special menu items with buttons. |
151 scoped_ptr<ui::ButtonMenuItemModel> edit_menu_item_model_; | 154 scoped_ptr<ui::ButtonMenuItemModel> edit_menu_item_model_; |
152 scoped_ptr<ui::ButtonMenuItemModel> zoom_menu_item_model_; | 155 scoped_ptr<ui::ButtonMenuItemModel> zoom_menu_item_model_; |
153 | 156 |
154 // Label of the zoom label in the zoom menu item. | 157 // Label of the zoom label in the zoom menu item. |
155 string16 zoom_label_; | 158 string16 zoom_label_; |
156 | 159 |
157 // Tools menu. | 160 // Tools menu. |
158 scoped_ptr<ToolsMenuModel> tools_menu_model_; | 161 scoped_ptr<ToolsMenuModel> tools_menu_model_; |
159 | 162 |
160 // Bookmark submenu. | 163 // Bookmark submenu. |
161 scoped_ptr<BookmarkSubMenuModel> bookmark_sub_menu_model_; | 164 scoped_ptr<BookmarkSubMenuModel> bookmark_sub_menu_model_; |
162 | 165 |
163 // Recent Tabs submenu. | 166 // Recent Tabs submenu. |
164 scoped_ptr<RecentTabsSubMenuModel> recent_tabs_sub_menu_model_; | 167 scoped_ptr<RecentTabsSubMenuModel> recent_tabs_sub_menu_model_; |
165 | 168 |
166 ui::AcceleratorProvider* provider_; // weak | 169 ui::AcceleratorProvider* provider_; // weak |
167 | 170 |
168 Browser* browser_; // weak | 171 Browser* browser_; // weak |
169 TabStripModel* tab_strip_model_; // weak | 172 TabStripModel* tab_strip_model_; // weak |
170 | 173 |
| 174 content::HostZoomMap::ZoomLevelChangedCallback zoom_callback_; |
171 content::NotificationRegistrar registrar_; | 175 content::NotificationRegistrar registrar_; |
172 | 176 |
173 DISALLOW_COPY_AND_ASSIGN(WrenchMenuModel); | 177 DISALLOW_COPY_AND_ASSIGN(WrenchMenuModel); |
174 }; | 178 }; |
175 | 179 |
176 #endif // CHROME_BROWSER_UI_TOOLBAR_WRENCH_MENU_MODEL_H_ | 180 #endif // CHROME_BROWSER_UI_TOOLBAR_WRENCH_MENU_MODEL_H_ |
OLD | NEW |