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

Side by Side Diff: chrome/browser/chromeos/arc/arc_auth_service.cc

Issue 2508713003: arc: Prepare ArcAuthEndpoint flag for finch experiment. (Closed)
Patch Set: Created 4 years, 1 month 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/chromeos/arc/arc_auth_service.h" 5 #include "chrome/browser/chromeos/arc/arc_auth_service.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/shelf/shelf_delegate.h" 9 #include "ash/common/shelf/shelf_delegate.h"
10 #include "ash/common/wm_shell.h" 10 #include "ash/common/wm_shell.h"
(...skipping 24 matching lines...) Expand all
35 #include "chrome/browser/ui/browser_commands.h" 35 #include "chrome/browser/ui/browser_commands.h"
36 #include "chrome/browser/ui/extensions/app_launch_params.h" 36 #include "chrome/browser/ui/extensions/app_launch_params.h"
37 #include "chrome/browser/ui/extensions/application_launch.h" 37 #include "chrome/browser/ui/extensions/application_launch.h"
38 #include "chrome/common/pref_names.h" 38 #include "chrome/common/pref_names.h"
39 #include "chrome/grit/generated_resources.h" 39 #include "chrome/grit/generated_resources.h"
40 #include "chromeos/chromeos_switches.h" 40 #include "chromeos/chromeos_switches.h"
41 #include "chromeos/cryptohome/cryptohome_parameters.h" 41 #include "chromeos/cryptohome/cryptohome_parameters.h"
42 #include "chromeos/dbus/dbus_thread_manager.h" 42 #include "chromeos/dbus/dbus_thread_manager.h"
43 #include "chromeos/dbus/session_manager_client.h" 43 #include "chromeos/dbus/session_manager_client.h"
44 #include "components/arc/arc_bridge_service.h" 44 #include "components/arc/arc_bridge_service.h"
45 #include "components/arc/arc_features.h"
45 #include "components/pref_registry/pref_registry_syncable.h" 46 #include "components/pref_registry/pref_registry_syncable.h"
46 #include "components/prefs/pref_service.h" 47 #include "components/prefs/pref_service.h"
47 #include "components/sync_preferences/pref_service_syncable.h" 48 #include "components/sync_preferences/pref_service_syncable.h"
48 #include "components/user_manager/user.h" 49 #include "components/user_manager/user.h"
49 #include "content/public/browser/browser_thread.h" 50 #include "content/public/browser/browser_thread.h"
50 #include "extensions/browser/app_window/app_window_registry.h" 51 #include "extensions/browser/app_window/app_window_registry.h"
51 #include "extensions/browser/extension_prefs.h" 52 #include "extensions/browser/extension_prefs.h"
52 #include "extensions/browser/extension_registry.h" 53 #include "extensions/browser/extension_registry.h"
53 #include "ui/base/l10n/l10n_util.h" 54 #include "ui/base/l10n/l10n_util.h"
54 55
(...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after
1046 case policy::AndroidManagementClient::Result::ERROR: 1047 case policy::AndroidManagementClient::Result::ERROR:
1047 // This code should not be reached. For background check, 1048 // This code should not be reached. For background check,
1048 // retry_on_error should be set. 1049 // retry_on_error should be set.
1049 NOTREACHED(); 1050 NOTREACHED();
1050 } 1051 }
1051 } 1052 }
1052 1053
1053 void ArcAuthService::FetchAuthCode() { 1054 void ArcAuthService::FetchAuthCode() {
1054 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 1055 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
1055 1056
1056 const base::CommandLine* command_line = 1057 if (base::FeatureList::IsEnabled(arc::kArcUseAuthEndpointFeature)) {
1057 base::CommandLine::ForCurrentProcess();
1058 std::string auth_endpoint;
1059 if (command_line->HasSwitch(chromeos::switches::kArcUseAuthEndpoint)) {
1060 auth_endpoint = command_line->GetSwitchValueASCII(
1061 chromeos::switches::kArcUseAuthEndpoint);
1062 }
1063
1064 if (!auth_endpoint.empty()) {
1065 auth_code_fetcher_.reset(new ArcAuthCodeFetcher( 1058 auth_code_fetcher_.reset(new ArcAuthCodeFetcher(
1066 this, context_->GetURLRequestContext(), profile_, auth_endpoint)); 1059 this, context_->GetURLRequestContext(), profile_));
1067 } else { 1060 } else {
1068 ShowUI(ArcSupportHost::UIPage::LSO_PROGRESS, base::string16()); 1061 ShowUI(ArcSupportHost::UIPage::LSO_PROGRESS, base::string16());
1069 } 1062 }
1070 } 1063 }
1071 1064
1072 void ArcAuthService::OnWindowClosed() { 1065 void ArcAuthService::OnWindowClosed() {
1073 CancelAuthCode(); 1066 CancelAuthCode();
1074 } 1067 }
1075 1068
1076 void ArcAuthService::OnTermsAgreed(bool is_metrics_enabled, 1069 void ArcAuthService::OnTermsAgreed(bool is_metrics_enabled,
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
1160 return os << "ACTIVE"; 1153 return os << "ACTIVE";
1161 } 1154 }
1162 1155
1163 // Some compiler reports an error even if all values of an enum-class are 1156 // Some compiler reports an error even if all values of an enum-class are
1164 // covered indivisually in a switch statement. 1157 // covered indivisually in a switch statement.
1165 NOTREACHED(); 1158 NOTREACHED();
1166 return os; 1159 return os;
1167 } 1160 }
1168 1161
1169 } // namespace arc 1162 } // namespace arc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698