OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "ash/launcher/launcher_model.h" | |
6 #include "ash/test/test_launcher_delegate.h" | |
sky
2012/04/11 15:47:49
this should be your first include.
| |
7 #include "base/utf_string_conversions.h" | |
8 #include "grit/ui_resources.h" | |
9 | |
10 namespace ash { | |
11 namespace test { | |
12 | |
13 TestLauncherDelegate::TestLauncherDelegate(LauncherModel* model) | |
14 : model_(model) { | |
sky
2012/04/11 15:47:49
nit: 4 space indent.
| |
15 } | |
16 | |
17 void TestLauncherDelegate::CreateNewTab() { | |
18 CreateNewWindow(); | |
sky
2012/04/11 15:47:49
Any point in having this since CreateNewWindow doe
| |
19 } | |
20 | |
21 void TestLauncherDelegate::CreateNewWindow() { | |
22 } | |
23 | |
24 void TestLauncherDelegate::ItemClicked(const ash::LauncherItem& item) { | |
25 //aura::Window* window = watcher_->GetWindowByID(item.id); | |
sky
2012/04/11 15:47:49
?
| |
26 //window->Show(); | |
27 //ash::wm::ActivateWindow(window); | |
28 } | |
29 | |
30 int TestLauncherDelegate::GetBrowserShortcutResourceId() { | |
31 return IDR_AURA_LAUNCHER_BROWSER_SHORTCUT; | |
32 } | |
33 | |
34 string16 TestLauncherDelegate::GetTitle(const ash::LauncherItem& item) { | |
35 return string16(ASCIIToUTF16("")); | |
sky
2012/04/11 15:47:49
return string16();
| |
36 } | |
37 | |
38 ui::MenuModel* TestLauncherDelegate::CreateContextMenu( | |
39 const ash::LauncherItem& item) { | |
40 return NULL; | |
41 } | |
42 | |
43 ui::MenuModel* TestLauncherDelegate::CreateContextMenuForLauncher() { | |
44 return NULL; | |
45 } | |
46 | |
47 ash::LauncherID TestLauncherDelegate::GetIDByWindow(aura::Window* window) { | |
48 WindowToID::const_iterator found = window_to_id_.find(window); | |
49 if (found == window_to_id_.end()) return 0; | |
sky
2012/04/11 15:47:49
avoid single line ifs.
| |
50 return found->second; | |
51 } | |
52 | |
53 void TestLauncherDelegate::AddLauncherItem(aura::Window* window) { | |
54 ash::LauncherItem item; | |
55 item.type = ash::TYPE_TABBED; | |
56 window_to_id_[window] = model_->next_id(); | |
57 item.image.setConfig(SkBitmap::kARGB_8888_Config, 16, 16); | |
58 item.image.allocPixels(); | |
59 model_->Add(item); | |
60 } | |
61 | |
62 | |
sky
2012/04/11 15:47:49
only one newline.
| |
63 | |
64 } // namespace test | |
65 } // namespace ash | |
OLD | NEW |