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

Side by Side Diff: chrome/browser/chromeos/settings/device_oauth2_token_service_factory.cc

Issue 12647008: Refactor OAuth2TokenService to have profile- and device-based implementations. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rebase again Created 7 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h "
6
7 #include "chrome/browser/browser_process.h"
8 #include "chrome/browser/chromeos/settings/device_oauth2_token_service.h"
9 #include "content/public/browser/browser_thread.h"
10
11 namespace chromeos {
12
13 static DeviceOAuth2TokenService* g_device_oauth2_token_service_ = NULL;
14
15 DeviceOAuth2TokenServiceFactory::DeviceOAuth2TokenServiceFactory() {
16 }
17
18 // static
19 DeviceOAuth2TokenService* DeviceOAuth2TokenServiceFactory::Get() {
20 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
21 return g_device_oauth2_token_service_;
22 }
23
24 // static
25 void DeviceOAuth2TokenServiceFactory::Initialize() {
26 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
27 DCHECK(!g_device_oauth2_token_service_);
28 g_device_oauth2_token_service_ = new DeviceOAuth2TokenService(
29 g_browser_process->system_request_context(),
30 g_browser_process->local_state());
31 }
32
33 // static
34 void DeviceOAuth2TokenServiceFactory::Shutdown() {
35 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
36 if (g_device_oauth2_token_service_) {
37 delete g_device_oauth2_token_service_;
38 g_device_oauth2_token_service_ = NULL;
39 }
40 }
41
42 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698