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

Unified Diff: views/controls/menu/menu_controller.cc

Issue 199050: Wires up drag and drop for bookmark menus and cleans up a couple of... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 3 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: views/controls/menu/menu_controller.cc
===================================================================
--- views/controls/menu/menu_controller.cc (revision 25647)
+++ views/controls/menu/menu_controller.cc (working copy)
@@ -12,6 +12,7 @@
#include "views/controls/menu/menu_scroll_view_container.h"
#include "views/controls/menu/submenu_view.h"
#include "views/drag_utils.h"
+#include "views/screen.h"
#include "views/view_constants.h"
#include "views/widget/root_view.h"
#include "views/widget/widget.h"
@@ -176,22 +177,10 @@
pending_state_.anchor = position;
owner_ = parent;
- // TODO: push this into Screen.
// Calculate the bounds of the monitor we'll show menus on. Do this once to
// avoid repeated system queries for the info.
-#if defined(OS_WIN)
- POINT initial_loc = { bounds.x(), bounds.y() };
- HMONITOR monitor = MonitorFromPoint(initial_loc, MONITOR_DEFAULTTONEAREST);
- if (monitor) {
- MONITORINFO mi = {0};
- mi.cbSize = sizeof(mi);
- GetMonitorInfo(monitor, &mi);
- // Menus appear over the taskbar.
- pending_state_.monitor_bounds = gfx::Rect(mi.rcMonitor);
- }
-#else
- NOTIMPLEMENTED();
-#endif
+ pending_state_.monitor_bounds = Screen::GetMonitorAreaNearestPoint(
+ bounds.origin());
// Set the selection, which opens the initial menu.
SetSelection(root, true, true);
@@ -496,6 +485,19 @@
// do anything here.
}
+bool MenuController::GetDropFormats(
+ SubmenuView* source,
+ int* formats,
+ std::set<OSExchangeData::CustomFormat>* custom_formats) {
+ return source->GetMenuItem()->GetDelegate()->GetDropFormats(
+ source->GetMenuItem(), formats, custom_formats);
+}
+
+bool MenuController::AreDropTypesRequired(SubmenuView* source) {
+ return source->GetMenuItem()->GetDelegate()->AreDropTypesRequired(
+ source->GetMenuItem());
+}
+
bool MenuController::CanDrop(SubmenuView* source, const OSExchangeData& data) {
return source->GetMenuItem()->GetDelegate()->CanDrop(source->GetMenuItem(),
data);

Powered by Google App Engine
This is Rietveld 408576698