| 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_item_delegate_manager.h" |
| 7 #include "ash/launcher/launcher_model.h" | 8 #include "ash/launcher/launcher_model.h" |
| 8 #include "ash/launcher/launcher_util.h" | 9 #include "ash/launcher/launcher_util.h" |
| 10 #include "ash/shell.h" |
| 9 #include "ash/wm/window_util.h" | 11 #include "ash/wm/window_util.h" |
| 10 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.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 test { | 18 namespace test { |
| 17 | 19 |
| 18 TestLauncherDelegate* TestLauncherDelegate::instance_ = NULL; | 20 TestLauncherDelegate* TestLauncherDelegate::instance_ = NULL; |
| 19 | 21 |
| 20 TestLauncherDelegate::TestLauncherDelegate(LauncherModel* model) | 22 TestLauncherDelegate::TestLauncherDelegate(LauncherModel* model) |
| 21 : model_(model) { | 23 : model_(model) { |
| 22 CHECK(!instance_); | 24 CHECK(!instance_); |
| 23 instance_ = this; | 25 instance_ = this; |
| 26 |
| 27 ash::LauncherItemDelegateManager* manager = |
| 28 ash::Shell::GetInstance()->launcher_item_delegate_manager(); |
| 29 manager->RegisterLauncherItemDelegate(ash::TYPE_APP_PANEL, this); |
| 30 manager->RegisterLauncherItemDelegate(ash::TYPE_TABBED, this); |
| 31 manager->RegisterLauncherItemDelegate(ash::TYPE_APP_SHORTCUT, this); |
| 32 manager->RegisterLauncherItemDelegate(ash::TYPE_BROWSER_SHORTCUT, this); |
| 33 manager->RegisterLauncherItemDelegate(ash::TYPE_PLATFORM_APP, this); |
| 34 manager->RegisterLauncherItemDelegate(ash::TYPE_WINDOWED_APP, this); |
| 24 } | 35 } |
| 25 | 36 |
| 26 TestLauncherDelegate::~TestLauncherDelegate() { | 37 TestLauncherDelegate::~TestLauncherDelegate() { |
| 27 instance_ = NULL; | 38 instance_ = NULL; |
| 28 } | 39 } |
| 29 | 40 |
| 30 void TestLauncherDelegate::AddLauncherItem(aura::Window* window) { | 41 void TestLauncherDelegate::AddLauncherItem(aura::Window* window) { |
| 31 AddLauncherItem(window, STATUS_CLOSED); | 42 AddLauncherItem(window, STATUS_CLOSED); |
| 32 } | 43 } |
| 33 | 44 |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 | 152 |
| 142 bool TestLauncherDelegate::IsAppPinned(const std::string& app_id) { | 153 bool TestLauncherDelegate::IsAppPinned(const std::string& app_id) { |
| 143 return false; | 154 return false; |
| 144 } | 155 } |
| 145 | 156 |
| 146 void TestLauncherDelegate::UnpinAppWithID(const std::string& app_id) { | 157 void TestLauncherDelegate::UnpinAppWithID(const std::string& app_id) { |
| 147 } | 158 } |
| 148 | 159 |
| 149 } // namespace test | 160 } // namespace test |
| 150 } // namespace ash | 161 } // namespace ash |
| OLD | NEW |