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

Unified Diff: chrome/browser/ui/views/extensions/browser_action_drag_data.cc

Issue 399143004: Open the WrenchMenu on mouseover when dragging a browser action (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Win/Test Fix Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/extensions/browser_action_drag_data.cc
diff --git a/chrome/browser/ui/views/extensions/browser_action_drag_data.cc b/chrome/browser/ui/views/extensions/browser_action_drag_data.cc
index f054f1164d7f1946f96153e1ef85c3c309da1ff1..b54c036c65077e293849fe9cde6919e5cd642462 100644
--- a/chrome/browser/ui/views/extensions/browser_action_drag_data.cc
+++ b/chrome/browser/ui/views/extensions/browser_action_drag_data.cc
@@ -10,8 +10,12 @@
#include "chrome/browser/profiles/profile.h"
#include "ui/base/clipboard/clipboard.h"
-const char* BrowserActionDragData::kClipboardFormatString =
- "chromium/x-browser-actions";
+namespace {
+
+// The MIME type for the clipboard format for BrowserActionDragData.
+const char kClipboardFormatString[] = "chromium/x-browser-actions";
+
+}
BrowserActionDragData::BrowserActionDragData()
: profile_(NULL), index_(static_cast<size_t>(-1)) {
@@ -22,7 +26,23 @@ BrowserActionDragData::BrowserActionDragData(
: profile_(NULL), id_(id), index_(index) {
}
-bool BrowserActionDragData::IsFromProfile(Profile* profile) const {
+bool BrowserActionDragData::GetDropFormats(
+ std::set<ui::OSExchangeData::CustomFormat>* custom_formats) {
+ custom_formats->insert(GetBrowserActionCustomFormat());
+ return true;
+}
+
+bool BrowserActionDragData::AreDropTypesRequired() {
+ return true;
+}
+
+bool BrowserActionDragData::CanDrop(const ui::OSExchangeData& data,
+ const Profile* profile) {
+ BrowserActionDragData drop_data;
+ return drop_data.Read(data) && drop_data.IsFromProfile(profile);
+}
+
+bool BrowserActionDragData::IsFromProfile(const Profile* profile) const {
return profile_ == profile;
}

Powered by Google App Engine
This is Rietveld 408576698