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/string_number_conversions.h" | 12 #include "base/string_number_conversions.h" |
13 #include "base/stringprintf.h" | 13 #include "base/stringprintf.h" |
14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
15 #include "chrome/browser/extensions/extension_service.h" | 15 #include "chrome/browser/extensions/extension_service.h" |
16 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 16 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
17 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" | 17 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h" |
| 18 #include "chrome/browser/ui/extensions/native_app_window.h" |
18 #include "chrome/browser/ui/extensions/shell_window.h" | 19 #include "chrome/browser/ui/extensions/shell_window.h" |
19 #include "chrome/common/extensions/extension.h" | 20 #include "chrome/common/extensions/extension.h" |
20 #include "ui/aura/client/activation_client.h" | 21 #include "ui/aura/client/activation_client.h" |
21 | 22 |
22 namespace { | 23 namespace { |
23 | 24 |
24 std::string GetAppLauncherId(ShellWindow* shell_window) { | 25 std::string GetAppLauncherId(ShellWindow* shell_window) { |
25 if (shell_window->window_type() == ShellWindow::WINDOW_TYPE_PANEL) | 26 if (shell_window->window_type() == ShellWindow::WINDOW_TYPE_PANEL) |
26 return StringPrintf("panel:%d", shell_window->session_id().id()); | 27 return StringPrintf("panel:%d", shell_window->session_id().id()); |
27 return shell_window->extension()->id(); | 28 return shell_window->extension()->id(); |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 WindowToAppLauncherIdMap::iterator iter1 = | 306 WindowToAppLauncherIdMap::iterator iter1 = |
306 window_to_app_launcher_id_map_.find(window); | 307 window_to_app_launcher_id_map_.find(window); |
307 if (iter1 == window_to_app_launcher_id_map_.end()) | 308 if (iter1 == window_to_app_launcher_id_map_.end()) |
308 return NULL; | 309 return NULL; |
309 std::string app_launcher_id = iter1->second; | 310 std::string app_launcher_id = iter1->second; |
310 AppControllerMap::iterator iter2 = app_controller_map_.find(app_launcher_id); | 311 AppControllerMap::iterator iter2 = app_controller_map_.find(app_launcher_id); |
311 if (iter2 == app_controller_map_.end()) | 312 if (iter2 == app_controller_map_.end()) |
312 return NULL; | 313 return NULL; |
313 return iter2->second; | 314 return iter2->second; |
314 } | 315 } |
OLD | NEW |