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

Unified Diff: chrome/browser/ui/views/chrome_views_delegate.cc

Issue 2073783003: Fixed bug where mash chrome crashes accessing ash::Shell with context menus (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Early return LEAVE_MENU_OPEN instead of CLOSE_MENU Created 4 years, 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/chrome_views_delegate.cc
diff --git a/chrome/browser/ui/views/chrome_views_delegate.cc b/chrome/browser/ui/views/chrome_views_delegate.cc
index 6523962eeedd142ec096abaf1134ec2df9efed0b..48118f31b2e16657aedde235430f33b5b6f372ea 100644
--- a/chrome/browser/ui/views/chrome_views_delegate.cc
+++ b/chrome/browser/ui/views/chrome_views_delegate.cc
@@ -16,6 +16,7 @@
#include "chrome/browser/lifetime/keep_alive_types.h"
#include "chrome/browser/lifetime/scoped_keep_alive.h"
#include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/browser/ui/ash/ash_util.h"
#include "chrome/browser/ui/browser_window_state.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/scoped_user_pref_update.h"
@@ -270,6 +271,10 @@ views::ViewsDelegate::ProcessMenuAcceleratorResult
ChromeViewsDelegate::ProcessAcceleratorWhileMenuShowing(
const ui::Accelerator& accelerator) {
#if defined(USE_ASH)
+ // Early return because mash chrome does not have access to ash::Shell
+ if (chrome::IsRunningInMash())
+ return views::ViewsDelegate::ProcessMenuAcceleratorResult::LEAVE_MENU_OPEN;
+
ash::AcceleratorController* accelerator_controller =
ash::Shell::GetInstance()->accelerator_controller();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698