OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/libgtk2ui/app_indicator_icon_menu.h" | 5 #include "chrome/browser/ui/libgtkui/app_indicator_icon_menu.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/debug/leak_annotations.h" | 10 #include "base/debug/leak_annotations.h" |
11 #include "chrome/browser/ui/libgtk2ui/menu_util.h" | 11 #include "chrome/browser/ui/libgtkui/menu_util.h" |
12 #include "ui/base/models/menu_model.h" | 12 #include "ui/base/models/menu_model.h" |
13 | 13 |
14 namespace libgtk2ui { | 14 namespace libgtkui { |
15 | 15 |
16 AppIndicatorIconMenu::AppIndicatorIconMenu(ui::MenuModel* model) | 16 AppIndicatorIconMenu::AppIndicatorIconMenu(ui::MenuModel* model) |
17 : menu_model_(model), | 17 : menu_model_(model), |
18 click_action_replacement_menu_item_added_(false), | 18 click_action_replacement_menu_item_added_(false), |
19 gtk_menu_(NULL), | 19 gtk_menu_(NULL), |
20 block_activation_(false) { | 20 block_activation_(false) { |
21 { | 21 { |
22 ANNOTATE_SCOPED_MEMORY_LEAK; // http://crbug.com/378770 | 22 ANNOTATE_SCOPED_MEMORY_LEAK; // http://crbug.com/378770 |
23 gtk_menu_ = gtk_menu_new(); | 23 gtk_menu_ = gtk_menu_new(); |
24 } | 24 } |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 int id; | 114 int id; |
115 if (!GetMenuItemID(menu_item, &id)) | 115 if (!GetMenuItemID(menu_item, &id)) |
116 return; | 116 return; |
117 | 117 |
118 // The menu item can still be activated by hotkeys even if it is disabled. | 118 // The menu item can still be activated by hotkeys even if it is disabled. |
119 if (menu_model_->IsEnabledAt(id)) | 119 if (menu_model_->IsEnabledAt(id)) |
120 ExecuteCommand(model, id); | 120 ExecuteCommand(model, id); |
121 } | 121 } |
122 | 122 |
123 } // namespace libgtk2ui | 123 } // namespace libgtkui |
OLD | NEW |