OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/ui/extensions/application_launch.h" | 5 #include "chrome/browser/ui/extensions/application_launch.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "apps/launcher.h" | 9 #include "apps/launcher.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 "Extensions.AppLaunchContainer", params.container, 100); | 338 "Extensions.AppLaunchContainer", params.container, 100); |
339 | 339 |
340 if (extension->is_platform_app()) { | 340 if (extension->is_platform_app()) { |
341 // Remember what desktop the launch happened on so that when the app opens a | 341 // Remember what desktop the launch happened on so that when the app opens a |
342 // window we can open them on the right desktop. | 342 // window we can open them on the right desktop. |
343 PerAppSettingsServiceFactory::GetForBrowserContext(profile)-> | 343 PerAppSettingsServiceFactory::GetForBrowserContext(profile)-> |
344 SetDesktopLastLaunchedFrom(extension->id(), params.desktop_type); | 344 SetDesktopLastLaunchedFrom(extension->id(), params.desktop_type); |
345 #if !defined(OS_CHROMEOS) | 345 #if !defined(OS_CHROMEOS) |
346 SigninManager* signin_manager = | 346 SigninManager* signin_manager = |
347 SigninManagerFactory::GetForProfile(profile); | 347 SigninManagerFactory::GetForProfile(profile); |
348 if (signin_manager && signin_manager->GetAuthenticatedUsername().empty()) { | 348 if (extension->id() != extension_misc::kSettingsAppId && |
| 349 signin_manager && signin_manager->GetAuthenticatedUsername().empty()) { |
349 const char kEnforceSigninToUseAppsFieldTrial[] = "EnforceSigninToUseApps"; | 350 const char kEnforceSigninToUseAppsFieldTrial[] = "EnforceSigninToUseApps"; |
350 | 351 |
351 std::string field_trial_value = | 352 std::string field_trial_value = |
352 base::FieldTrialList::FindFullName(kEnforceSigninToUseAppsFieldTrial); | 353 base::FieldTrialList::FindFullName(kEnforceSigninToUseAppsFieldTrial); |
353 | 354 |
354 // Only enforce signin if the field trial is set. | 355 // Only enforce signin if the field trial is set. |
355 if (!field_trial_value.empty()) { | 356 if (!field_trial_value.empty()) { |
356 GURL gurl(l10n_util::GetStringFUTF8( | 357 GURL gurl(l10n_util::GetStringFUTF8( |
357 IDS_APP_LAUNCH_NOT_SIGNED_IN_LINK, | 358 IDS_APP_LAUNCH_NOT_SIGNED_IN_LINK, |
358 base::UTF8ToUTF16(extension->id()))); | 359 base::UTF8ToUTF16(extension->id()))); |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 // up in LoadingStateChanged to schedule a GetApplicationInfo. And when | 498 // up in LoadingStateChanged to schedule a GetApplicationInfo. And when |
498 // the web app info is available, extensions::TabHelper notifies Browser via | 499 // the web app info is available, extensions::TabHelper notifies Browser via |
499 // OnDidGetApplicationInfo, which calls | 500 // OnDidGetApplicationInfo, which calls |
500 // web_app::UpdateShortcutForTabContents when it sees UPDATE_SHORTCUT as | 501 // web_app::UpdateShortcutForTabContents when it sees UPDATE_SHORTCUT as |
501 // pending web app action. | 502 // pending web app action. |
502 extensions::TabHelper::FromWebContents(tab)->set_pending_web_app_action( | 503 extensions::TabHelper::FromWebContents(tab)->set_pending_web_app_action( |
503 extensions::TabHelper::UPDATE_SHORTCUT); | 504 extensions::TabHelper::UPDATE_SHORTCUT); |
504 | 505 |
505 return tab; | 506 return tab; |
506 } | 507 } |
OLD | NEW |