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

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

Issue 6893046: added CTRL+Click and SHIFT+Click handler for context menu, Back and Forward. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: make this patch applicable to the latest trunk Created 9 years, 6 months 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 | Annotate | Revision Log
« no previous file with comments | « ui/base/models/simple_menu_model.cc ('k') | views/controls/menu/menu_model_adapter_unittest.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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 return; 48 return;
49 } 49 }
50 50
51 NOTREACHED(); 51 NOTREACHED();
52 } 52 }
53 53
54 void MenuModelAdapter::ExecuteCommand(int id, int mouse_event_flags) { 54 void MenuModelAdapter::ExecuteCommand(int id, int mouse_event_flags) {
55 ui::MenuModel* model = menu_model_; 55 ui::MenuModel* model = menu_model_;
56 int index = 0; 56 int index = 0;
57 if (ui::MenuModel::GetModelAndIndexForCommandId(id, &model, &index)) { 57 if (ui::MenuModel::GetModelAndIndexForCommandId(id, &model, &index)) {
58 const int disposition = 58 model->ActivatedAtWithFlags(index, mouse_event_flags);
59 ViewsDelegate::views_delegate->GetDispositionForEvent(
60 mouse_event_flags);
61 model->ActivatedAtWithDisposition(index, disposition);
62 return; 59 return;
63 } 60 }
64 61
65 NOTREACHED(); 62 NOTREACHED();
66 } 63 }
67 64
68 bool MenuModelAdapter::GetAccelerator(int id, 65 bool MenuModelAdapter::GetAccelerator(int id,
69 views::Accelerator* accelerator) { 66 views::Accelerator* accelerator) {
70 ui::MenuModel* model = menu_model_; 67 ui::MenuModel* model = menu_model_;
71 int index = 0; 68 int index = 0;
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 BuildMenuImpl(item, submodel); 174 BuildMenuImpl(item, submodel);
178 175
179 menu_map_[item] = submodel; 176 menu_map_[item] = submodel;
180 } 177 }
181 } 178 }
182 179
183 menu->set_has_icons(model->HasIcons()); 180 menu->set_has_icons(model->HasIcons());
184 } 181 }
185 182
186 } // views 183 } // views
OLDNEW
« no previous file with comments | « ui/base/models/simple_menu_model.cc ('k') | views/controls/menu/menu_model_adapter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698