Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: ash/test/test_launcher_delegate.cc

Issue 9808026: Layout panels on top of their launcher icons (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pre-patch with tests Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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"
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) {
15 }
16
17 void TestLauncherDelegate::CreateNewTab() {
18 CreateNewWindow();
19 }
20
21 void TestLauncherDelegate::CreateNewWindow() {
22 }
23
24 void TestLauncherDelegate::ItemClicked(const ash::LauncherItem& item) {
25 //aura::Window* window = watcher_->GetWindowByID(item.id);
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(""));
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;
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
63
64 } // namespace test
65 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698