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

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

Issue 1829703002: Add ArcEnabled policy implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed comments. Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_auth_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_
6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_ 6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_
7 7
8 #include <ostream> 8 #include <ostream>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
11 #include "base/observer_list.h" 11 #include "base/observer_list.h"
12 #include "base/threading/thread_checker.h" 12 #include "base/threading/thread_checker.h"
13 #include "components/arc/arc_bridge_service.h" 13 #include "components/arc/arc_bridge_service.h"
14 #include "components/arc/arc_service.h" 14 #include "components/arc/arc_service.h"
15 #include "components/arc/auth/arc_auth_fetcher.h" 15 #include "components/arc/auth/arc_auth_fetcher.h"
16 #include "components/arc/common/auth.mojom.h" 16 #include "components/arc/common/auth.mojom.h"
17 #include "components/prefs/pref_change_registrar.h"
17 #include "components/syncable_prefs/pref_service_syncable_observer.h" 18 #include "components/syncable_prefs/pref_service_syncable_observer.h"
18 #include "components/syncable_prefs/synced_pref_observer.h" 19 #include "components/syncable_prefs/synced_pref_observer.h"
19 #include "google_apis/gaia/gaia_auth_consumer.h" 20 #include "google_apis/gaia/gaia_auth_consumer.h"
20 #include "google_apis/gaia/ubertoken_fetcher.h" 21 #include "google_apis/gaia/ubertoken_fetcher.h"
21 #include "mojo/public/cpp/bindings/binding.h" 22 #include "mojo/public/cpp/bindings/binding.h"
22 23
23 class GaiaAuthFetcher; 24 class GaiaAuthFetcher;
24 class Profile; 25 class Profile;
25 26
26 namespace content { 27 namespace content {
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 void ShutdownBridgeAndShowUI(UIPage page, const base::string16& status); 164 void ShutdownBridgeAndShowUI(UIPage page, const base::string16& status);
164 void OnOptInPreferenceChanged(); 165 void OnOptInPreferenceChanged();
165 void FetchAuthCode(); 166 void FetchAuthCode();
166 167
167 // Unowned pointer. Keeps current profile. 168 // Unowned pointer. Keeps current profile.
168 Profile* profile_ = nullptr; 169 Profile* profile_ = nullptr;
169 // Owned by content::BrowserContent. Used to isolate cookies for auth server 170 // Owned by content::BrowserContent. Used to isolate cookies for auth server
170 // communication and shared with Arc OptIn UI platform app. 171 // communication and shared with Arc OptIn UI platform app.
171 content::StoragePartition* storage_partition_ = nullptr; 172 content::StoragePartition* storage_partition_ = nullptr;
172 173
174 // Registrar used to monitor ARC enabled state.
175 PrefChangeRegistrar pref_change_registrar_;
176
173 mojo::Binding<AuthHost> binding_; 177 mojo::Binding<AuthHost> binding_;
174 base::ThreadChecker thread_checker_; 178 base::ThreadChecker thread_checker_;
175 State state_ = State::STOPPED; 179 State state_ = State::STOPPED;
176 base::ObserverList<Observer> observer_list_; 180 base::ObserverList<Observer> observer_list_;
177 scoped_ptr<ArcAuthFetcher> auth_fetcher_; 181 scoped_ptr<ArcAuthFetcher> auth_fetcher_;
178 scoped_ptr<GaiaAuthFetcher> merger_fetcher_; 182 scoped_ptr<GaiaAuthFetcher> merger_fetcher_;
179 scoped_ptr<UbertokenFetcher> ubertoken_fethcher_; 183 scoped_ptr<UbertokenFetcher> ubertoken_fethcher_;
180 std::string auth_code_; 184 std::string auth_code_;
181 GetAuthCodeCallback auth_callback_; 185 GetAuthCodeCallback auth_callback_;
182 bool initial_opt_in_ = false; 186 bool initial_opt_in_ = false;
183 bool context_prepared_ = false; 187 bool context_prepared_ = false;
184 UIPage ui_page_ = UIPage::NO_PAGE; 188 UIPage ui_page_ = UIPage::NO_PAGE;
185 base::string16 ui_page_status_; 189 base::string16 ui_page_status_;
186 190
187 DISALLOW_COPY_AND_ASSIGN(ArcAuthService); 191 DISALLOW_COPY_AND_ASSIGN(ArcAuthService);
188 }; 192 };
189 193
190 std::ostream& operator<<(std::ostream& os, const ArcAuthService::State& state); 194 std::ostream& operator<<(std::ostream& os, const ArcAuthService::State& state);
191 195
192 } // namespace arc 196 } // namespace arc
193 197
194 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_ 198 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_AUTH_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/arc/arc_auth_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698