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

Side by Side Diff: ash/shell/launcher_delegate_impl.cc

Issue 10139025: Add support for a context menu on the browser shortcut icon (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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 "ash/shell/launcher_delegate_impl.h" 5 #include "ash/shell/launcher_delegate_impl.h"
6 6
7 #include "ash/launcher/launcher_context_menu.h" 7 #include "ash/launcher/launcher_context_menu.h"
8 #include "ash/shell/toplevel_window.h" 8 #include "ash/shell/toplevel_window.h"
9 #include "ash/shell/window_watcher.h" 9 #include "ash/shell/window_watcher.h"
10 #include "ash/wm/window_util.h" 10 #include "ash/wm/window_util.h"
(...skipping 15 matching lines...) Expand all
26 CreateNewWindow(); 26 CreateNewWindow();
27 } 27 }
28 28
29 void LauncherDelegateImpl::CreateNewWindow() { 29 void LauncherDelegateImpl::CreateNewWindow() {
30 ash::shell::ToplevelWindow::CreateParams create_params; 30 ash::shell::ToplevelWindow::CreateParams create_params;
31 create_params.can_resize = true; 31 create_params.can_resize = true;
32 create_params.can_maximize = true; 32 create_params.can_maximize = true;
33 ash::shell::ToplevelWindow::CreateToplevelWindow(create_params); 33 ash::shell::ToplevelWindow::CreateToplevelWindow(create_params);
34 } 34 }
35 35
36 void LauncherDelegateImpl::CreateNewIncognitoWindow() {
37 CreateNewWindow();
38 }
39
36 void LauncherDelegateImpl::ItemClicked(const ash::LauncherItem& item) { 40 void LauncherDelegateImpl::ItemClicked(const ash::LauncherItem& item) {
37 aura::Window* window = watcher_->GetWindowByID(item.id); 41 aura::Window* window = watcher_->GetWindowByID(item.id);
38 window->Show(); 42 window->Show();
39 ash::wm::ActivateWindow(window); 43 ash::wm::ActivateWindow(window);
40 } 44 }
41 45
42 int LauncherDelegateImpl::GetBrowserShortcutResourceId() { 46 int LauncherDelegateImpl::GetBrowserShortcutResourceId() {
43 return IDR_AURA_LAUNCHER_BROWSER_SHORTCUT; 47 return IDR_AURA_LAUNCHER_BROWSER_SHORTCUT;
44 } 48 }
45 49
46 string16 LauncherDelegateImpl::GetTitle(const ash::LauncherItem& item) { 50 string16 LauncherDelegateImpl::GetTitle(const ash::LauncherItem& item) {
47 return watcher_->GetWindowByID(item.id)->title(); 51 return watcher_->GetWindowByID(item.id)->title();
48 } 52 }
49 53
50 ui::MenuModel* LauncherDelegateImpl::CreateContextMenu( 54 ui::MenuModel* LauncherDelegateImpl::CreateContextMenu(
51 const ash::LauncherItem& item) { 55 const ash::LauncherItem& item) {
52 return NULL; 56 return NULL;
53 } 57 }
54 58
55 ui::MenuModel* LauncherDelegateImpl::CreateContextMenuForLauncher() { 59 ui::MenuModel* LauncherDelegateImpl::CreateContextMenuForLauncher() {
56 return new LauncherContextMenu; 60 return new LauncherContextMenu;
57 } 61 }
58 62
59 ash::LauncherID LauncherDelegateImpl::GetIDByWindow(aura::Window* window) { 63 ash::LauncherID LauncherDelegateImpl::GetIDByWindow(aura::Window* window) {
60 return watcher_->GetIDByWindow(window); 64 return watcher_->GetIDByWindow(window);
61 } 65 }
62 66
67 bool LauncherDelegateImpl::IsLoggedInAsGuest() {
68 return false;
69 }
70
63 } // namespace shell 71 } // namespace shell
64 } // namespace ash 72 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698