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

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

Issue 6622002: Do all OOLing in the views code. linux_views now builds clean with the clang plugin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 9 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "views/controls/menu/menu_delegate.h"
6
7 namespace views {
8
9 bool MenuDelegate::IsItemChecked(int id) const {
10 return false;
11 }
12
13 std::wstring MenuDelegate::GetLabel(int id) const {
14 return std::wstring();
15 }
16
17 std::wstring MenuDelegate::GetTooltipText(int id,
18 const gfx::Point& screen_loc) {
19 return std::wstring();
20 }
21
22 bool MenuDelegate::GetAccelerator(int id, Accelerator* accelerator) {
23 return false;
24 }
25
26 bool MenuDelegate::ShowContextMenu(MenuItemView* source,
27 int id,
28 const gfx::Point& p,
29 bool is_mouse_gesture) {
30 return false;
31 }
32
33 bool MenuDelegate::SupportsCommand(int id) const {
34 return true;
35 }
36
37 bool MenuDelegate::IsCommandEnabled(int id) const {
38 return true;
39 }
40
41 bool MenuDelegate::GetContextualLabel(int id, std::wstring* out) const {
42 return false;
43 }
44
45 bool MenuDelegate::ShouldCloseAllMenusOnExecute(int id) {
46 return true;
47 }
48
49 void MenuDelegate::ExecuteCommand(int id, int mouse_event_flags) {
50 ExecuteCommand(id);
51 }
52
53 bool MenuDelegate::IsTriggerableEvent(const MouseEvent& e) {
54 return e.IsLeftMouseButton() || e.IsRightMouseButton();
55 }
56
57 bool MenuDelegate::CanDrop(MenuItemView* menu, const OSExchangeData& data) {
58 return false;
59 }
60
61 bool MenuDelegate::GetDropFormats(
62 MenuItemView* menu,
63 int* formats,
64 std::set<OSExchangeData::CustomFormat>* custom_formats) {
65 return false;
66 }
67
68 bool MenuDelegate::AreDropTypesRequired(MenuItemView* menu) {
69 return false;
70 }
71
72 int MenuDelegate::GetDropOperation(MenuItemView* item,
73 const DropTargetEvent& event,
74 DropPosition* position) {
75 NOTREACHED() << "If you override CanDrop, you need to override this too";
76 return ui::DragDropTypes::DRAG_NONE;
77 }
78
79 int MenuDelegate::OnPerformDrop(MenuItemView* menu,
80 DropPosition position,
81 const DropTargetEvent& event) {
82 NOTREACHED() << "If you override CanDrop, you need to override this too";
83 return ui::DragDropTypes::DRAG_NONE;
84 }
85
86 bool MenuDelegate::CanDrag(MenuItemView* menu) {
87 return false;
88 }
89
90 void MenuDelegate::WriteDragData(MenuItemView* sender, OSExchangeData* data) {
91 NOTREACHED() << "If you override CanDrag, you must override this too.";
92 }
93
94 int MenuDelegate::GetDragOperations(MenuItemView* sender) {
95 NOTREACHED() << "If you override CanDrag, you must override this too.";
96 return 0;
97 }
98
99 MenuItemView* MenuDelegate::GetSiblingMenu(MenuItemView* menu,
100 const gfx::Point& screen_point,
101 MenuItemView::AnchorPosition* anchor,
102 bool* has_mnemonics,
103 MenuButton** button) {
104 return NULL;
105 }
106
107 int MenuDelegate::GetMaxWidthForMenu() {
108 // NOTE: this needs to be large enough to accommodate the wrench menu with
109 // big fonts.
110 return 800;
111 }
112
113 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698