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

Unified Diff: chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.cc

Issue 12093075: Move the panel to the root window where the mouse click occurred. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updated comment Created 7 years, 11 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/ash/launcher/shell_window_launcher_item_controller.cc
diff --git a/chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.cc
index 2a43c2637a45a4af38cc453b7975094c7ee7ef01..3d7af343f5bcf9fcfc635d53c8b2febf0b5fea76 100644
--- a/chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.cc
+++ b/chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.cc
@@ -4,6 +4,7 @@
#include "chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.h"
+#include "ash/launcher/launcher_util.h"
#include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item.h"
#include "chrome/browser/ui/ash/launcher/chrome_launcher_app_menu_item_v2app.h"
#include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
@@ -115,11 +116,15 @@ void ShellWindowLauncherItemController::Close() {
// * Multiple windows:
// ** If the first window is not active, activate it.
// ** Otherwise activate the next window.
-void ShellWindowLauncherItemController::Clicked() {
+void ShellWindowLauncherItemController::Clicked(const ui::Event& event) {
if (shell_windows_.empty())
return;
ShellWindow* first_window = shell_windows_.front();
if (shell_windows_.size() == 1) {
+ ash::launcher::MoveToEventRootIfPanel(first_window->GetNativeWindow(),
+ event);
+ // If the window moves, it becomes inactive first then
+ // gets activated in |RestoreOrShow| below.
if (first_window->GetBaseWindow()->IsActive())
first_window->GetBaseWindow()->Minimize();
else
« no previous file with comments | « chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.h ('k') | ui/views/widget/root_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698