OLD | NEW |
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 Loading... |
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 = ash::TYPE_TABBED; | 82 item.type = new_window->type() == aura::client::WINDOW_TYPE_PANEL ? |
| 83 ash::TYPE_APP_PANEL : ash::TYPE_TABBED; |
83 id_to_window_[model->next_id()] = new_window; | 84 id_to_window_[model->next_id()] = new_window; |
84 | 85 |
85 SkBitmap icon_bitmap; | 86 SkBitmap icon_bitmap; |
86 icon_bitmap.setConfig(SkBitmap::kARGB_8888_Config, 16, 16); | 87 icon_bitmap.setConfig(SkBitmap::kARGB_8888_Config, 16, 16); |
87 icon_bitmap.allocPixels(); | 88 icon_bitmap.allocPixels(); |
88 icon_bitmap.eraseARGB(255, | 89 icon_bitmap.eraseARGB(255, |
89 image_count == 0 ? 255 : 0, | 90 image_count == 0 ? 255 : 0, |
90 image_count == 1 ? 255 : 0, | 91 image_count == 1 ? 255 : 0, |
91 image_count == 2 ? 255 : 0); | 92 image_count == 2 ? 255 : 0); |
92 image_count = (image_count + 1) % 3; | 93 image_count = (image_count + 1) % 3; |
(...skipping 12 matching lines...) Expand all Loading... |
105 DCHECK_NE(-1, index); | 106 DCHECK_NE(-1, index); |
106 model->RemoveItemAt(index); | 107 model->RemoveItemAt(index); |
107 id_to_window_.erase(i); | 108 id_to_window_.erase(i); |
108 break; | 109 break; |
109 } | 110 } |
110 } | 111 } |
111 } | 112 } |
112 | 113 |
113 } // namespace shell | 114 } // namespace shell |
114 } // namespace ash | 115 } // namespace ash |
OLD | NEW |