| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ash/shell/launcher_delegate_impl.h" |
| 6 |
| 7 #include "ash/shell/toplevel_window.h" |
| 8 #include "ash/shell/window_watcher.h" |
| 9 #include "ash/wm/window_util.h" |
| 10 #include "grit/ui_resources.h" |
| 11 #include "ui/aura/window.h" |
| 12 |
| 13 namespace ash { |
| 14 namespace shell { |
| 15 |
| 16 LauncherDelegateImpl::LauncherDelegateImpl(WindowWatcher* watcher) |
| 17 : watcher_(watcher) { |
| 18 } |
| 19 |
| 20 LauncherDelegateImpl::~LauncherDelegateImpl() { |
| 21 } |
| 22 |
| 23 void LauncherDelegateImpl::CreateNewWindow() { |
| 24 ash::shell::ToplevelWindow::CreateParams create_params; |
| 25 create_params.can_resize = true; |
| 26 create_params.can_maximize = true; |
| 27 ash::shell::ToplevelWindow::CreateToplevelWindow(create_params); |
| 28 } |
| 29 |
| 30 void LauncherDelegateImpl::ItemClicked(const ash::LauncherItem& item) { |
| 31 aura::Window* window = watcher_->GetWindowByID(item.id); |
| 32 window->Show(); |
| 33 ash::wm::ActivateWindow(window); |
| 34 } |
| 35 |
| 36 int LauncherDelegateImpl::GetBrowserShortcutResourceId() { |
| 37 return IDR_AURA_LAUNCHER_BROWSER_SHORTCUT; |
| 38 } |
| 39 |
| 40 string16 LauncherDelegateImpl::GetTitle(const ash::LauncherItem& item) { |
| 41 return watcher_->GetWindowByID(item.id)->title(); |
| 42 } |
| 43 |
| 44 ui::MenuModel* LauncherDelegateImpl::CreateContextMenu( |
| 45 const ash::LauncherItem& item) { |
| 46 return NULL; |
| 47 } |
| 48 |
| 49 ash::LauncherID LauncherDelegateImpl::GetIDByWindow(aura::Window* window) { |
| 50 return watcher_->GetIDByWindow(window); |
| 51 } |
| 52 |
| 53 } // namespace shell |
| 54 } // namespace ash |
| OLD | NEW |