OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/ui/gtk/browser_titlebar.h" | 5 #include "chrome/browser/ui/gtk/browser_titlebar.h" |
6 | 6 |
7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 | 143 |
144 } // namespace | 144 } // namespace |
145 | 145 |
146 //////////////////////////////////////////////////////////////////////////////// | 146 //////////////////////////////////////////////////////////////////////////////// |
147 // PopupPageMenuModel | 147 // PopupPageMenuModel |
148 | 148 |
149 // A menu model that builds the contents of the menu shown for popups (when the | 149 // A menu model that builds the contents of the menu shown for popups (when the |
150 // user clicks on the favicon) and all of its submenus. | 150 // user clicks on the favicon) and all of its submenus. |
151 class PopupPageMenuModel : public ui::SimpleMenuModel { | 151 class PopupPageMenuModel : public ui::SimpleMenuModel { |
152 public: | 152 public: |
153 explicit PopupPageMenuModel(ui::SimpleMenuModel::Delegate* delegate, | 153 PopupPageMenuModel(ui::SimpleMenuModel::Delegate* delegate, Browser* browser); |
154 Browser* browser); | |
155 virtual ~PopupPageMenuModel() { } | 154 virtual ~PopupPageMenuModel() { } |
156 | 155 |
157 private: | 156 private: |
158 void Build(); | 157 void Build(); |
159 | 158 |
160 // Models for submenus referenced by this model. SimpleMenuModel only uses | 159 // Models for submenus referenced by this model. SimpleMenuModel only uses |
161 // weak references so these must be kept for the lifetime of the top-level | 160 // weak references so these must be kept for the lifetime of the top-level |
162 // model. | 161 // model. |
163 scoped_ptr<ZoomMenuModel> zoom_menu_model_; | 162 scoped_ptr<ZoomMenuModel> zoom_menu_model_; |
164 scoped_ptr<EncodingMenuModel> encoding_menu_model_; | 163 scoped_ptr<EncodingMenuModel> encoding_menu_model_; |
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1043 ui::SimpleMenuModel::Delegate* delegate) | 1042 ui::SimpleMenuModel::Delegate* delegate) |
1044 : SimpleMenuModel(delegate) { | 1043 : SimpleMenuModel(delegate) { |
1045 AddItemWithStringId(IDC_NEW_TAB, IDS_TAB_CXMENU_NEWTAB); | 1044 AddItemWithStringId(IDC_NEW_TAB, IDS_TAB_CXMENU_NEWTAB); |
1046 AddItemWithStringId(IDC_RESTORE_TAB, IDS_RESTORE_TAB); | 1045 AddItemWithStringId(IDC_RESTORE_TAB, IDS_RESTORE_TAB); |
1047 AddSeparator(); | 1046 AddSeparator(); |
1048 AddItemWithStringId(IDC_TASK_MANAGER, IDS_TASK_MANAGER); | 1047 AddItemWithStringId(IDC_TASK_MANAGER, IDS_TASK_MANAGER); |
1049 AddSeparator(); | 1048 AddSeparator(); |
1050 AddCheckItemWithStringId(kShowWindowDecorationsCommand, | 1049 AddCheckItemWithStringId(kShowWindowDecorationsCommand, |
1051 IDS_SHOW_WINDOW_DECORATIONS_MENU); | 1050 IDS_SHOW_WINDOW_DECORATIONS_MENU); |
1052 } | 1051 } |
OLD | NEW |