Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(61)

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc

Issue 8196001: content: Split web_drag_dest_gtk.cc into chrome/ and content/ parts. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: :( Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/bookmarks/bookmark_model.h" 8 #include "chrome/browser/bookmarks/bookmark_model.h"
9 #include "chrome/browser/bookmarks/bookmark_node_data.h" 9 #include "chrome/browser/bookmarks/bookmark_node_data.h"
10 #include "chrome/browser/bookmarks/bookmark_utils.h" 10 #include "chrome/browser/bookmarks/bookmark_utils.h"
11 #include "chrome/browser/prefs/pref_service.h" 11 #include "chrome/browser/prefs/pref_service.h"
12 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h" 13 #include "chrome/browser/ui/views/bookmarks/bookmark_bar_view.h"
14 #include "chrome/browser/ui/views/event_utils.h" 14 #include "chrome/browser/ui/views/event_utils.h"
15 #include "chrome/common/pref_names.h" 15 #include "chrome/common/pref_names.h"
16 #include "content/browser/tab_contents/page_navigator.h" 16 #include "content/browser/tab_contents/page_navigator.h"
17 #include "content/browser/user_metrics.h" 17 #include "content/browser/user_metrics.h"
18 #include "content/common/page_transition_types.h" 18 #include "content/common/page_transition_types.h"
19 #include "grit/generated_resources.h" 19 #include "grit/generated_resources.h"
20 #include "grit/theme_resources.h" 20 #include "grit/theme_resources.h"
21 #include "grit/ui_resources.h" 21 #include "grit/ui_resources.h"
22 #include "ui/base/dragdrop/bookmark_format.h"
22 #include "ui/base/dragdrop/os_exchange_data.h" 23 #include "ui/base/dragdrop/os_exchange_data.h"
23 #include "ui/base/l10n/l10n_util.h" 24 #include "ui/base/l10n/l10n_util.h"
24 #include "ui/base/resource/resource_bundle.h" 25 #include "ui/base/resource/resource_bundle.h"
25 #include "views/controls/button/menu_button.h" 26 #include "views/controls/button/menu_button.h"
26 #include "views/controls/menu/menu_item_view.h" 27 #include "views/controls/menu/menu_item_view.h"
27 #include "views/controls/menu/submenu_view.h" 28 #include "views/controls/menu/submenu_view.h"
28 #include "views/widget/widget.h" 29 #include "views/widget/widget.h"
29 30
30 using views::MenuItemView; 31 using views::MenuItemView;
31 32
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 125
125 bookmark_utils::OpenAll(parent_->GetNativeWindow(), profile_, page_navigator_, 126 bookmark_utils::OpenAll(parent_->GetNativeWindow(), profile_, page_navigator_,
126 selection, initial_disposition); 127 selection, initial_disposition);
127 } 128 }
128 129
129 bool BookmarkMenuDelegate::GetDropFormats( 130 bool BookmarkMenuDelegate::GetDropFormats(
130 MenuItemView* menu, 131 MenuItemView* menu,
131 int* formats, 132 int* formats,
132 std::set<ui::OSExchangeData::CustomFormat>* custom_formats) { 133 std::set<ui::OSExchangeData::CustomFormat>* custom_formats) {
133 *formats = ui::OSExchangeData::URL; 134 *formats = ui::OSExchangeData::URL;
134 custom_formats->insert(BookmarkNodeData::GetBookmarkCustomFormat()); 135 custom_formats->insert(ui::GetBookmarkCustomFormat());
135 return true; 136 return true;
136 } 137 }
137 138
138 bool BookmarkMenuDelegate::AreDropTypesRequired(MenuItemView* menu) { 139 bool BookmarkMenuDelegate::AreDropTypesRequired(MenuItemView* menu) {
139 return true; 140 return true;
140 } 141 }
141 142
142 bool BookmarkMenuDelegate::CanDrop(MenuItemView* menu, 143 bool BookmarkMenuDelegate::CanDrop(MenuItemView* menu,
143 const ui::OSExchangeData& data) { 144 const ui::OSExchangeData& data) {
144 // Only accept drops of 1 node, which is the case for all data dragged from 145 // Only accept drops of 1 node, which is the case for all data dragged from
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 MenuItemView* BookmarkMenuDelegate::GetMenuByID(int id) { 441 MenuItemView* BookmarkMenuDelegate::GetMenuByID(int id) {
441 for (NodeToMenuMap::const_iterator i = node_to_menu_map_.begin(); 442 for (NodeToMenuMap::const_iterator i = node_to_menu_map_.begin();
442 i != node_to_menu_map_.end(); ++i) { 443 i != node_to_menu_map_.end(); ++i) {
443 MenuItemView* menu = i->second->GetMenuItemByID(id); 444 MenuItemView* menu = i->second->GetMenuItemByID(id);
444 if (menu) 445 if (menu)
445 return menu; 446 return menu;
446 } 447 }
447 448
448 return parent_menu_item_ ? parent_menu_item_->GetMenuItemByID(id) : NULL; 449 return parent_menu_item_ ? parent_menu_item_->GetMenuItemByID(id) : NULL;
449 } 450 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698