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/display/display_controller.h" | 7 #include "ash/display/display_controller.h" |
8 #include "ash/shelf/shelf.h" | 8 #include "ash/shelf/shelf.h" |
9 #include "ash/shelf/shelf_item_delegate_manager.h" | 9 #include "ash/shelf/shelf_item_delegate_manager.h" |
10 #include "ash/shelf/shelf_model.h" | 10 #include "ash/shelf/shelf_model.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 static int image_count = 0; | 98 static int image_count = 0; |
99 ShelfModel* model = Shell::GetInstance()->shelf_model(); | 99 ShelfModel* model = Shell::GetInstance()->shelf_model(); |
100 ShelfItem item; | 100 ShelfItem item; |
101 item.type = new_window->type() == ui::wm::WINDOW_TYPE_PANEL | 101 item.type = new_window->type() == ui::wm::WINDOW_TYPE_PANEL |
102 ? ash::TYPE_APP_PANEL | 102 ? ash::TYPE_APP_PANEL |
103 : ash::TYPE_PLATFORM_APP; | 103 : ash::TYPE_PLATFORM_APP; |
104 ash::ShelfID id = model->next_id(); | 104 ash::ShelfID id = model->next_id(); |
105 id_to_window_[id] = new_window; | 105 id_to_window_[id] = new_window; |
106 | 106 |
107 SkBitmap icon_bitmap; | 107 SkBitmap icon_bitmap; |
108 icon_bitmap.setConfig(SkBitmap::kARGB_8888_Config, 16, 16); | 108 icon_bitmap.allocN32Pixels(16, 16); |
109 icon_bitmap.allocPixels(); | |
110 icon_bitmap.eraseARGB(255, | 109 icon_bitmap.eraseARGB(255, |
111 image_count == 0 ? 255 : 0, | 110 image_count == 0 ? 255 : 0, |
112 image_count == 1 ? 255 : 0, | 111 image_count == 1 ? 255 : 0, |
113 image_count == 2 ? 255 : 0); | 112 image_count == 2 ? 255 : 0); |
114 image_count = (image_count + 1) % 3; | 113 image_count = (image_count + 1) % 3; |
115 item.image = gfx::ImageSkia(gfx::ImageSkiaRep(icon_bitmap, 1.0f)); | 114 item.image = gfx::ImageSkia(gfx::ImageSkiaRep(icon_bitmap, 1.0f)); |
116 | 115 |
117 model->Add(item); | 116 model->Add(item); |
118 | 117 |
119 ShelfItemDelegateManager* manager = | 118 ShelfItemDelegateManager* manager = |
(...skipping 27 matching lines...) Expand all Loading... |
147 void WindowWatcher::OnDisplayRemoved(const gfx::Display& old_display) { | 146 void WindowWatcher::OnDisplayRemoved(const gfx::Display& old_display) { |
148 // All windows in the display has already been removed, so no need to | 147 // All windows in the display has already been removed, so no need to |
149 // remove observers. | 148 // remove observers. |
150 } | 149 } |
151 | 150 |
152 void WindowWatcher::OnDisplayMetricsChanged(const gfx::Display&, uint32_t) { | 151 void WindowWatcher::OnDisplayMetricsChanged(const gfx::Display&, uint32_t) { |
153 } | 152 } |
154 | 153 |
155 } // namespace shell | 154 } // namespace shell |
156 } // namespace ash | 155 } // namespace ash |
OLD | NEW |