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

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

Issue 23737003: Mac: Fix window raising for multiple desktops (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Manually switch spaces for app shims 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
« no previous file with comments | « no previous file | chrome/browser/app_controller_mac.mm » ('j') | ui/base/cocoa/focus_window_set.mm » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 Profile* profile = delegate_->ProfileForPath(host->GetProfilePath()); 290 Profile* profile = delegate_->ProfileForPath(host->GetProfilePath());
291 291
292 const ShellWindowList windows = 292 const ShellWindowList windows =
293 delegate_->GetWindows(profile, host->GetAppId()); 293 delegate_->GetWindows(profile, host->GetAppId());
294 std::set<gfx::NativeWindow> native_windows; 294 std::set<gfx::NativeWindow> native_windows;
295 for (ShellWindowList::const_iterator it = windows.begin(); 295 for (ShellWindowList::const_iterator it = windows.begin();
296 it != windows.end(); ++it) { 296 it != windows.end(); ++it) {
297 native_windows.insert((*it)->GetNativeWindow()); 297 native_windows.insert((*it)->GetNativeWindow());
298 } 298 }
299 if (!native_windows.empty()) { 299 if (!native_windows.empty()) {
300 ui::FocusWindowSet(native_windows); 300 // Allow workspace switching. For the browser process, we can
301 // reasonably rely on OS X to switch spaces for us and honor
302 // relevant user settings. But shims don't have windows, so we
303 // have to do it ourselves.
304 ui::FocusWindowSet(native_windows, true);
301 return; 305 return;
302 } 306 }
303 307
304 if (focus_type == APP_SHIM_FOCUS_REOPEN) { 308 if (focus_type == APP_SHIM_FOCUS_REOPEN) {
305 const extensions::Extension* extension = 309 const extensions::Extension* extension =
306 delegate_->GetAppExtension(profile, host->GetAppId()); 310 delegate_->GetAppExtension(profile, host->GetAppId());
307 if (extension) { 311 if (extension) {
308 delegate_->LaunchApp(profile, extension); 312 delegate_->LaunchApp(profile, extension);
309 } else { 313 } else {
310 // Extensions may have been uninstalled or disabled since the shim 314 // Extensions may have been uninstalled or disabled since the shim
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 if (!browser_opened_ever_ && hosts_.empty()) 413 if (!browser_opened_ever_ && hosts_.empty())
410 delegate_->MaybeTerminate(); 414 delegate_->MaybeTerminate();
411 } 415 }
412 416
413 void ExtensionAppShimHandler::OnAppStop(Profile* profile, 417 void ExtensionAppShimHandler::OnAppStop(Profile* profile,
414 const std::string& app_id) {} 418 const std::string& app_id) {}
415 419
416 void ExtensionAppShimHandler::OnChromeTerminating() {} 420 void ExtensionAppShimHandler::OnChromeTerminating() {}
417 421
418 } // namespace apps 422 } // namespace apps
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/app_controller_mac.mm » ('j') | ui/base/cocoa/focus_window_set.mm » ('J')

Powered by Google App Engine
This is Rietveld 408576698