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 "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 Loading... | |
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 #if 0 | |
Ben Goodger (Google)
2011/05/31 16:00:00
???
shinyak (Google)
2011/06/09 02:29:04
Done.
| |
58 const int disposition = | 59 const int disposition = |
59 ViewsDelegate::views_delegate->GetDispositionForEvent( | 60 ViewsDelegate::views_delegate->GetDispositionForEvent( |
60 mouse_event_flags); | 61 mouse_event_flags); |
61 model->ActivatedAtWithDisposition(index, disposition); | 62 model->ActivatedAtWithDisposition(index, disposition); |
63 #else | |
64 model->ActivatedAtWithFlags(index, mouse_event_flags); | |
65 #endif | |
62 return; | 66 return; |
63 } | 67 } |
64 | 68 |
65 NOTREACHED(); | 69 NOTREACHED(); |
66 } | 70 } |
67 | 71 |
68 bool MenuModelAdapter::GetAccelerator(int id, | 72 bool MenuModelAdapter::GetAccelerator(int id, |
69 views::Accelerator* accelerator) { | 73 views::Accelerator* accelerator) { |
70 ui::MenuModel* model = menu_model_; | 74 ui::MenuModel* model = menu_model_; |
71 int index = 0; | 75 int index = 0; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
161 BuildMenuImpl(item, submodel); | 165 BuildMenuImpl(item, submodel); |
162 | 166 |
163 menu_map_[item] = submodel; | 167 menu_map_[item] = submodel; |
164 } | 168 } |
165 } | 169 } |
166 | 170 |
167 menu->set_has_icons(model->HasIcons()); | 171 menu->set_has_icons(model->HasIcons()); |
168 } | 172 } |
169 | 173 |
170 } // views | 174 } // views |
OLD | NEW |