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

Unified Diff: ash/wm/app_list_controller.cc

Issue 10831024: ash: Do not close the app-list if user clicked on a menu. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 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
« no previous file with comments | « ash/wm/app_list_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/app_list_controller.cc
diff --git a/ash/wm/app_list_controller.cc b/ash/wm/app_list_controller.cc
index 1fa0ac5bc0b337b0836295f87f9feb993f123f81..9e409fd1d8adcb8e1e90a0f96d5dff014fb495f7 100644
--- a/ash/wm/app_list_controller.cc
+++ b/ash/wm/app_list_controller.cc
@@ -9,6 +9,7 @@
#include "ash/shell.h"
#include "ash/shell_delegate.h"
#include "ash/shell_window_ids.h"
+#include "ash/wm/property_util.h"
#include "ash/wm/shelf_layout_manager.h"
#include "ui/app_list/app_list_view.h"
#include "ui/app_list/icon_cache.h"
@@ -199,7 +200,21 @@ void AppListController::ScheduleAnimation() {
layer->SetBounds(target_bounds);
}
-void AppListController::ProcessLocatedEvent(const aura::LocatedEvent& event) {
+void AppListController::ProcessLocatedEvent(aura::Window* target,
+ const aura::LocatedEvent& event) {
+ // If the event happened on a menu, then the event should not close the app
+ // list.
+ if (target) {
+ RootWindowController* root_controller =
+ GetRootWindowController(target->GetRootWindow());
+ if (root_controller) {
+ aura::Window* menu_container = root_controller->GetContainer(
+ ash::internal::kShellWindowId_MenuContainer);
+ if (menu_container->Contains(target))
+ return;
+ }
+ }
+
if (view_ && is_visible_) {
views::Widget* widget = view_->GetWidget();
if (!widget->GetNativeView()->GetBoundsInRootWindow().Contains(
@@ -225,7 +240,7 @@ bool AppListController::PreHandleKeyEvent(aura::Window* target,
bool AppListController::PreHandleMouseEvent(aura::Window* target,
aura::MouseEvent* event) {
if (event->type() == ui::ET_MOUSE_PRESSED)
- ProcessLocatedEvent(*event);
+ ProcessLocatedEvent(target, *event);
return false;
}
@@ -239,7 +254,7 @@ ui::GestureStatus AppListController::PreHandleGestureEvent(
aura::Window* target,
aura::GestureEvent* event) {
if (event->type() == ui::ET_GESTURE_TAP)
- ProcessLocatedEvent(*event);
+ ProcessLocatedEvent(target, *event);
return ui::GESTURE_STATUS_UNKNOWN;
}
« no previous file with comments | « ash/wm/app_list_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698