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_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" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 115 // Getters. | 115 // Getters. |
| 116 Browser* browser() const { return browser_; } | 116 Browser* browser() const { return browser_; } |
| 117 | 117 |
| 118 BookmarkSubMenuModel* bookmark_sub_menu_model() const { | 118 BookmarkSubMenuModel* bookmark_sub_menu_model() const { |
| 119 return bookmark_sub_menu_model_.get(); | 119 return bookmark_sub_menu_model_.get(); |
| 120 } | 120 } |
| 121 | 121 |
| 122 // Calculates |zoom_label_| in response to a zoom change. | 122 // Calculates |zoom_label_| in response to a zoom change. |
| 123 void UpdateZoomControls(); | 123 void UpdateZoomControls(); |
| 124 | 124 |
| 125 #if defined(TOOLKIT_GTK) | |
|
sail
2012/08/28 16:46:55
I don't think you need this #ifdef.
Lei Zhang
2012/08/28 19:52:54
No other platform needs this functionality right n
sail
2012/08/28 20:42:52
I think that's ok. Even if this is unused the test
| |
| 126 // Rebuilds the model, rather than requiring the object to be recreated. Thus | |
| 127 // avoids having to re-add notification observers, which causes the ordering | |
| 128 // for notifications to be non-deterministic - http://crbug.com/118823. | |
|
sail
2012/08/28 16:46:55
This is kind of vague. Why does the GTK code depen
Lei Zhang
2012/08/28 19:52:54
All platform depends on the zoom notification obse
sail
2012/08/28 20:42:52
I think I understand but that still seems like a b
| |
| 129 void Rebuild(); | |
| 130 #endif | |
| 131 | |
| 125 private: | 132 private: |
| 126 // Testing constructor used for mocking. | 133 // Testing constructor used for mocking. |
| 127 friend class ::MockWrenchMenuModel; | 134 friend class ::MockWrenchMenuModel; |
| 128 WrenchMenuModel(); | 135 WrenchMenuModel(); |
| 129 | 136 |
| 130 void Build(); | 137 void Build(); |
| 131 | 138 |
| 132 void AddGlobalErrorMenuItems(); | 139 void AddGlobalErrorMenuItems(); |
| 133 | 140 |
| 134 // Appends everything needed for the clipboard menu: a menu break, the | 141 // Appends everything needed for the clipboard menu: a menu break, the |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 153 | 160 |
| 154 // Tools menu. | 161 // Tools menu. |
| 155 scoped_ptr<ToolsMenuModel> tools_menu_model_; | 162 scoped_ptr<ToolsMenuModel> tools_menu_model_; |
| 156 | 163 |
| 157 // Bookmark submenu. | 164 // Bookmark submenu. |
| 158 scoped_ptr<BookmarkSubMenuModel> bookmark_sub_menu_model_; | 165 scoped_ptr<BookmarkSubMenuModel> bookmark_sub_menu_model_; |
| 159 | 166 |
| 160 ui::AcceleratorProvider* provider_; // weak | 167 ui::AcceleratorProvider* provider_; // weak |
| 161 | 168 |
| 162 Browser* browser_; // weak | 169 Browser* browser_; // weak |
| 163 TabStripModel* tab_strip_model_; // weak | 170 TabStripModel* tab_strip_model_; // weak |
| 164 | 171 |
| 165 content::NotificationRegistrar registrar_; | 172 content::NotificationRegistrar registrar_; |
| 166 | 173 |
| 167 DISALLOW_COPY_AND_ASSIGN(WrenchMenuModel); | 174 DISALLOW_COPY_AND_ASSIGN(WrenchMenuModel); |
| 168 }; | 175 }; |
| 169 | 176 |
| 170 #endif // CHROME_BROWSER_UI_TOOLBAR_WRENCH_MENU_MODEL_H_ | 177 #endif // CHROME_BROWSER_UI_TOOLBAR_WRENCH_MENU_MODEL_H_ |
| OLD | NEW |