Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Side by Side Diff: apps/app_shim/extension_app_shim_handler_mac.cc

Issue 23514021: Add Hide to app menu. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Save original key equivalent. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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)
193 host->OnAppHide();
194 else
195 SetAppHidden(profile, shell_window->extension_id(), true);
196 }
197
186 // static 198 // static
187 bool ExtensionAppShimHandler::RequestUserAttentionForWindow( 199 bool ExtensionAppShimHandler::RequestUserAttentionForWindow(
188 ShellWindow* shell_window) { 200 ShellWindow* shell_window) {
189 ExtensionAppShimHandler* handler = 201 ExtensionAppShimHandler* handler =
190 g_browser_process->platform_part()->app_shim_host_manager()-> 202 g_browser_process->platform_part()->app_shim_host_manager()->
191 extension_app_shim_handler(); 203 extension_app_shim_handler();
192 Profile* profile = shell_window->profile(); 204 Profile* profile = shell_window->profile();
193 Host* host = handler->FindHost(profile, shell_window->extension_id()); 205 Host* host = handler->FindHost(profile, shell_window->extension_id());
194 if (host) { 206 if (host) {
195 // Bring the window to the front without showing it. 207 // Bring the window to the front without showing it.
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 if (!browser_opened_ever_ && hosts_.empty()) 421 if (!browser_opened_ever_ && hosts_.empty())
410 delegate_->MaybeTerminate(); 422 delegate_->MaybeTerminate();
411 } 423 }
412 424
413 void ExtensionAppShimHandler::OnAppStop(Profile* profile, 425 void ExtensionAppShimHandler::OnAppStop(Profile* profile,
414 const std::string& app_id) {} 426 const std::string& app_id) {}
415 427
416 void ExtensionAppShimHandler::OnChromeTerminating() {} 428 void ExtensionAppShimHandler::OnChromeTerminating() {}
417 429
418 } // namespace apps 430 } // namespace apps
OLDNEW
« no previous file with comments | « apps/app_shim/extension_app_shim_handler_mac.h ('k') | apps/app_shim/extension_app_shim_handler_mac_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698