diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-04 21:38:07 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-04 21:38:07 +0000 |
commit | 8af4c1991ec7ff8d8e6bcd87d882ba0c99e4f916 (patch) | |
tree | c17049add98efa0cd11dd1ee0289af7ee848d2a1 /views | |
parent | a0c6c257e5715e1e035f831c77ecb02ba209a86c (diff) | |
download | chromium_src-8af4c1991ec7ff8d8e6bcd87d882ba0c99e4f916.zip chromium_src-8af4c1991ec7ff8d8e6bcd87d882ba0c99e4f916.tar.gz chromium_src-8af4c1991ec7ff8d8e6bcd87d882ba0c99e4f916.tar.bz2 |
Adding drag-drop support in and out of the Browser Action overflow menu.
BUG=26990
TEST=Drag icons into and out of (and within) both the Browser Action container and its overflow menu.
Review URL: http://codereview.chromium.org/570014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38135 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/view.cc | 5 | ||||
-rw-r--r-- | views/view.h | 10 | ||||
-rw-r--r-- | views/view_gtk.cc | 6 | ||||
-rw-r--r-- | views/view_win.cc | 10 |
4 files changed, 27 insertions, 4 deletions
diff --git a/views/view.cc b/views/view.cc index 9c5ab42..b8db44c 100644 --- a/views/view.cc +++ b/views/view.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -41,6 +41,9 @@ ViewsDelegate* ViewsDelegate::views_delegate = NULL; // static char View::kViewClassName[] = "views/View"; +// static +const int View::kShowFolderDropMenuDelay = 400; + ///////////////////////////////////////////////////////////////////////////// // // View - constructors, destructors, initialization diff --git a/views/view.h b/views/view.h index a9865d2..5ae8be5 100644 --- a/views/view.h +++ b/views/view.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -143,6 +143,10 @@ class View : public AcceleratorTarget { // Returns the amount of time between double clicks, in milliseconds. static int GetDoubleClickTimeMS(); + // Returns the amount of time to wait from hovering over a menu button until + // showing the menu. + static int GetMenuShowDelay(); + // Sizing functions // Get the bounds of the View, relative to the parent. Essentially, this @@ -1281,6 +1285,10 @@ class View : public AcceleratorTarget { // right-to-left locales for this View. bool flip_canvas_on_paint_for_rtl_ui_; + // The default value for how long to wait (in ms) before showing a menu + // button on hover. This value is used if the OS doesn't supply one. + static const int kShowFolderDropMenuDelay; + DISALLOW_COPY_AND_ASSIGN(View); }; diff --git a/views/view_gtk.cc b/views/view_gtk.cc index 0e53b38..7621d0f 100644 --- a/views/view_gtk.cc +++ b/views/view_gtk.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -16,6 +16,10 @@ int View::GetDoubleClickTimeMS() { return display ? display->double_click_time : 500; } +int View::GetMenuShowDelay() { + return kShowFolderDropMenuDelay; +} + ViewAccessibilityWrapper* View::GetViewAccessibilityWrapper() { NOTIMPLEMENTED(); return NULL; diff --git a/views/view_win.cc b/views/view_win.cc index e5f1c4f..a92cf68 100644 --- a/views/view_win.cc +++ b/views/view_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -20,6 +20,14 @@ int View::GetDoubleClickTimeMS() { return ::GetDoubleClickTime(); } +// static +int View::GetMenuShowDelay() { + static DWORD delay = 0; + if (!delay && !SystemParametersInfo(SPI_GETMENUSHOWDELAY, 0, &delay, 0)) + delay = View::kShowFolderDropMenuDelay; + return delay; +} + ViewAccessibilityWrapper* View::GetViewAccessibilityWrapper() { if (accessibility_.get() == NULL) { accessibility_.reset(new ViewAccessibilityWrapper(this)); |