| 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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  350     SigninManager* signin_manager = |  350     SigninManager* signin_manager = | 
|  351         SigninManagerFactory::GetForProfile(profile); |  351         SigninManagerFactory::GetForProfile(profile); | 
|  352     if (signin_manager && signin_manager->GetAuthenticatedUsername().empty()) { |  352     if (signin_manager && signin_manager->GetAuthenticatedUsername().empty()) { | 
|  353       const char kEnforceSigninToUseAppsFieldTrial[] = "EnforceSigninToUseApps"; |  353       const char kEnforceSigninToUseAppsFieldTrial[] = "EnforceSigninToUseApps"; | 
|  354  |  354  | 
|  355       std::string field_trial_value = |  355       std::string field_trial_value = | 
|  356           base::FieldTrialList::FindFullName(kEnforceSigninToUseAppsFieldTrial); |  356           base::FieldTrialList::FindFullName(kEnforceSigninToUseAppsFieldTrial); | 
|  357  |  357  | 
|  358       // Only enforce signin if the field trial is set. |  358       // Only enforce signin if the field trial is set. | 
|  359       if (!field_trial_value.empty()) { |  359       if (!field_trial_value.empty()) { | 
|  360         GURL gurl(l10n_util::GetStringFUTF8(IDS_APP_LAUNCH_NOT_SIGNED_IN_LINK, |  360         GURL gurl(l10n_util::GetStringFUTF8( | 
|  361                                             UTF8ToUTF16(extension->id()))); |  361             IDS_APP_LAUNCH_NOT_SIGNED_IN_LINK, | 
 |  362             base::UTF8ToUTF16(extension->id()))); | 
|  362         chrome::NavigateParams navigate_params(profile, gurl, |  363         chrome::NavigateParams navigate_params(profile, gurl, | 
|  363                                                content::PAGE_TRANSITION_LINK); |  364                                                content::PAGE_TRANSITION_LINK); | 
|  364         navigate_params.host_desktop_type = params.desktop_type; |  365         navigate_params.host_desktop_type = params.desktop_type; | 
|  365         chrome::Navigate(&navigate_params); |  366         chrome::Navigate(&navigate_params); | 
|  366         return NULL; |  367         return NULL; | 
|  367       } |  368       } | 
|  368     } |  369     } | 
|  369 #endif |  370 #endif | 
|  370  |  371  | 
|  371     apps::LaunchPlatformAppWithCommandLine( |  372     apps::LaunchPlatformAppWithCommandLine( | 
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  507   // up in LoadingStateChanged to schedule a GetApplicationInfo. And when |  508   // up in LoadingStateChanged to schedule a GetApplicationInfo. And when | 
|  508   // the web app info is available, extensions::TabHelper notifies Browser via |  509   // the web app info is available, extensions::TabHelper notifies Browser via | 
|  509   // OnDidGetApplicationInfo, which calls |  510   // OnDidGetApplicationInfo, which calls | 
|  510   // web_app::UpdateShortcutForTabContents when it sees UPDATE_SHORTCUT as |  511   // web_app::UpdateShortcutForTabContents when it sees UPDATE_SHORTCUT as | 
|  511   // pending web app action. |  512   // pending web app action. | 
|  512   extensions::TabHelper::FromWebContents(tab)->set_pending_web_app_action( |  513   extensions::TabHelper::FromWebContents(tab)->set_pending_web_app_action( | 
|  513       extensions::TabHelper::UPDATE_SHORTCUT); |  514       extensions::TabHelper::UPDATE_SHORTCUT); | 
|  514  |  515  | 
|  515   return tab; |  516   return tab; | 
|  516 } |  517 } | 
| OLD | NEW |