Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "apps/app_shim/extension_app_shim_handler_mac.h" | 5 #include "apps/app_shim/extension_app_shim_handler_mac.h" |
| 6 | 6 |
| 7 #include "apps/app_lifetime_monitor_factory.h" | 7 #include "apps/app_lifetime_monitor_factory.h" |
| 8 #include "apps/app_shim/app_shim_host_manager_mac.h" | 8 #include "apps/app_shim/app_shim_host_manager_mac.h" |
| 9 #include "apps/app_shim/app_shim_messages.h" | 9 #include "apps/app_shim/app_shim_messages.h" |
| 10 #include "apps/native_app_window.h" | 10 #include "apps/native_app_window.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 176 shell_window->extension_id()); | 176 shell_window->extension_id()); |
| 177 if (host) { | 177 if (host) { |
| 178 handler->OnShimQuit(host); | 178 handler->OnShimQuit(host); |
| 179 } else { | 179 } else { |
| 180 // App shims might be disabled or the shim is still starting up. | 180 // App shims might be disabled or the shim is still starting up. |
| 181 ShellWindowRegistry::Get(shell_window->profile())-> | 181 ShellWindowRegistry::Get(shell_window->profile())-> |
| 182 CloseAllShellWindowsForApp(shell_window->extension_id()); | 182 CloseAllShellWindowsForApp(shell_window->extension_id()); |
| 183 } | 183 } |
| 184 } | 184 } |
| 185 | 185 |
| 186 void ExtensionAppShimHandler::HideAppForWindow(ShellWindow* shell_window) { | |
| 187 ExtensionAppShimHandler* handler = | |
| 188 g_browser_process->platform_part()->app_shim_host_manager()-> | |
| 189 extension_app_shim_handler(); | |
| 190 Profile* profile = shell_window->profile(); | |
| 191 Host* host = handler->FindHost(profile, shell_window->extension_id()); | |
| 192 if (host) { | |
|
tapted
2013/08/30 07:46:25
nit: no curlies
jackhou1
2013/09/03 01:20:49
Done.
| |
| 193 host->OnAppHide(); | |
| 194 } else { | |
| 195 SetAppHidden(profile, shell_window->extension_id(), true); | |
| 196 } | |
| 197 } | |
| 198 | |
| 186 // static | 199 // static |
| 187 bool ExtensionAppShimHandler::RequestUserAttentionForWindow( | 200 bool ExtensionAppShimHandler::RequestUserAttentionForWindow( |
| 188 ShellWindow* shell_window) { | 201 ShellWindow* shell_window) { |
| 189 ExtensionAppShimHandler* handler = | 202 ExtensionAppShimHandler* handler = |
| 190 g_browser_process->platform_part()->app_shim_host_manager()-> | 203 g_browser_process->platform_part()->app_shim_host_manager()-> |
| 191 extension_app_shim_handler(); | 204 extension_app_shim_handler(); |
| 192 Profile* profile = shell_window->profile(); | 205 Profile* profile = shell_window->profile(); |
| 193 Host* host = handler->FindHost(profile, shell_window->extension_id()); | 206 Host* host = handler->FindHost(profile, shell_window->extension_id()); |
| 194 if (host) { | 207 if (host) { |
| 195 // Bring the window to the front without showing it. | 208 // Bring the window to the front without showing it. |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 409 if (!browser_opened_ever_ && hosts_.empty()) | 422 if (!browser_opened_ever_ && hosts_.empty()) |
| 410 delegate_->MaybeTerminate(); | 423 delegate_->MaybeTerminate(); |
| 411 } | 424 } |
| 412 | 425 |
| 413 void ExtensionAppShimHandler::OnAppStop(Profile* profile, | 426 void ExtensionAppShimHandler::OnAppStop(Profile* profile, |
| 414 const std::string& app_id) {} | 427 const std::string& app_id) {} |
| 415 | 428 |
| 416 void ExtensionAppShimHandler::OnChromeTerminating() {} | 429 void ExtensionAppShimHandler::OnChromeTerminating() {} |
| 417 | 430 |
| 418 } // namespace apps | 431 } // namespace apps |
| OLD | NEW |