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

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

Issue 11299272: Revert 170406 - Align panel icons on the right / end. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years 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/launcher/launcher_view_unittest.cc ('k') | no next file » | 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 72
73 // aura::WindowObserver overrides: 73 // aura::WindowObserver overrides:
74 void WindowWatcher::OnWindowAdded(aura::Window* new_window) { 74 void WindowWatcher::OnWindowAdded(aura::Window* new_window) {
75 if (new_window->type() != aura::client::WINDOW_TYPE_NORMAL && 75 if (new_window->type() != aura::client::WINDOW_TYPE_NORMAL &&
76 new_window->type() != aura::client::WINDOW_TYPE_PANEL) 76 new_window->type() != aura::client::WINDOW_TYPE_PANEL)
77 return; 77 return;
78 78
79 static int image_count = 0; 79 static int image_count = 0;
80 ash::LauncherModel* model = Launcher::ForPrimaryDisplay()->model(); 80 ash::LauncherModel* model = Launcher::ForPrimaryDisplay()->model();
81 ash::LauncherItem item; 81 ash::LauncherItem item;
82 item.type = new_window->type() == aura::client::WINDOW_TYPE_PANEL ? 82 item.type = ash::TYPE_TABBED;
83 ash::TYPE_APP_PANEL : ash::TYPE_TABBED;
84 id_to_window_[model->next_id()] = new_window; 83 id_to_window_[model->next_id()] = new_window;
85 84
86 SkBitmap icon_bitmap; 85 SkBitmap icon_bitmap;
87 icon_bitmap.setConfig(SkBitmap::kARGB_8888_Config, 16, 16); 86 icon_bitmap.setConfig(SkBitmap::kARGB_8888_Config, 16, 16);
88 icon_bitmap.allocPixels(); 87 icon_bitmap.allocPixels();
89 icon_bitmap.eraseARGB(255, 88 icon_bitmap.eraseARGB(255,
90 image_count == 0 ? 255 : 0, 89 image_count == 0 ? 255 : 0,
91 image_count == 1 ? 255 : 0, 90 image_count == 1 ? 255 : 0,
92 image_count == 2 ? 255 : 0); 91 image_count == 2 ? 255 : 0);
93 image_count = (image_count + 1) % 3; 92 image_count = (image_count + 1) % 3;
(...skipping 12 matching lines...) Expand all
106 DCHECK_NE(-1, index); 105 DCHECK_NE(-1, index);
107 model->RemoveItemAt(index); 106 model->RemoveItemAt(index);
108 id_to_window_.erase(i); 107 id_to_window_.erase(i);
109 break; 108 break;
110 } 109 }
111 } 110 }
112 } 111 }
113 112
114 } // namespace shell 113 } // namespace shell
115 } // namespace ash 114 } // namespace ash
OLDNEW
« no previous file with comments | « ash/launcher/launcher_view_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698