| 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/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_model.h" | 10 #include "chrome/browser/bookmarks/bookmark_model.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 | 46 |
| 47 void BookmarkContextMenu::RunMenuAt(const gfx::Point& point) { | 47 void BookmarkContextMenu::RunMenuAt(const gfx::Point& point) { |
| 48 content::NotificationService::current()->Notify( | 48 content::NotificationService::current()->Notify( |
| 49 chrome::NOTIFICATION_BOOKMARK_CONTEXT_MENU_SHOWN, | 49 chrome::NOTIFICATION_BOOKMARK_CONTEXT_MENU_SHOWN, |
| 50 content::Source<BookmarkContextMenu>(this), | 50 content::Source<BookmarkContextMenu>(this), |
| 51 content::NotificationService::NoDetails()); | 51 content::NotificationService::NoDetails()); |
| 52 // width/height don't matter here. | 52 // width/height don't matter here. |
| 53 if (menu_runner_->RunMenuAt( | 53 if (menu_runner_->RunMenuAt( |
| 54 parent_widget_, NULL, gfx::Rect(point.x(), point.y(), 0, 0), | 54 parent_widget_, NULL, gfx::Rect(point.x(), point.y(), 0, 0), |
| 55 views::MenuItemView::TOPLEFT, | 55 views::MenuItemView::TOPLEFT, |
| 56 (views::MenuRunner::HAS_MNEMONICS | views::MenuRunner::IS_NESTED)) == | 56 (views::MenuRunner::HAS_MNEMONICS | views::MenuRunner::IS_NESTED | |
| 57 views::MenuRunner::CONTEXT_MENU)) == |
| 57 views::MenuRunner::MENU_DELETED) | 58 views::MenuRunner::MENU_DELETED) |
| 58 return; | 59 return; |
| 59 } | 60 } |
| 60 | 61 |
| 61 void BookmarkContextMenu::SetPageNavigator(PageNavigator* navigator) { | 62 void BookmarkContextMenu::SetPageNavigator(PageNavigator* navigator) { |
| 62 controller_->set_navigator(navigator); | 63 controller_->set_navigator(navigator); |
| 63 } | 64 } |
| 64 | 65 |
| 65 //////////////////////////////////////////////////////////////////////////////// | 66 //////////////////////////////////////////////////////////////////////////////// |
| 66 // BookmarkContextMenu, views::MenuDelegate implementation: | 67 // BookmarkContextMenu, views::MenuDelegate implementation: |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 void BookmarkContextMenu::WillRemoveBookmarks( | 108 void BookmarkContextMenu::WillRemoveBookmarks( |
| 108 const std::vector<const BookmarkNode*>& bookmarks) { | 109 const std::vector<const BookmarkNode*>& bookmarks) { |
| 109 if (observer_) | 110 if (observer_) |
| 110 observer_->WillRemoveBookmarks(bookmarks); | 111 observer_->WillRemoveBookmarks(bookmarks); |
| 111 } | 112 } |
| 112 | 113 |
| 113 void BookmarkContextMenu::DidRemoveBookmarks() { | 114 void BookmarkContextMenu::DidRemoveBookmarks() { |
| 114 if (observer_) | 115 if (observer_) |
| 115 observer_->DidRemoveBookmarks(); | 116 observer_->DidRemoveBookmarks(); |
| 116 } | 117 } |
| OLD | NEW |