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

Unified Diff: chrome/browser/app_controller_mac.mm

Issue 790043002: Hosted apps on OS X now act more like a native app. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@creating-app-shims-2
Patch Set: Added comments and refactored app_controller_mac Created 6 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/apps/app_shim/extension_app_shim_handler_mac.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/app_controller_mac.mm
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index 2e2dfe57e200c64a0cff295ef819aeefefa3b63b..174b78658808204013d1d1fd6727cccc8dc5091f 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -74,6 +74,7 @@
#include "chrome/browser/ui/startup/startup_browser_creator.h"
#include "chrome/browser/ui/startup/startup_browser_creator_impl.h"
#include "chrome/browser/ui/user_manager.h"
+#include "chrome/browser/web_applications/web_app_mac.h"
#include "chrome/common/chrome_paths_internal.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/cloud_print/cloud_print_class_mac.h"
@@ -93,11 +94,14 @@
#include "content/public/browser/plugin_service.h"
#include "content/public/browser/user_metrics.h"
#include "extensions/browser/extension_system.h"
+#include "extensions/browser/extension_registry.h"
#include "net/base/filename_util.h"
#include "ui/base/cocoa/focus_window_set.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/l10n/l10n_util_mac.h"
+using apps::AppShimHandler;
+using apps::ExtensionAppShimHandler;
using base::UserMetricsAction;
using content::BrowserContext;
using content::BrowserThread;
@@ -1185,8 +1189,22 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver {
// notifications so we still need to open a new window.
if (hasVisibleWindows) {
std::set<NSWindow*> browserWindows;
+ ExtensionAppShimHandler* appShimHandler =
+ g_browser_process->platform_part()
+ ->app_shim_host_manager()
+ ->extension_app_shim_handler();
for (chrome::BrowserIterator iter; !iter.done(); iter.Next()) {
Browser* browser = *iter;
+ // When focusing Chrome, don't focus any browser windows associated with
+ // a currently running app shim, so ignore them.
+ if (browser && browser->is_app()) {
+ AppShimHandler::Host* host = appShimHandler->FindHost(
+ browser->profile(),
+ web_app::GetExtensionIdFromApplicationName(browser->app_name()));
+ if (host) {
+ continue;
+ }
+ }
browserWindows.insert(browser->window()->GetNativeWindow());
}
if (!browserWindows.empty()) {
« no previous file with comments | « no previous file | chrome/browser/apps/app_shim/extension_app_shim_handler_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698