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/wm/window_util.h" | 8 #include "ash/wm/window_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "grit/ui_resources.h" | 10 #include "grit/ui_resources.h" |
(...skipping 18 matching lines...) Expand all Loading... |
29 AddLauncherItem(window, STATUS_CLOSED); | 29 AddLauncherItem(window, STATUS_CLOSED); |
30 } | 30 } |
31 | 31 |
32 void TestLauncherDelegate::AddLauncherItem( | 32 void TestLauncherDelegate::AddLauncherItem( |
33 aura::Window* window, | 33 aura::Window* window, |
34 LauncherItemStatus status) { | 34 LauncherItemStatus status) { |
35 ash::LauncherItem item; | 35 ash::LauncherItem item; |
36 item.type = ash::TYPE_TABBED; | 36 item.type = ash::TYPE_TABBED; |
37 DCHECK(window_to_id_.find(window) == window_to_id_.end()); | 37 DCHECK(window_to_id_.find(window) == window_to_id_.end()); |
38 window_to_id_[window] = model_->next_id(); | 38 window_to_id_[window] = model_->next_id(); |
39 item.image.setConfig(SkBitmap::kARGB_8888_Config, 16, 16); | |
40 item.image.allocPixels(); | |
41 item.status = status; | 39 item.status = status; |
42 model_->Add(item); | 40 model_->Add(item); |
43 if (observed_windows_.find(window->parent()) == observed_windows_.end()) { | 41 if (observed_windows_.find(window->parent()) == observed_windows_.end()) { |
44 window->parent()->AddObserver(this); | 42 window->parent()->AddObserver(this); |
45 observed_windows_.insert(window->parent()); | 43 observed_windows_.insert(window->parent()); |
46 } | 44 } |
47 } | 45 } |
48 | 46 |
49 void TestLauncherDelegate::OnWillRemoveWindow(aura::Window* window) { | 47 void TestLauncherDelegate::OnWillRemoveWindow(aura::Window* window) { |
50 ash::LauncherID id = GetIDByWindow(window); | 48 ash::LauncherID id = GetIDByWindow(window); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 } | 105 } |
108 return NULL; | 106 return NULL; |
109 } | 107 } |
110 | 108 |
111 bool TestLauncherDelegate::IsDraggable(const ash::LauncherItem& item) { | 109 bool TestLauncherDelegate::IsDraggable(const ash::LauncherItem& item) { |
112 return true; | 110 return true; |
113 } | 111 } |
114 | 112 |
115 } // namespace test | 113 } // namespace test |
116 } // namespace ash | 114 } // namespace ash |
OLD | NEW |