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

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

Issue 9649013: Show a different icon in the launcher for incognito windows (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Re-upload Created 8 years, 9 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
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 <map> 5 #include <map>
6 6
7 #include "ash/launcher/launcher.h" 7 #include "ash/launcher/launcher.h"
8 #include "ash/launcher/launcher_delegate.h" 8 #include "ash/launcher/launcher_delegate.h"
9 #include "ash/launcher/launcher_model.h" 9 #include "ash/launcher/launcher_model.h"
10 #include "ash/launcher/launcher_types.h" 10 #include "ash/launcher/launcher_types.h"
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 69
70 aura::Window* GetWindowByID(ash::LauncherID id) { 70 aura::Window* GetWindowByID(ash::LauncherID id) {
71 IDToWindow::const_iterator i = id_to_window_.find(id); 71 IDToWindow::const_iterator i = id_to_window_.find(id);
72 return i != id_to_window_.end() ? i->second : NULL; 72 return i != id_to_window_.end() ? i->second : NULL;
73 } 73 }
74 74
75 // aura::WindowObserver overrides: 75 // aura::WindowObserver overrides:
76 virtual void OnWindowAdded(aura::Window* new_window) OVERRIDE { 76 virtual void OnWindowAdded(aura::Window* new_window) OVERRIDE {
77 static int image_count = 0; 77 static int image_count = 0;
78 ash::LauncherModel* model = ash::Shell::GetInstance()->launcher()->model(); 78 ash::LauncherModel* model = ash::Shell::GetInstance()->launcher()->model();
79 ash::LauncherItem item(ash::TYPE_TABBED); 79 ash::LauncherItem item;
80 item.type = ash::TYPE_TABBED;
80 id_to_window_[model->next_id()] = new_window; 81 id_to_window_[model->next_id()] = new_window;
81 item.num_tabs = image_count + 1; 82 item.num_tabs = image_count + 1;
82 item.image.setConfig(SkBitmap::kARGB_8888_Config, 16, 16); 83 item.image.setConfig(SkBitmap::kARGB_8888_Config, 16, 16);
83 item.image.allocPixels(); 84 item.image.allocPixels();
84 item.image.eraseARGB(255, 85 item.image.eraseARGB(255,
85 image_count == 0 ? 255 : 0, 86 image_count == 0 ? 255 : 0,
86 image_count == 1 ? 255 : 0, 87 image_count == 1 ? 255 : 0,
87 image_count == 2 ? 255 : 0); 88 image_count == 2 ? 255 : 0);
88 image_count = (image_count + 1) % 3; 89 image_count = (image_count + 1) % 3;
89 model->Add(model->item_count(), item); 90 model->Add(model->item_count(), item);
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 window_watcher.reset(); 262 window_watcher.reset();
262 263
263 ash::Shell::DeleteInstance(); 264 ash::Shell::DeleteInstance();
264 265
265 aura::Env::DeleteInstance(); 266 aura::Env::DeleteInstance();
266 267
267 ui::CompositorTestSupport::Terminate(); 268 ui::CompositorTestSupport::Terminate();
268 269
269 return 0; 270 return 0;
270 } 271 }
OLDNEW
« no previous file with comments | « ash/launcher/tabbed_launcher_button.cc ('k') | chrome/browser/ui/views/ash/launcher/chrome_launcher_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698