| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/views/bookmarks/bookmark_context_menu.h" | 5 #include "chrome/browser/ui/views/bookmarks/bookmark_context_menu.h" |
| 6 | 6 |
| 7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 } | 89 } |
| 90 | 90 |
| 91 bool BookmarkContextMenu::IsItemChecked(int command_id) const { | 91 bool BookmarkContextMenu::IsItemChecked(int command_id) const { |
| 92 return controller_->IsCommandIdChecked(command_id); | 92 return controller_->IsCommandIdChecked(command_id); |
| 93 } | 93 } |
| 94 | 94 |
| 95 bool BookmarkContextMenu::IsCommandEnabled(int command_id) const { | 95 bool BookmarkContextMenu::IsCommandEnabled(int command_id) const { |
| 96 return controller_->IsCommandIdEnabled(command_id); | 96 return controller_->IsCommandIdEnabled(command_id); |
| 97 } | 97 } |
| 98 | 98 |
| 99 bool BookmarkContextMenu::IsCommandVisible(int command_id) const { |
| 100 return controller_->IsCommandIdVisible(command_id); |
| 101 } |
| 102 |
| 99 bool BookmarkContextMenu::ShouldCloseAllMenusOnExecute(int id) { | 103 bool BookmarkContextMenu::ShouldCloseAllMenusOnExecute(int id) { |
| 100 return (id != IDC_BOOKMARK_BAR_REMOVE) || close_on_remove_; | 104 return (id != IDC_BOOKMARK_BAR_REMOVE) || close_on_remove_; |
| 101 } | 105 } |
| 102 | 106 |
| 103 //////////////////////////////////////////////////////////////////////////////// | 107 //////////////////////////////////////////////////////////////////////////////// |
| 104 // BookmarkContextMenuControllerDelegate | 108 // BookmarkContextMenuControllerDelegate |
| 105 // implementation: | 109 // implementation: |
| 106 | 110 |
| 107 void BookmarkContextMenu::CloseMenu() { | 111 void BookmarkContextMenu::CloseMenu() { |
| 108 menu_->Cancel(); | 112 menu_->Cancel(); |
| 109 } | 113 } |
| 110 | 114 |
| 111 void BookmarkContextMenu::WillExecuteCommand( | 115 void BookmarkContextMenu::WillExecuteCommand( |
| 112 int command_id, | 116 int command_id, |
| 113 const std::vector<const BookmarkNode*>& bookmarks) { | 117 const std::vector<const BookmarkNode*>& bookmarks) { |
| 114 if (observer_ && IsRemoveBookmarksCommand(command_id)) | 118 if (observer_ && IsRemoveBookmarksCommand(command_id)) |
| 115 observer_->WillRemoveBookmarks(bookmarks); | 119 observer_->WillRemoveBookmarks(bookmarks); |
| 116 } | 120 } |
| 117 | 121 |
| 118 void BookmarkContextMenu::DidExecuteCommand(int command_id) { | 122 void BookmarkContextMenu::DidExecuteCommand(int command_id) { |
| 119 if (observer_ && IsRemoveBookmarksCommand(command_id)) | 123 if (observer_ && IsRemoveBookmarksCommand(command_id)) |
| 120 observer_->DidRemoveBookmarks(); | 124 observer_->DidRemoveBookmarks(); |
| 121 } | 125 } |
| OLD | NEW |