| OLD | NEW | 
|    1 // Copyright 2016 The Chromium Authors. All rights reserved. |    1 // Copyright 2016 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/extension_app_window_launcher_controlle
     r.h" |    5 #include "chrome/browser/ui/ash/launcher/extension_app_window_launcher_controlle
     r.h" | 
|    6  |    6  | 
|    7 #include "ash/aura/wm_window_aura.h" |  | 
|    8 #include "ash/common/shelf/shelf_delegate.h" |    7 #include "ash/common/shelf/shelf_delegate.h" | 
|    9 #include "ash/common/wm_shell.h" |    8 #include "ash/common/wm_shell.h" | 
 |    9 #include "ash/common/wm_window.h" | 
|   10 #include "ash/common/wm_window_property.h" |   10 #include "ash/common/wm_window_property.h" | 
|   11 #include "ash/wm/window_util.h" |   11 #include "ash/wm/window_util.h" | 
|   12 #include "base/stl_util.h" |   12 #include "base/stl_util.h" | 
|   13 #include "base/strings/stringprintf.h" |   13 #include "base/strings/stringprintf.h" | 
|   14 #include "chrome/browser/profiles/profile.h" |   14 #include "chrome/browser/profiles/profile.h" | 
|   15 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |   15 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 
|   16 #include "chrome/browser/ui/ash/launcher/extension_app_window_launcher_item_cont
     roller.h" |   16 #include "chrome/browser/ui/ash/launcher/extension_app_window_launcher_item_cont
     roller.h" | 
|   17 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" |   17 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" | 
|   18 #include "extensions/browser/app_window/app_window.h" |   18 #include "extensions/browser/app_window/app_window.h" | 
|   19 #include "extensions/browser/app_window/native_app_window.h" |   19 #include "extensions/browser/app_window/native_app_window.h" | 
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  185         controller->set_image_set_by_controller(true); |  185         controller->set_image_set_by_controller(true); | 
|  186       } |  186       } | 
|  187     } else { |  187     } else { | 
|  188       owner()->SetItemController(shelf_id, controller); |  188       owner()->SetItemController(shelf_id, controller); | 
|  189     } |  189     } | 
|  190  |  190  | 
|  191     // We need to change the controller associated with app_shelf_id. |  191     // We need to change the controller associated with app_shelf_id. | 
|  192     app_controller_map_[app_shelf_id] = controller; |  192     app_controller_map_[app_shelf_id] = controller; | 
|  193   } |  193   } | 
|  194   owner()->SetItemStatus(shelf_id, status); |  194   owner()->SetItemStatus(shelf_id, status); | 
|  195   ash::WmWindowAura::Get(window)->SetIntProperty( |  195   ash::WmWindow::Get(window)->SetIntProperty(ash::WmWindowProperty::SHELF_ID, | 
|  196       ash::WmWindowProperty::SHELF_ID, shelf_id); |  196                                              shelf_id); | 
|  197 } |  197 } | 
|  198  |  198  | 
|  199 void ExtensionAppWindowLauncherController::UnregisterApp(aura::Window* window) { |  199 void ExtensionAppWindowLauncherController::UnregisterApp(aura::Window* window) { | 
|  200   WindowToAppShelfIdMap::iterator window_iter = |  200   WindowToAppShelfIdMap::iterator window_iter = | 
|  201       window_to_app_shelf_id_map_.find(window); |  201       window_to_app_shelf_id_map_.find(window); | 
|  202   DCHECK(window_iter != window_to_app_shelf_id_map_.end()); |  202   DCHECK(window_iter != window_to_app_shelf_id_map_.end()); | 
|  203   std::string app_shelf_id = window_iter->second; |  203   std::string app_shelf_id = window_iter->second; | 
|  204   window_to_app_shelf_id_map_.erase(window_iter); |  204   window_to_app_shelf_id_map_.erase(window_iter); | 
|  205   window->RemoveObserver(this); |  205   window->RemoveObserver(this); | 
|  206  |  206  | 
| (...skipping 27 matching lines...) Expand all  Loading... | 
|  234   WindowToAppShelfIdMap::iterator window_iter = |  234   WindowToAppShelfIdMap::iterator window_iter = | 
|  235       window_to_app_shelf_id_map_.find(window); |  235       window_to_app_shelf_id_map_.find(window); | 
|  236   if (window_iter == window_to_app_shelf_id_map_.end()) |  236   if (window_iter == window_to_app_shelf_id_map_.end()) | 
|  237     return nullptr; |  237     return nullptr; | 
|  238   AppControllerMap::iterator app_controller_iter = |  238   AppControllerMap::iterator app_controller_iter = | 
|  239       app_controller_map_.find(window_iter->second); |  239       app_controller_map_.find(window_iter->second); | 
|  240   if (app_controller_iter == app_controller_map_.end()) |  240   if (app_controller_iter == app_controller_map_.end()) | 
|  241     return nullptr; |  241     return nullptr; | 
|  242   return app_controller_iter->second; |  242   return app_controller_iter->second; | 
|  243 } |  243 } | 
| OLD | NEW |