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_util.h" | 7 #include "ash/launcher/launcher_util.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 14 matching lines...) Expand all Loading... |
25 void LauncherDelegateImpl::OnBrowserShortcutClicked(int event_flags) { | 25 void LauncherDelegateImpl::OnBrowserShortcutClicked(int event_flags) { |
26 ash::shell::ToplevelWindow::CreateParams create_params; | 26 ash::shell::ToplevelWindow::CreateParams create_params; |
27 create_params.can_resize = true; | 27 create_params.can_resize = true; |
28 create_params.can_maximize = true; | 28 create_params.can_maximize = true; |
29 ash::shell::ToplevelWindow::CreateToplevelWindow(create_params); | 29 ash::shell::ToplevelWindow::CreateToplevelWindow(create_params); |
30 } | 30 } |
31 | 31 |
32 void LauncherDelegateImpl::ItemClicked(const ash::LauncherItem& item, | 32 void LauncherDelegateImpl::ItemClicked(const ash::LauncherItem& item, |
33 const ui::Event& event) { | 33 const ui::Event& event) { |
34 aura::Window* window = watcher_->GetWindowByID(item.id); | 34 aura::Window* window = watcher_->GetWindowByID(item.id); |
35 ash::launcher::MoveToEventRootIfPanel(window, event); | 35 if (window->type() == aura::client::WINDOW_TYPE_PANEL) |
| 36 ash::wm::MoveWindowToEventRoot(window, event); |
36 window->Show(); | 37 window->Show(); |
37 ash::wm::ActivateWindow(window); | 38 ash::wm::ActivateWindow(window); |
38 } | 39 } |
39 | 40 |
40 int LauncherDelegateImpl::GetBrowserShortcutResourceId() { | 41 int LauncherDelegateImpl::GetBrowserShortcutResourceId() { |
41 return IDR_AURA_LAUNCHER_BROWSER_SHORTCUT; | 42 return IDR_AURA_LAUNCHER_BROWSER_SHORTCUT; |
42 } | 43 } |
43 | 44 |
44 string16 LauncherDelegateImpl::GetTitle(const ash::LauncherItem& item) { | 45 string16 LauncherDelegateImpl::GetTitle(const ash::LauncherItem& item) { |
45 return watcher_->GetWindowByID(item.id)->title(); | 46 return watcher_->GetWindowByID(item.id)->title(); |
(...skipping 24 matching lines...) Expand all Loading... |
70 } | 71 } |
71 | 72 |
72 void LauncherDelegateImpl::OnLauncherCreated(Launcher* launcher) { | 73 void LauncherDelegateImpl::OnLauncherCreated(Launcher* launcher) { |
73 } | 74 } |
74 | 75 |
75 void LauncherDelegateImpl::OnLauncherDestroyed(Launcher* launcher) { | 76 void LauncherDelegateImpl::OnLauncherDestroyed(Launcher* launcher) { |
76 } | 77 } |
77 | 78 |
78 } // namespace shell | 79 } // namespace shell |
79 } // namespace ash | 80 } // namespace ash |
OLD | NEW |