| 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/test/test_launcher_delegate.h" | 5 #include "ash/test/test_launcher_delegate.h" |
| 6 | 6 |
| 7 #include "ash/launcher/launcher_model.h" | 7 #include "ash/launcher/launcher_model.h" |
| 8 #include "ash/launcher/launcher_util.h" |
| 8 #include "ash/wm/window_util.h" | 9 #include "ash/wm/window_util.h" |
| 9 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 10 #include "grit/ash_resources.h" | 11 #include "grit/ash_resources.h" |
| 11 #include "ui/aura/window.h" | 12 #include "ui/aura/window.h" |
| 12 | 13 |
| 13 namespace ash { | 14 namespace ash { |
| 14 namespace test { | 15 namespace test { |
| 15 | 16 |
| 16 TestLauncherDelegate* TestLauncherDelegate::instance_ = NULL; | 17 TestLauncherDelegate* TestLauncherDelegate::instance_ = NULL; |
| 17 | 18 |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 if (it != observed_windows_.end()) { | 57 if (it != observed_windows_.end()) { |
| 57 window->parent()->RemoveObserver(this); | 58 window->parent()->RemoveObserver(this); |
| 58 observed_windows_.erase(it); | 59 observed_windows_.erase(it); |
| 59 } | 60 } |
| 60 } | 61 } |
| 61 | 62 |
| 62 void TestLauncherDelegate::OnBrowserShortcutClicked(int event_flags) { | 63 void TestLauncherDelegate::OnBrowserShortcutClicked(int event_flags) { |
| 63 } | 64 } |
| 64 | 65 |
| 65 void TestLauncherDelegate::ItemClicked(const ash::LauncherItem& item, | 66 void TestLauncherDelegate::ItemClicked(const ash::LauncherItem& item, |
| 66 int event_flags) { | 67 const ui::Event& event) { |
| 67 aura::Window* window = GetWindowByID(item.id); | 68 aura::Window* window = GetWindowByID(item.id); |
| 69 launcher::MoveToEventRootIfPanel(window, event); |
| 68 window->Show(); | 70 window->Show(); |
| 69 ash::wm::ActivateWindow(window); | 71 ash::wm::ActivateWindow(window); |
| 70 } | 72 } |
| 71 | 73 |
| 72 int TestLauncherDelegate::GetBrowserShortcutResourceId() { | 74 int TestLauncherDelegate::GetBrowserShortcutResourceId() { |
| 73 return IDR_AURA_LAUNCHER_BROWSER_SHORTCUT; | 75 return IDR_AURA_LAUNCHER_BROWSER_SHORTCUT; |
| 74 } | 76 } |
| 75 | 77 |
| 76 string16 TestLauncherDelegate::GetTitle(const ash::LauncherItem& item) { | 78 string16 TestLauncherDelegate::GetTitle(const ash::LauncherItem& item) { |
| 77 aura::Window* window = GetWindowByID(item.id); | 79 aura::Window* window = GetWindowByID(item.id); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 105 } | 107 } |
| 106 return NULL; | 108 return NULL; |
| 107 } | 109 } |
| 108 | 110 |
| 109 bool TestLauncherDelegate::IsDraggable(const ash::LauncherItem& item) { | 111 bool TestLauncherDelegate::IsDraggable(const ash::LauncherItem& item) { |
| 110 return true; | 112 return true; |
| 111 } | 113 } |
| 112 | 114 |
| 113 } // namespace test | 115 } // namespace test |
| 114 } // namespace ash | 116 } // namespace ash |
| OLD | NEW |