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

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

Issue 97173003: ash: Rename more Launcher classes to Shelf*. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: link chrome Created 7 years 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
(Empty)
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ash/shell/window_watcher_launcher_item_delegate.h"
6
7 #include "ash/shell/window_watcher.h"
8 #include "ash/wm/window_util.h"
9 #include "ui/aura/window.h"
10
11 namespace ash {
12 namespace shell {
13
14 WindowWatcherLauncherItemDelegate::WindowWatcherLauncherItemDelegate(
15 ash::LauncherID id,
16 ash::shell::WindowWatcher* watcher)
17 : id_(id),
18 watcher_(watcher) {
19 DCHECK_GT(id_, 0);
20 DCHECK(watcher_);
21 }
22
23 WindowWatcherLauncherItemDelegate::~WindowWatcherLauncherItemDelegate() {
24 }
25
26 bool WindowWatcherLauncherItemDelegate::ItemSelected(const ui::Event& event) {
27 aura::Window* window = watcher_->GetWindowByID(id_);
28 if (window->type() == aura::client::WINDOW_TYPE_PANEL)
29 ash::wm::MoveWindowToEventRoot(window, event);
30 window->Show();
31 ash::wm::ActivateWindow(window);
32 return false;
33 }
34
35 base::string16 WindowWatcherLauncherItemDelegate::GetTitle() {
36 return watcher_->GetWindowByID(id_)->title();
37 }
38
39 ui::MenuModel* WindowWatcherLauncherItemDelegate::CreateContextMenu(
40 aura::Window* root_window) {
41 return NULL;
42 }
43
44 ash::LauncherMenuModel*
45 WindowWatcherLauncherItemDelegate::CreateApplicationMenu(
46 int event_flags) {
47 return NULL;
48 }
49
50 bool WindowWatcherLauncherItemDelegate::IsDraggable() {
51 return true;
52 }
53
54 bool WindowWatcherLauncherItemDelegate::ShouldShowTooltip() {
55 return true;
56 }
57
58 } // namespace shell
59 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell/window_watcher_launcher_item_delegate.h ('k') | ash/shell/window_watcher_shelf_item_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698