| OLD | NEW |
| 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_item_delegate_manager.h" |
| 7 #include "ash/launcher/launcher_util.h" | 8 #include "ash/launcher/launcher_util.h" |
| 9 #include "ash/shell.h" |
| 8 #include "ash/shell/toplevel_window.h" | 10 #include "ash/shell/toplevel_window.h" |
| 9 #include "ash/shell/window_watcher.h" | 11 #include "ash/shell/window_watcher.h" |
| 10 #include "ash/wm/window_util.h" | 12 #include "ash/wm/window_util.h" |
| 11 #include "base/strings/string_util.h" | 13 #include "base/strings/string_util.h" |
| 12 #include "grit/ash_resources.h" | 14 #include "grit/ash_resources.h" |
| 13 #include "ui/aura/window.h" | 15 #include "ui/aura/window.h" |
| 14 | 16 |
| 15 namespace ash { | 17 namespace ash { |
| 16 namespace shell { | 18 namespace shell { |
| 17 | 19 |
| 18 LauncherDelegateImpl::LauncherDelegateImpl(WindowWatcher* watcher) | 20 LauncherDelegateImpl::LauncherDelegateImpl(WindowWatcher* watcher) |
| 19 : watcher_(watcher) { | 21 : watcher_(watcher) { |
| 22 ash::LauncherItemDelegateManager* manager = |
| 23 ash::Shell::GetInstance()->launcher_item_delegate_manager(); |
| 24 manager->RegisterLauncherItemDelegate(ash::TYPE_TABBED, this); |
| 25 manager->RegisterLauncherItemDelegate(ash::TYPE_APP_PANEL, this); |
| 20 } | 26 } |
| 21 | 27 |
| 22 LauncherDelegateImpl::~LauncherDelegateImpl() { | 28 LauncherDelegateImpl::~LauncherDelegateImpl() { |
| 23 } | 29 } |
| 24 | 30 |
| 25 void LauncherDelegateImpl::ItemSelected(const ash::LauncherItem& item, | 31 void LauncherDelegateImpl::ItemSelected(const ash::LauncherItem& item, |
| 26 const ui::Event& event) { | 32 const ui::Event& event) { |
| 27 aura::Window* window = watcher_->GetWindowByID(item.id); | 33 aura::Window* window = watcher_->GetWindowByID(item.id); |
| 28 if (window->type() == aura::client::WINDOW_TYPE_PANEL) | 34 if (window->type() == aura::client::WINDOW_TYPE_PANEL) |
| 29 ash::wm::MoveWindowToEventRoot(window, event); | 35 ash::wm::MoveWindowToEventRoot(window, event); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 85 |
| 80 bool LauncherDelegateImpl::IsAppPinned(const std::string& app_id) { | 86 bool LauncherDelegateImpl::IsAppPinned(const std::string& app_id) { |
| 81 return false; | 87 return false; |
| 82 } | 88 } |
| 83 | 89 |
| 84 void LauncherDelegateImpl::UnpinAppWithID(const std::string& app_id) { | 90 void LauncherDelegateImpl::UnpinAppWithID(const std::string& app_id) { |
| 85 } | 91 } |
| 86 | 92 |
| 87 } // namespace shell | 93 } // namespace shell |
| 88 } // namespace ash | 94 } // namespace ash |
| OLD | NEW |