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

Side by Side Diff: chrome/browser/chrome_to_mobile_service.h

Issue 14622003: components: Move PrefRegistrySyncable into user_prefs namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 7 years, 7 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 | Annotate | Revision Log
OLDNEW
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 #ifndef CHROME_BROWSER_CHROME_TO_MOBILE_SERVICE_H_ 5 #ifndef CHROME_BROWSER_CHROME_TO_MOBILE_SERVICE_H_
6 #define CHROME_BROWSER_CHROME_TO_MOBILE_SERVICE_H_ 6 #define CHROME_BROWSER_CHROME_TO_MOBILE_SERVICE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <queue> 9 #include <queue>
10 #include <set> 10 #include <set>
(...skipping 13 matching lines...) Expand all
24 #include "content/public/browser/notification_registrar.h" 24 #include "content/public/browser/notification_registrar.h"
25 #include "google_apis/gaia/oauth2_access_token_consumer.h" 25 #include "google_apis/gaia/oauth2_access_token_consumer.h"
26 #include "googleurl/src/gurl.h" 26 #include "googleurl/src/gurl.h"
27 #include "net/url_request/url_fetcher_delegate.h" 27 #include "net/url_request/url_fetcher_delegate.h"
28 #include "sync/notifier/invalidation_handler.h" 28 #include "sync/notifier/invalidation_handler.h"
29 29
30 class OAuth2AccessTokenFetcher; 30 class OAuth2AccessTokenFetcher;
31 class Browser; 31 class Browser;
32 class CloudPrintURL; 32 class CloudPrintURL;
33 class MockChromeToMobileService; 33 class MockChromeToMobileService;
34 class PrefRegistrySyncable;
35 class Profile; 34 class Profile;
36 35
37 namespace net { 36 namespace net {
38 class URLFetcher; 37 class URLFetcher;
39 } 38 }
40 39
40 namespace user_prefs {
41 class PrefRegistrySyncable;
42 }
43
41 // ChromeToMobileService connects to the cloud print service to enumerate 44 // ChromeToMobileService connects to the cloud print service to enumerate
42 // compatible mobiles owned by its profile and send URLs and MHTML snapshots. 45 // compatible mobiles owned by its profile and send URLs and MHTML snapshots.
43 class ChromeToMobileService : public ProfileKeyedService, 46 class ChromeToMobileService : public ProfileKeyedService,
44 public net::URLFetcherDelegate, 47 public net::URLFetcherDelegate,
45 public content::NotificationObserver, 48 public content::NotificationObserver,
46 public OAuth2AccessTokenConsumer, 49 public OAuth2AccessTokenConsumer,
47 public syncer::InvalidationHandler { 50 public syncer::InvalidationHandler {
48 public: 51 public:
49 class Observer { 52 class Observer {
50 public: 53 public:
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 94
92 // Returns whether Chrome To Mobile is enabled (gated on the Action Box UI). 95 // Returns whether Chrome To Mobile is enabled (gated on the Action Box UI).
93 static bool IsChromeToMobileEnabled(); 96 static bool IsChromeToMobileEnabled();
94 97
95 // Update and return the IDC_CHROME_TO_MOBILE_PAGE command enabled state; the 98 // Update and return the IDC_CHROME_TO_MOBILE_PAGE command enabled state; the
96 // state is derived from commandline, profile, and current page applicability. 99 // state is derived from commandline, profile, and current page applicability.
97 // NOTE: Call this instead of IsCommandEnabled(IDC_CHROME_TO_MOBILE_PAGE). 100 // NOTE: Call this instead of IsCommandEnabled(IDC_CHROME_TO_MOBILE_PAGE).
98 static bool UpdateAndGetCommandState(Browser* browser); 101 static bool UpdateAndGetCommandState(Browser* browser);
99 102
100 // Register the user prefs associated with this service. 103 // Register the user prefs associated with this service.
101 static void RegisterUserPrefs(PrefRegistrySyncable* registry); 104 static void RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry);
102 105
103 explicit ChromeToMobileService(Profile* profile); 106 explicit ChromeToMobileService(Profile* profile);
104 virtual ~ChromeToMobileService(); 107 virtual ~ChromeToMobileService();
105 108
106 // Returns true if the service has found any registered mobile devices. 109 // Returns true if the service has found any registered mobile devices.
107 bool HasMobiles() const; 110 bool HasMobiles() const;
108 111
109 // Get the non-NULL ListValue of mobile devices from the cloud print service. 112 // Get the non-NULL ListValue of mobile devices from the cloud print service.
110 // The list is owned by PrefService, which outlives ChromeToMobileService. 113 // The list is owned by PrefService, which outlives ChromeToMobileService.
111 // Each device DictionaryValue contains strings "type", "name", and "id". 114 // Each device DictionaryValue contains strings "type", "name", and "id".
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 base::OneShotTimer<ChromeToMobileService> auth_retry_timer_; 228 base::OneShotTimer<ChromeToMobileService> auth_retry_timer_;
226 base::OneShotTimer<ChromeToMobileService> search_retry_timer_; 229 base::OneShotTimer<ChromeToMobileService> search_retry_timer_;
227 230
228 // A queue of tasks to perform after an access token is lazily initialized. 231 // A queue of tasks to perform after an access token is lazily initialized.
229 std::queue<base::Closure> task_queue_; 232 std::queue<base::Closure> task_queue_;
230 233
231 DISALLOW_COPY_AND_ASSIGN(ChromeToMobileService); 234 DISALLOW_COPY_AND_ASSIGN(ChromeToMobileService);
232 }; 235 };
233 236
234 #endif // CHROME_BROWSER_CHROME_TO_MOBILE_SERVICE_H_ 237 #endif // CHROME_BROWSER_CHROME_TO_MOBILE_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/chrome_content_browser_client.cc ('k') | chrome/browser/chrome_to_mobile_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698