| 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_menu_controller_views.h" | 5 #include "chrome/browser/ui/views/bookmarks/bookmark_menu_controller_views.h" |
| 6 | 6 |
| 7 #include "base/stl_util.h" | 7 #include "base/stl_util.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/bookmarks/bookmark_model.h" | 9 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 bool BookmarkMenuController::IsTriggerableEvent(views::MenuItemView* menu, | 95 bool BookmarkMenuController::IsTriggerableEvent(views::MenuItemView* menu, |
| 96 const ui::Event& e) { | 96 const ui::Event& e) { |
| 97 return menu_delegate_->IsTriggerableEvent(menu, e); | 97 return menu_delegate_->IsTriggerableEvent(menu, e); |
| 98 } | 98 } |
| 99 | 99 |
| 100 void BookmarkMenuController::ExecuteCommand(int id, int mouse_event_flags) { | 100 void BookmarkMenuController::ExecuteCommand(int id, int mouse_event_flags) { |
| 101 menu_delegate_->ExecuteCommand(id, mouse_event_flags); | 101 menu_delegate_->ExecuteCommand(id, mouse_event_flags); |
| 102 } | 102 } |
| 103 | 103 |
| 104 bool BookmarkMenuController::ShouldExecuteCommandWithoutClosingMenu( |
| 105 int id, const ui::Event& e) { |
| 106 return menu_delegate_->ShouldExecuteCommandWithoutClosingMenu(id, e); |
| 107 } |
| 108 |
| 104 bool BookmarkMenuController::GetDropFormats( | 109 bool BookmarkMenuController::GetDropFormats( |
| 105 MenuItemView* menu, | 110 MenuItemView* menu, |
| 106 int* formats, | 111 int* formats, |
| 107 std::set<ui::OSExchangeData::CustomFormat>* custom_formats) { | 112 std::set<ui::OSExchangeData::CustomFormat>* custom_formats) { |
| 108 return menu_delegate_->GetDropFormats(menu, formats, custom_formats); | 113 return menu_delegate_->GetDropFormats(menu, formats, custom_formats); |
| 109 } | 114 } |
| 110 | 115 |
| 111 bool BookmarkMenuController::AreDropTypesRequired(MenuItemView* menu) { | 116 bool BookmarkMenuController::AreDropTypesRequired(MenuItemView* menu) { |
| 112 return menu_delegate_->AreDropTypesRequired(menu); | 117 return menu_delegate_->AreDropTypesRequired(menu); |
| 113 } | 118 } |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 if (!menu_delegate_->is_mutating_model()) | 193 if (!menu_delegate_->is_mutating_model()) |
| 189 menu()->Cancel(); | 194 menu()->Cancel(); |
| 190 } | 195 } |
| 191 | 196 |
| 192 BookmarkMenuController::~BookmarkMenuController() { | 197 BookmarkMenuController::~BookmarkMenuController() { |
| 193 BookmarkModelFactory::GetForProfile( | 198 BookmarkModelFactory::GetForProfile( |
| 194 menu_delegate_->profile())->RemoveObserver(this); | 199 menu_delegate_->profile())->RemoveObserver(this); |
| 195 if (observer_) | 200 if (observer_) |
| 196 observer_->BookmarkMenuDeleted(this); | 201 observer_->BookmarkMenuDeleted(this); |
| 197 } | 202 } |
| OLD | NEW |