| 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_delegate.h" | 5 #include "chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h" |
| 6 | 6 |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/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 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 const ui::Event& event) { | 147 const ui::Event& event) { |
| 148 return (event.flags() & ui::EF_LEFT_MOUSE_BUTTON) && | 148 return (event.flags() & ui::EF_LEFT_MOUSE_BUTTON) && |
| 149 ui::DispositionFromEventFlags(event.flags()) == NEW_BACKGROUND_TAB; | 149 ui::DispositionFromEventFlags(event.flags()) == NEW_BACKGROUND_TAB; |
| 150 } | 150 } |
| 151 | 151 |
| 152 bool BookmarkMenuDelegate::GetDropFormats( | 152 bool BookmarkMenuDelegate::GetDropFormats( |
| 153 MenuItemView* menu, | 153 MenuItemView* menu, |
| 154 int* formats, | 154 int* formats, |
| 155 std::set<ui::OSExchangeData::CustomFormat>* custom_formats) { | 155 std::set<ui::OSExchangeData::CustomFormat>* custom_formats) { |
| 156 *formats = ui::OSExchangeData::URL; | 156 *formats = ui::OSExchangeData::URL; |
| 157 custom_formats->insert(BookmarkNodeData::GetBookmarkCustomFormat()); | 157 custom_formats->insert(BookmarkNodeData::GetFormatType()); |
| 158 return true; | 158 return true; |
| 159 } | 159 } |
| 160 | 160 |
| 161 bool BookmarkMenuDelegate::AreDropTypesRequired(MenuItemView* menu) { | 161 bool BookmarkMenuDelegate::AreDropTypesRequired(MenuItemView* menu) { |
| 162 return true; | 162 return true; |
| 163 } | 163 } |
| 164 | 164 |
| 165 bool BookmarkMenuDelegate::CanDrop(MenuItemView* menu, | 165 bool BookmarkMenuDelegate::CanDrop(MenuItemView* menu, |
| 166 const ui::OSExchangeData& data) { | 166 const ui::OSExchangeData& data) { |
| 167 // Only accept drops of 1 node, which is the case for all data dragged from | 167 // Only accept drops of 1 node, which is the case for all data dragged from |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 BuildMenu(node, 0, submenu, next_menu_id); | 484 BuildMenu(node, 0, submenu, next_menu_id); |
| 485 } else { | 485 } else { |
| 486 NOTREACHED(); | 486 NOTREACHED(); |
| 487 } | 487 } |
| 488 } | 488 } |
| 489 } | 489 } |
| 490 | 490 |
| 491 bool BookmarkMenuDelegate::IsOutsideMenuIdRange(int menu_id) const { | 491 bool BookmarkMenuDelegate::IsOutsideMenuIdRange(int menu_id) const { |
| 492 return menu_id < min_menu_id_ || menu_id > max_menu_id_; | 492 return menu_id < min_menu_id_ || menu_id > max_menu_id_; |
| 493 } | 493 } |
| OLD | NEW |