Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Side by Side Diff: views/controls/menu/menu_model_adapter.cc

Issue 8508055: Move views::Accelerator to ui in order to use it from aura code. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « views/controls/menu/menu_model_adapter.h ('k') | views/controls/menu/menu_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "views/controls/menu/menu_model_adapter.h" 5 #include "views/controls/menu/menu_model_adapter.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "ui/base/l10n/l10n_util.h" 8 #include "ui/base/l10n/l10n_util.h"
9 #include "ui/base/models/menu_model.h" 9 #include "ui/base/models/menu_model.h"
10 #include "views/controls/menu/submenu_view.h" 10 #include "views/controls/menu/submenu_view.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 73
74 NOTREACHED(); 74 NOTREACHED();
75 } 75 }
76 76
77 bool MenuModelAdapter::IsTriggerableEvent(MenuItemView* source, 77 bool MenuModelAdapter::IsTriggerableEvent(MenuItemView* source,
78 const MouseEvent& e) { 78 const MouseEvent& e) {
79 return (triggerable_event_flags_ & e.flags()) != 0; 79 return (triggerable_event_flags_ & e.flags()) != 0;
80 } 80 }
81 81
82 bool MenuModelAdapter::GetAccelerator(int id, 82 bool MenuModelAdapter::GetAccelerator(int id,
83 views::Accelerator* accelerator) { 83 ui::Accelerator* accelerator) {
84 ui::MenuModel* model = menu_model_; 84 ui::MenuModel* model = menu_model_;
85 int index = 0; 85 int index = 0;
86 if (ui::MenuModel::GetModelAndIndexForCommandId(id, &model, &index)) 86 if (ui::MenuModel::GetModelAndIndexForCommandId(id, &model, &index))
87 return model->GetAcceleratorAt(index, accelerator); 87 return model->GetAcceleratorAt(index, accelerator);
88 88
89 NOTREACHED(); 89 NOTREACHED();
90 return false; 90 return false;
91 } 91 }
92 92
93 string16 MenuModelAdapter::GetLabel(int id) const { 93 string16 MenuModelAdapter::GetLabel(int id) const {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 BuildMenuImpl(item, submodel); 191 BuildMenuImpl(item, submodel);
192 192
193 menu_map_[item] = submodel; 193 menu_map_[item] = submodel;
194 } 194 }
195 } 195 }
196 196
197 menu->set_has_icons(model->HasIcons()); 197 menu->set_has_icons(model->HasIcons());
198 } 198 }
199 199
200 } // namespace views 200 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/menu/menu_model_adapter.h ('k') | views/controls/menu/menu_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698