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

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

Issue 11301007: Load the resources for max scale factor first. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 | « no previous file | chrome/browser/ui/views/tabs/tab.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/launcher/launcher.h" 7 #include "ash/launcher/launcher.h"
8 #include "ash/launcher/launcher_model.h" 8 #include "ash/launcher/launcher_model.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 84
85 SkBitmap icon_bitmap; 85 SkBitmap icon_bitmap;
86 icon_bitmap.setConfig(SkBitmap::kARGB_8888_Config, 16, 16); 86 icon_bitmap.setConfig(SkBitmap::kARGB_8888_Config, 16, 16);
87 icon_bitmap.allocPixels(); 87 icon_bitmap.allocPixels();
88 icon_bitmap.eraseARGB(255, 88 icon_bitmap.eraseARGB(255,
89 image_count == 0 ? 255 : 0, 89 image_count == 0 ? 255 : 0,
90 image_count == 1 ? 255 : 0, 90 image_count == 1 ? 255 : 0,
91 image_count == 2 ? 255 : 0); 91 image_count == 2 ? 255 : 0);
92 image_count = (image_count + 1) % 3; 92 image_count = (image_count + 1) % 3;
93 item.image = gfx::ImageSkia(gfx::ImageSkiaRep(icon_bitmap, 93 item.image = gfx::ImageSkia(gfx::ImageSkiaRep(icon_bitmap,
94 ui::SCALE_FACTOR_NONE)); 94 ui::SCALE_FACTOR_100P));
95 95
96 model->Add(item); 96 model->Add(item);
97 } 97 }
98 98
99 void WindowWatcher::OnWillRemoveWindow(aura::Window* window) { 99 void WindowWatcher::OnWillRemoveWindow(aura::Window* window) {
100 for (IDToWindow::iterator i = id_to_window_.begin(); 100 for (IDToWindow::iterator i = id_to_window_.begin();
101 i != id_to_window_.end(); ++i) { 101 i != id_to_window_.end(); ++i) {
102 if (i->second == window) { 102 if (i->second == window) {
103 ash::LauncherModel* model = Launcher::ForPrimaryDisplay()->model(); 103 ash::LauncherModel* model = Launcher::ForPrimaryDisplay()->model();
104 int index = model->ItemIndexByID(i->first); 104 int index = model->ItemIndexByID(i->first);
105 DCHECK_NE(-1, index); 105 DCHECK_NE(-1, index);
106 model->RemoveItemAt(index); 106 model->RemoveItemAt(index);
107 id_to_window_.erase(i); 107 id_to_window_.erase(i);
108 break; 108 break;
109 } 109 }
110 } 110 }
111 } 111 }
112 112
113 } // namespace shell 113 } // namespace shell
114 } // namespace ash 114 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/tabs/tab.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698