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

Unified Diff: chrome/browser/ui/extensions/application_launch.cc

Issue 111553008: Add PerAppSettingsService and use it to remember what desktop apps should create windows on. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: redirect PerAppSettingsService in incognito mode because component apps can run in incognito mode (… Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/extensions/application_launch.cc
diff --git a/chrome/browser/ui/extensions/application_launch.cc b/chrome/browser/ui/extensions/application_launch.cc
index 54617d32da1b20410f89e04fe435ce4302c17984..52abb7e625dd919e05840d2f618267c96ce3d3cf 100644
--- a/chrome/browser/ui/extensions/application_launch.cc
+++ b/chrome/browser/ui/extensions/application_launch.cc
@@ -12,6 +12,8 @@
#include "base/metrics/histogram.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/app_mode/app_mode_utils.h"
+#include "chrome/browser/apps/per_app_settings_service.h"
+#include "chrome/browser/apps/per_app_settings_service_factory.h"
#include "chrome/browser/extensions/extension_prefs.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/extensions/extension_system.h"
@@ -346,6 +348,10 @@ WebContents* OpenEnabledApplication(const AppLaunchParams& params) {
"Extensions.AppLaunchContainer", params.container, 100);
if (extension->is_platform_app()) {
+ // Remember what desktop the launch happened on so that when the app opens a
+ // window we can open them on the right desktop.
+ PerAppSettingsServiceFactory::GetForBrowserContext(profile)->
+ SetDesktopLastLaunchedFrom(extension->id(), params.desktop_type);
#if !defined(OS_CHROMEOS)
SigninManager* signin_manager =
SigninManagerFactory::GetForProfile(profile);
« no previous file with comments | « chrome/browser/apps/per_app_settings_service_factory.cc ('k') | chrome/browser/ui/startup/startup_browser_creator_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698