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

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

Issue 107163005: [ash] Add TYPE_DIALOG and its item's LauncherContextMenu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 6 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 unified diff | Download patch | Annotate | Revision Log
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 "apps/shell_window.h" 7 #include "apps/shell_window.h"
8 #include "apps/shell_window_registry.h" 8 #include "apps/shell_window_registry.h"
9 #include "ash/host/root_window_host_factory.h" 9 #include "ash/host/root_window_host_factory.h"
10 #include "ash/magnifier/magnifier_constants.h" 10 #include "ash/magnifier/magnifier_constants.h"
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 shelf_delegate_ = ChromeLauncherController::CreateInstance(NULL, model); 120 shelf_delegate_ = ChromeLauncherController::CreateInstance(NULL, model);
121 shelf_delegate_->Init(); 121 shelf_delegate_->Init();
122 } 122 }
123 return shelf_delegate_; 123 return shelf_delegate_;
124 } 124 }
125 125
126 aura::client::UserActionClient* ChromeShellDelegate::CreateUserActionClient() { 126 aura::client::UserActionClient* ChromeShellDelegate::CreateUserActionClient() {
127 return new UserActionHandler; 127 return new UserActionHandler;
128 } 128 }
129 129
130 ui::MenuModel* ChromeShellDelegate::CreateContextMenu(aura::Window* root) { 130 ui::MenuModel* ChromeShellDelegate::CreateContextMenu(
131 aura::Window* root,
132 ash::ShelfItemDelegate* item_delegate,
133 ash::LauncherItem* item) {
131 DCHECK(shelf_delegate_); 134 DCHECK(shelf_delegate_);
132 // Don't show context menu for exclusive app runtime mode. 135 // Don't show context menu for exclusive app runtime mode.
133 if (chrome::IsRunningInAppMode()) 136 if (chrome::IsRunningInAppMode())
134 return NULL; 137 return NULL;
135 138
139 if (item_delegate && item)
140 return new LauncherContextMenu(shelf_delegate_, item_delegate, item, root);
141
136 return new LauncherContextMenu(shelf_delegate_, root); 142 return new LauncherContextMenu(shelf_delegate_, root);
137 } 143 }
138 144
139 ash::RootWindowHostFactory* ChromeShellDelegate::CreateRootWindowHostFactory() { 145 ash::RootWindowHostFactory* ChromeShellDelegate::CreateRootWindowHostFactory() {
140 return ash::RootWindowHostFactory::Create(); 146 return ash::RootWindowHostFactory::Create();
141 } 147 }
142 148
143 base::string16 ChromeShellDelegate::GetProductName() const { 149 base::string16 ChromeShellDelegate::GetProductName() const {
144 return l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); 150 return l10n_util::GetStringUTF16(IDS_PRODUCT_NAME);
145 } 151 }
146 152
147 keyboard::KeyboardControllerProxy* 153 keyboard::KeyboardControllerProxy*
148 ChromeShellDelegate::CreateKeyboardControllerProxy() { 154 ChromeShellDelegate::CreateKeyboardControllerProxy() {
149 return new AshKeyboardControllerProxy(); 155 return new AshKeyboardControllerProxy();
150 } 156 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698