OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/ui/ash/launcher/app_window_launcher_controller.h" | 5 #include "chrome/browser/ui/ash/launcher/app_window_launcher_controller.h" |
6 | 6 |
7 #include "ash/shelf/shelf_util.h" | 7 #include "ash/shelf/shelf_util.h" |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "ash/wm/window_util.h" | 9 #include "ash/wm/window_util.h" |
10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 } | 138 } |
139 | 139 |
140 // Mark the old active window's launcher item as running (if different). | 140 // Mark the old active window's launcher item as running (if different). |
141 AppWindowLauncherItemController* old_controller = | 141 AppWindowLauncherItemController* old_controller = |
142 ControllerForWindow(old_active); | 142 ControllerForWindow(old_active); |
143 if (old_controller && old_controller != new_controller) | 143 if (old_controller && old_controller != new_controller) |
144 owner_->SetItemStatus(old_controller->shelf_id(), ash::STATUS_RUNNING); | 144 owner_->SetItemStatus(old_controller->shelf_id(), ash::STATUS_RUNNING); |
145 } | 145 } |
146 | 146 |
147 void AppWindowLauncherController::RegisterApp(AppWindow* app_window) { | 147 void AppWindowLauncherController::RegisterApp(AppWindow* app_window) { |
| 148 // Windows created by IME extension should be treated the same way as the |
| 149 // virtual keyboard window, which does not register itself in launcher. |
| 150 if (app_window->is_ime_window()) |
| 151 return; |
| 152 |
148 aura::Window* window = app_window->GetNativeWindow(); | 153 aura::Window* window = app_window->GetNativeWindow(); |
149 // Get the app's shelf identifier and add an entry to the map. | 154 // Get the app's shelf identifier and add an entry to the map. |
150 DCHECK(window_to_app_shelf_id_map_.find(window) == | 155 DCHECK(window_to_app_shelf_id_map_.find(window) == |
151 window_to_app_shelf_id_map_.end()); | 156 window_to_app_shelf_id_map_.end()); |
152 const std::string app_shelf_id = GetAppShelfId(app_window); | 157 const std::string app_shelf_id = GetAppShelfId(app_window); |
153 window_to_app_shelf_id_map_[window] = app_shelf_id; | 158 window_to_app_shelf_id_map_[window] = app_shelf_id; |
154 window->AddObserver(this); | 159 window->AddObserver(this); |
155 | 160 |
156 // Find or create an item controller and launcher item. | 161 // Find or create an item controller and launcher item. |
157 std::string app_id = app_window->extension_id(); | 162 std::string app_id = app_window->extension_id(); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 WindowToAppShelfIdMap::iterator iter1 = | 233 WindowToAppShelfIdMap::iterator iter1 = |
229 window_to_app_shelf_id_map_.find(window); | 234 window_to_app_shelf_id_map_.find(window); |
230 if (iter1 == window_to_app_shelf_id_map_.end()) | 235 if (iter1 == window_to_app_shelf_id_map_.end()) |
231 return NULL; | 236 return NULL; |
232 std::string app_shelf_id = iter1->second; | 237 std::string app_shelf_id = iter1->second; |
233 AppControllerMap::iterator iter2 = app_controller_map_.find(app_shelf_id); | 238 AppControllerMap::iterator iter2 = app_controller_map_.find(app_shelf_id); |
234 if (iter2 == app_controller_map_.end()) | 239 if (iter2 == app_controller_map_.end()) |
235 return NULL; | 240 return NULL; |
236 return iter2->second; | 241 return iter2->second; |
237 } | 242 } |
OLD | NEW |