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

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

Issue 10383108: Adding four bezel gestures (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fixing build breakage Created 8 years, 7 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
« no previous file with comments | « ash/test/test_launcher_delegate.h ('k') | ash/volume_control_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "ui/aura/window.h" 11 #include "ui/aura/window.h"
12 12
13 namespace ash { 13 namespace ash {
14 namespace test { 14 namespace test {
15 15
16 TestLauncherDelegate* TestLauncherDelegate::instance_ = NULL; 16 TestLauncherDelegate* TestLauncherDelegate::instance_ = NULL;
17 17
18 TestLauncherDelegate::TestLauncherDelegate(LauncherModel* model) 18 TestLauncherDelegate::TestLauncherDelegate(LauncherModel* model)
19 : model_(model) { 19 : model_(model) {
20 CHECK(!instance_); 20 CHECK(!instance_);
21 instance_ = this; 21 instance_ = this;
22 } 22 }
23 23
24 TestLauncherDelegate::~TestLauncherDelegate() { 24 TestLauncherDelegate::~TestLauncherDelegate() {
25 instance_ = NULL; 25 instance_ = NULL;
26 } 26 }
27 27
28 void TestLauncherDelegate::AddLauncherItem(aura::Window* window) { 28 void TestLauncherDelegate::AddLauncherItem(aura::Window* window) {
29 AddLauncherItem(window, STATUS_CLOSED);
30 }
31
32 void TestLauncherDelegate::AddLauncherItem(
33 aura::Window* window,
34 LauncherItemStatus status) {
29 ash::LauncherItem item; 35 ash::LauncherItem item;
30 item.type = ash::TYPE_TABBED; 36 item.type = ash::TYPE_TABBED;
31 DCHECK(window_to_id_.find(window) == window_to_id_.end()); 37 DCHECK(window_to_id_.find(window) == window_to_id_.end());
32 window_to_id_[window] = model_->next_id(); 38 window_to_id_[window] = model_->next_id();
33 item.image.setConfig(SkBitmap::kARGB_8888_Config, 16, 16); 39 item.image.setConfig(SkBitmap::kARGB_8888_Config, 16, 16);
34 item.image.allocPixels(); 40 item.image.allocPixels();
41 item.status = status;
35 model_->Add(item); 42 model_->Add(item);
36 if (observed_windows_.find(window->parent()) == observed_windows_.end()) { 43 if (observed_windows_.find(window->parent()) == observed_windows_.end()) {
37 window->parent()->AddObserver(this); 44 window->parent()->AddObserver(this);
38 observed_windows_.insert(window->parent()); 45 observed_windows_.insert(window->parent());
39 } 46 }
40 } 47 }
41 48
42 void TestLauncherDelegate::OnWillRemoveWindow(aura::Window* window) { 49 void TestLauncherDelegate::OnWillRemoveWindow(aura::Window* window) {
43 ash::LauncherID id = GetIDByWindow(window); 50 ash::LauncherID id = GetIDByWindow(window);
44 if (id == 0) 51 if (id == 0)
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 } 107 }
101 return NULL; 108 return NULL;
102 } 109 }
103 110
104 bool TestLauncherDelegate::IsDraggable(const ash::LauncherItem& item) { 111 bool TestLauncherDelegate::IsDraggable(const ash::LauncherItem& item) {
105 return true; 112 return true;
106 } 113 }
107 114
108 } // namespace test 115 } // namespace test
109 } // namespace ash 116 } // namespace ash
OLDNEW
« no previous file with comments | « ash/test/test_launcher_delegate.h ('k') | ash/volume_control_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698