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

Side by Side Diff: ash/shell/window_watcher.cc

Issue 24175004: Remove dependency on ui::ScaleFactor from ui/gfx (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix new usage of scale in FastShowPickler Created 7 years, 3 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
« no previous file with comments | « ash/shell/app_list.cc ('k') | ash/system/chromeos/network/network_icon.cc » ('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/shell/window_watcher.h" 5 #include "ash/shell/window_watcher.h"
6 6
7 #include "ash/display/display_controller.h" 7 #include "ash/display/display_controller.h"
8 #include "ash/launcher/launcher.h" 8 #include "ash/launcher/launcher.h"
9 #include "ash/launcher/launcher_model.h" 9 #include "ash/launcher/launcher_model.h"
10 #include "ash/shelf/shelf_widget.h" 10 #include "ash/shelf/shelf_widget.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 id_to_window_[model->next_id()] = new_window; 111 id_to_window_[model->next_id()] = new_window;
112 112
113 SkBitmap icon_bitmap; 113 SkBitmap icon_bitmap;
114 icon_bitmap.setConfig(SkBitmap::kARGB_8888_Config, 16, 16); 114 icon_bitmap.setConfig(SkBitmap::kARGB_8888_Config, 16, 16);
115 icon_bitmap.allocPixels(); 115 icon_bitmap.allocPixels();
116 icon_bitmap.eraseARGB(255, 116 icon_bitmap.eraseARGB(255,
117 image_count == 0 ? 255 : 0, 117 image_count == 0 ? 255 : 0,
118 image_count == 1 ? 255 : 0, 118 image_count == 1 ? 255 : 0,
119 image_count == 2 ? 255 : 0); 119 image_count == 2 ? 255 : 0);
120 image_count = (image_count + 1) % 3; 120 image_count = (image_count + 1) % 3;
121 item.image = gfx::ImageSkia(gfx::ImageSkiaRep(icon_bitmap, 121 item.image = gfx::ImageSkia(gfx::ImageSkiaRep(icon_bitmap, 1.0f));
122 ui::SCALE_FACTOR_100P));
123 122
124 model->Add(item); 123 model->Add(item);
125 } 124 }
126 125
127 void WindowWatcher::OnWillRemoveWindow(aura::Window* window) { 126 void WindowWatcher::OnWillRemoveWindow(aura::Window* window) {
128 for (IDToWindow::iterator i = id_to_window_.begin(); 127 for (IDToWindow::iterator i = id_to_window_.begin();
129 i != id_to_window_.end(); ++i) { 128 i != id_to_window_.end(); ++i) {
130 if (i->second == window) { 129 if (i->second == window) {
131 ash::LauncherModel* model = Shell::GetInstance()->launcher_model(); 130 ash::LauncherModel* model = Shell::GetInstance()->launcher_model();
132 int index = model->ItemIndexByID(i->first); 131 int index = model->ItemIndexByID(i->first);
(...skipping 14 matching lines...) Expand all
147 workspace_window_watcher_->RootWindowAdded(root); 146 workspace_window_watcher_->RootWindowAdded(root);
148 } 147 }
149 148
150 void WindowWatcher::OnDisplayRemoved(const gfx::Display& old_display) { 149 void WindowWatcher::OnDisplayRemoved(const gfx::Display& old_display) {
151 // All windows in the display has already been removed, so no need to 150 // All windows in the display has already been removed, so no need to
152 // remove observers. 151 // remove observers.
153 } 152 }
154 153
155 } // namespace shell 154 } // namespace shell
156 } // namespace ash 155 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell/app_list.cc ('k') | ash/system/chromeos/network/network_icon.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698