| Index: ash/test/test_launcher_delegate.cc
|
| diff --git a/ash/test/test_launcher_delegate.cc b/ash/test/test_launcher_delegate.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..639e340181ff129b22cb38f2a078371a65ef8173
|
| --- /dev/null
|
| +++ b/ash/test/test_launcher_delegate.cc
|
| @@ -0,0 +1,65 @@
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "ash/launcher/launcher_model.h"
|
| +#include "ash/test/test_launcher_delegate.h"
|
| +#include "base/utf_string_conversions.h"
|
| +#include "grit/ui_resources.h"
|
| +
|
| +namespace ash {
|
| +namespace test {
|
| +
|
| +TestLauncherDelegate::TestLauncherDelegate(LauncherModel* model)
|
| + : model_(model) {
|
| +}
|
| +
|
| +void TestLauncherDelegate::CreateNewTab() {
|
| + CreateNewWindow();
|
| +}
|
| +
|
| +void TestLauncherDelegate::CreateNewWindow() {
|
| +}
|
| +
|
| +void TestLauncherDelegate::ItemClicked(const ash::LauncherItem& item) {
|
| + //aura::Window* window = watcher_->GetWindowByID(item.id);
|
| + //window->Show();
|
| + //ash::wm::ActivateWindow(window);
|
| +}
|
| +
|
| +int TestLauncherDelegate::GetBrowserShortcutResourceId() {
|
| + return IDR_AURA_LAUNCHER_BROWSER_SHORTCUT;
|
| +}
|
| +
|
| +string16 TestLauncherDelegate::GetTitle(const ash::LauncherItem& item) {
|
| + return string16(ASCIIToUTF16(""));
|
| +}
|
| +
|
| +ui::MenuModel* TestLauncherDelegate::CreateContextMenu(
|
| + const ash::LauncherItem& item) {
|
| + return NULL;
|
| +}
|
| +
|
| +ui::MenuModel* TestLauncherDelegate::CreateContextMenuForLauncher() {
|
| + return NULL;
|
| +}
|
| +
|
| +ash::LauncherID TestLauncherDelegate::GetIDByWindow(aura::Window* window) {
|
| + WindowToID::const_iterator found = window_to_id_.find(window);
|
| + if (found == window_to_id_.end()) return 0;
|
| + return found->second;
|
| +}
|
| +
|
| +void TestLauncherDelegate::AddLauncherItem(aura::Window* window) {
|
| + ash::LauncherItem item;
|
| + item.type = ash::TYPE_TABBED;
|
| + window_to_id_[window] = model_->next_id();
|
| + item.image.setConfig(SkBitmap::kARGB_8888_Config, 16, 16);
|
| + item.image.allocPixels();
|
| + model_->Add(item);
|
| +}
|
| +
|
| +
|
| +
|
| +} // namespace test
|
| +} // namespace ash
|
|
|