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

Side by Side Diff: chrome/browser/ui/ash/chrome_shell_delegate.cc

Issue 1812013003: Pass shelf instances, not root windows, for ash context menus. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Call OnShelfAlignmentChanged after LayoutShelf. Created 4 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" 5 #include "chrome/browser/ui/ash/chrome_shell_delegate.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "ash/content/gpu_support_impl.h" 9 #include "ash/content/gpu_support_impl.h"
10 #include "ash/session/session_state_delegate.h" 10 #include "ash/session/session_state_delegate.h"
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 ash::ShelfDelegate* ChromeShellDelegate::CreateShelfDelegate( 135 ash::ShelfDelegate* ChromeShellDelegate::CreateShelfDelegate(
136 ash::ShelfModel* model) { 136 ash::ShelfModel* model) {
137 if (!shelf_delegate_) { 137 if (!shelf_delegate_) {
138 shelf_delegate_ = ChromeLauncherController::CreateInstance(NULL, model); 138 shelf_delegate_ = ChromeLauncherController::CreateInstance(NULL, model);
139 shelf_delegate_->Init(); 139 shelf_delegate_->Init();
140 } 140 }
141 return shelf_delegate_; 141 return shelf_delegate_;
142 } 142 }
143 143
144 ui::MenuModel* ChromeShellDelegate::CreateContextMenu( 144 ui::MenuModel* ChromeShellDelegate::CreateContextMenu(
145 aura::Window* root_window, 145 ash::Shelf* shelf,
146 const ash::ShelfItem* item) { 146 const ash::ShelfItem* item) {
147 DCHECK(shelf_delegate_); 147 DCHECK(shelf_delegate_);
148 // Don't show context menu for exclusive app runtime mode. 148 // Don't show context menu for exclusive app runtime mode.
149 if (chrome::IsRunningInAppMode()) 149 if (chrome::IsRunningInAppMode())
150 return nullptr; 150 return nullptr;
151 151
152 return new LauncherContextMenu(shelf_delegate_, item, root_window); 152 return new LauncherContextMenu(shelf_delegate_, item, shelf);
153 } 153 }
154 154
155 ash::GPUSupport* ChromeShellDelegate::CreateGPUSupport() { 155 ash::GPUSupport* ChromeShellDelegate::CreateGPUSupport() {
156 // Chrome uses real GPU support. 156 // Chrome uses real GPU support.
157 return new ash::GPUSupportImpl; 157 return new ash::GPUSupportImpl;
158 } 158 }
159 159
160 base::string16 ChromeShellDelegate::GetProductName() const { 160 base::string16 ChromeShellDelegate::GetProductName() const {
161 return l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); 161 return l10n_util::GetStringUTF16(IDS_PRODUCT_NAME);
162 } 162 }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 207
208 void ChromeShellDelegate::AddVirtualKeyboardStateObserver( 208 void ChromeShellDelegate::AddVirtualKeyboardStateObserver(
209 ash::VirtualKeyboardStateObserver* observer) { 209 ash::VirtualKeyboardStateObserver* observer) {
210 keyboard_state_observer_list_.AddObserver(observer); 210 keyboard_state_observer_list_.AddObserver(observer);
211 } 211 }
212 212
213 void ChromeShellDelegate::RemoveVirtualKeyboardStateObserver( 213 void ChromeShellDelegate::RemoveVirtualKeyboardStateObserver(
214 ash::VirtualKeyboardStateObserver* observer) { 214 ash::VirtualKeyboardStateObserver* observer) {
215 keyboard_state_observer_list_.RemoveObserver(observer); 215 keyboard_state_observer_list_.RemoveObserver(observer);
216 } 216 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/chrome_shell_delegate.h ('k') | chrome/browser/ui/ash/launcher/chrome_launcher_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698