| 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 "chrome/browser/ui/ash/launcher/shell_window_launcher_controller.h" | 5 #include "chrome/browser/ui/ash/launcher/shell_window_launcher_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/wm/window_util.h" | 10 #include "ash/wm/window_util.h" |
| 11 #include "base/stl_util.h" | 11 #include "base/stl_util.h" |
| 12 #include "base/utf_string_conversions.h" | 12 #include "base/utf_string_conversions.h" |
| 13 #include "chrome/browser/extensions/extension_service.h" | 13 #include "chrome/browser/extensions/extension_service.h" |
| 14 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 14 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
| 15 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" | 15 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" |
| 16 #include "chrome/browser/ui/extensions/native_shell_window.h" |
| 16 #include "chrome/browser/ui/extensions/shell_window.h" | 17 #include "chrome/browser/ui/extensions/shell_window.h" |
| 17 #include "chrome/common/extensions/extension.h" | 18 #include "chrome/common/extensions/extension.h" |
| 18 #include "ui/aura/client/activation_client.h" | 19 #include "ui/aura/client/activation_client.h" |
| 19 | 20 |
| 20 namespace { | 21 namespace { |
| 21 | 22 |
| 22 // Currently apps have a single launcher item, so the launcher id is the | 23 // Currently apps have a single launcher item, so the launcher id is the |
| 23 // same as the app id. In the future, this may not be true (e.g. for panels). | 24 // same as the app id. In the future, this may not be true (e.g. for panels). |
| 24 std::string GetAppLauncherId(ShellWindow* shell_window) { | 25 std::string GetAppLauncherId(ShellWindow* shell_window) { |
| 25 return shell_window->extension()->id(); | 26 return shell_window->extension()->id(); |
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 WindowToAppLauncherIdMap::iterator iter1 = | 305 WindowToAppLauncherIdMap::iterator iter1 = |
| 305 window_to_app_launcher_id_map_.find(window); | 306 window_to_app_launcher_id_map_.find(window); |
| 306 if (iter1 == window_to_app_launcher_id_map_.end()) | 307 if (iter1 == window_to_app_launcher_id_map_.end()) |
| 307 return NULL; | 308 return NULL; |
| 308 std::string app_launcher_id = iter1->second; | 309 std::string app_launcher_id = iter1->second; |
| 309 AppControllerMap::iterator iter2 = app_controller_map_.find(app_launcher_id); | 310 AppControllerMap::iterator iter2 = app_controller_map_.find(app_launcher_id); |
| 310 if (iter2 == app_controller_map_.end()) | 311 if (iter2 == app_controller_map_.end()) |
| 311 return NULL; | 312 return NULL; |
| 312 return iter2->second; | 313 return iter2->second; |
| 313 } | 314 } |
| OLD | NEW |