| 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 "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/wm/window_util.h" | 8 #include "ash/wm/window_util.h" |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
| 11 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" | 11 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" |
| 12 #include "chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.h
" | 12 #include "chrome/browser/ui/ash/launcher/shell_window_launcher_item_controller.h
" |
| 13 #include "chrome/browser/ui/extensions/shell_window.h" | 13 #include "chrome/browser/ui/extensions/shell_window.h" |
| 14 #include "ui/aura/client/activation_client.h" | 14 #include "ui/aura/client/activation_client.h" |
| 15 | 15 |
| 16 namespace { | 16 namespace { |
| 17 | 17 |
| 18 std::string GetAppLauncherId(ShellWindow* shell_window) { | 18 std::string GetAppLauncherId(ShellWindow* shell_window) { |
| 19 if (shell_window->window_type_is_panel()) | 19 if (shell_window->window_type_is_panel()) |
| 20 return StringPrintf("panel:%d", shell_window->session_id().id()); | 20 return base::StringPrintf("panel:%d", shell_window->session_id().id()); |
| 21 return shell_window->extension()->id(); | 21 return shell_window->extension()->id(); |
| 22 } | 22 } |
| 23 | 23 |
| 24 } // namespace | 24 } // namespace |
| 25 | 25 |
| 26 ShellWindowLauncherController::ShellWindowLauncherController( | 26 ShellWindowLauncherController::ShellWindowLauncherController( |
| 27 ChromeLauncherController* owner) | 27 ChromeLauncherController* owner) |
| 28 : owner_(owner), | 28 : owner_(owner), |
| 29 registry_(extensions::ShellWindowRegistry::Get(owner->profile())), | 29 registry_(extensions::ShellWindowRegistry::Get(owner->profile())), |
| 30 activation_client_(NULL) { | 30 activation_client_(NULL) { |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 WindowToAppLauncherIdMap::iterator iter1 = | 165 WindowToAppLauncherIdMap::iterator iter1 = |
| 166 window_to_app_launcher_id_map_.find(window); | 166 window_to_app_launcher_id_map_.find(window); |
| 167 if (iter1 == window_to_app_launcher_id_map_.end()) | 167 if (iter1 == window_to_app_launcher_id_map_.end()) |
| 168 return NULL; | 168 return NULL; |
| 169 std::string app_launcher_id = iter1->second; | 169 std::string app_launcher_id = iter1->second; |
| 170 AppControllerMap::iterator iter2 = app_controller_map_.find(app_launcher_id); | 170 AppControllerMap::iterator iter2 = app_controller_map_.find(app_launcher_id); |
| 171 if (iter2 == app_controller_map_.end()) | 171 if (iter2 == app_controller_map_.end()) |
| 172 return NULL; | 172 return NULL; |
| 173 return iter2->second; | 173 return iter2->second; |
| 174 } | 174 } |
| OLD | NEW |