diff options
author | simon.hong81@gmail.com <simon.hong81@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-07 20:41:02 +0000 |
---|---|---|
committer | simon.hong81@gmail.com <simon.hong81@gmail.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-07 20:41:02 +0000 |
commit | 6c3906d8470583b3106bec68f6fe562d2d85d129 (patch) | |
tree | 01abb1d24a309a6e4c68459c1291795261cf1d06 /ash/launcher | |
parent | 77a6854b9168765f19573dce9e325c7c90ce3584 (diff) | |
download | chromium_src-6c3906d8470583b3106bec68f6fe562d2d85d129.zip chromium_src-6c3906d8470583b3106bec68f6fe562d2d85d129.tar.gz chromium_src-6c3906d8470583b3106bec68f6fe562d2d85d129.tar.bz2 |
[ash] Enable drag and drop support in all visible app list
Motivation of this CL:
Only app list shown by clicking app list button enables drag and drop from
app list to launcher because dnd host is only set by app list button click.
Other behaviors such as webapp installing from web store or accelerator show
app list, too. DnD feature also should be enabled with these cases.
R=skuhne@chromium.org
BUG=267410
TEST=Manual test
Review URL: https://chromiumcodereview.appspot.com/21765002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@216265 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/launcher')
-rw-r--r-- | ash/launcher/launcher.cc | 4 | ||||
-rw-r--r-- | ash/launcher/launcher.h | 7 | ||||
-rw-r--r-- | ash/launcher/launcher_view.cc | 6 |
3 files changed, 11 insertions, 6 deletions
diff --git a/ash/launcher/launcher.cc b/ash/launcher/launcher.cc index 03e7ff8..3dd2a14 100644 --- a/ash/launcher/launcher.cc +++ b/ash/launcher/launcher.cc @@ -186,4 +186,8 @@ gfx::Rect Launcher::GetLauncherViewBounds() const { return launcher_view_->bounds(); } +app_list::ApplicationDragAndDropHost* Launcher::GetDragAndDropHostForAppList() { + return launcher_view_; +} + } // namespace ash diff --git a/ash/launcher/launcher.h b/ash/launcher/launcher.h index f9bdcc0..c670801 100644 --- a/ash/launcher/launcher.h +++ b/ash/launcher/launcher.h @@ -13,6 +13,10 @@ #include "ui/gfx/size.h" #include "ui/views/widget/widget_observer.h" +namespace app_list { +class ApplicationDragAndDropHost; +} + namespace aura { class Window; } @@ -103,6 +107,9 @@ class ASH_EXPORT Launcher { void SetLauncherViewBounds(gfx::Rect bounds); gfx::Rect GetLauncherViewBounds() const; + // Returns ApplicationDragAndDropHost for this Launcher. + app_list::ApplicationDragAndDropHost* GetDragAndDropHostForAppList(); + private: // LauncherView used to display icons. internal::LauncherView* launcher_view_; diff --git a/ash/launcher/launcher_view.cc b/ash/launcher/launcher_view.cc index ea027f6..3d32892 100644 --- a/ash/launcher/launcher_view.cc +++ b/ash/launcher/launcher_view.cc @@ -25,7 +25,6 @@ #include "ash/shelf/shelf_widget.h" #include "ash/shell_delegate.h" #include "base/auto_reset.h" -#include "base/command_line.h" #include "base/memory/scoped_ptr.h" #include "grit/ash_resources.h" #include "grit/ash_strings.h" @@ -1524,11 +1523,6 @@ void LauncherView::ButtonPressed(views::Button* sender, Shell::GetInstance()->delegate()->RecordUserMetricsAction( UMA_LAUNCHER_CLICK_ON_APPLIST_BUTTON); Shell::GetInstance()->ToggleAppList(GetWidget()->GetNativeView()); - // By setting us as DnD recipient, the app list knows that we can - // handle items. - if (!CommandLine::ForCurrentProcess()->HasSwitch( - ash::switches::kAshDisableDragAndDropAppListToLauncher)) - Shell::GetInstance()->SetDragAndDropHostOfCurrentAppList(this); break; } } |