OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/views/bookmark_context_menu.h" | 5 #include "chrome/browser/views/bookmark_context_menu.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "chrome/browser/profile.h" | 8 #include "chrome/browser/profile.h" |
9 #include "grit/generated_resources.h" | 9 #include "grit/generated_resources.h" |
10 #include "views/controls/menu/menu_item_view.h" | 10 #include "views/controls/menu/menu_item_view.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 } | 30 } |
31 | 31 |
32 BookmarkContextMenu::~BookmarkContextMenu() { | 32 BookmarkContextMenu::~BookmarkContextMenu() { |
33 } | 33 } |
34 | 34 |
35 void BookmarkContextMenu::RunMenuAt(const gfx::Point& point) { | 35 void BookmarkContextMenu::RunMenuAt(const gfx::Point& point) { |
36 // width/height don't matter here. | 36 // width/height don't matter here. |
37 views::MenuItemView::AnchorPosition anchor = | 37 views::MenuItemView::AnchorPosition anchor = |
38 (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) ? | 38 (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) ? |
39 views::MenuItemView::TOPRIGHT : views::MenuItemView::TOPLEFT; | 39 views::MenuItemView::TOPRIGHT : views::MenuItemView::TOPLEFT; |
40 menu_->RunMenuAt(parent_window_, gfx::Rect(point.x(), point.y(), 0, 0), | 40 menu_->RunMenuAt(parent_window_, NULL, gfx::Rect(point.x(), point.y(), 0, 0), |
41 anchor, true); | 41 anchor, true); |
42 } | 42 } |
43 | 43 |
44 //////////////////////////////////////////////////////////////////////////////// | 44 //////////////////////////////////////////////////////////////////////////////// |
45 // BookmarkContextMenu, views::MenuDelegate implementation: | 45 // BookmarkContextMenu, views::MenuDelegate implementation: |
46 | 46 |
47 void BookmarkContextMenu::ExecuteCommand(int command_id) { | 47 void BookmarkContextMenu::ExecuteCommand(int command_id) { |
48 controller_->ExecuteCommand(command_id); | 48 controller_->ExecuteCommand(command_id); |
49 } | 49 } |
50 | 50 |
(...skipping 21 matching lines...) Expand all Loading... |
72 } | 72 } |
73 | 73 |
74 void BookmarkContextMenu::AddSeparator() { | 74 void BookmarkContextMenu::AddSeparator() { |
75 menu_->AppendSeparator(); | 75 menu_->AppendSeparator(); |
76 } | 76 } |
77 | 77 |
78 void BookmarkContextMenu::AddCheckboxItem(int command_id) { | 78 void BookmarkContextMenu::AddCheckboxItem(int command_id) { |
79 menu_->AppendMenuItem(command_id, l10n_util::GetString(command_id), | 79 menu_->AppendMenuItem(command_id, l10n_util::GetString(command_id), |
80 views::MenuItemView::CHECKBOX); | 80 views::MenuItemView::CHECKBOX); |
81 } | 81 } |
OLD | NEW |