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

Unified Diff: components/wifi_sync/wifi_credential_syncable_service_factory.h

Issue 876833002: wifi_sync: allow WifiCredentialSyncableServiceFactory to ignore LoginState (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@submit-4.3-syncable-service
Patch Set: Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: components/wifi_sync/wifi_credential_syncable_service_factory.h
diff --git a/components/wifi_sync/wifi_credential_syncable_service_factory.h b/components/wifi_sync/wifi_credential_syncable_service_factory.h
index be1dae524010da6fe08414e688fb662a6810c264..817039f799d4b11b6adfafc1b7460655e6fdb998 100644
--- a/components/wifi_sync/wifi_credential_syncable_service_factory.h
+++ b/components/wifi_sync/wifi_credential_syncable_service_factory.h
@@ -5,7 +5,10 @@
#ifndef COMPONENTS_WIFI_SYNC_WIFI_CREDENTIAL_SYNCABLE_SERVICE_FACTORY_H_
#define COMPONENTS_WIFI_SYNC_WIFI_CREDENTIAL_SYNCABLE_SERVICE_FACTORY_H_
+#include <string>
+
#include "base/macros.h"
+#include "base/memory/scoped_ptr.h"
#include "base/memory/singleton.h"
#include "components/keyed_service/content/browser_context_keyed_service_factory.h"
@@ -15,6 +18,7 @@ class BrowserContext;
namespace wifi_sync {
+class WifiConfigDelegate;
class WifiCredentialSyncableService;
// Singleton that owns all WifiCredentialSyncableServices and
@@ -29,12 +33,17 @@ class WifiCredentialSyncableServiceFactory
static WifiCredentialSyncableService* GetForBrowserContext(
content::BrowserContext* browser_context);
- // Returns the singleton instance. As this class has no public
- // instance methods, this function is not generally useful for
- // external callers. This function is public only so that the
- // Singleton template can reference it.
+ // Returns the singleton instance.
static WifiCredentialSyncableServiceFactory* GetInstance();
+#if defined(OS_CHROMEOS)
+ // Configures the factory to ignore chromeos::LoginState when
+ // associating a new SyncableService with a Shill profile. Intended
+ // for use in sync integration tests, where it is not possible to
+ // control LoginState at the time SyncableServices are constructed.
+ void IgnoreLoginStateForTest();
+#endif
+
private:
friend struct DefaultSingletonTraits<WifiCredentialSyncableServiceFactory>;
@@ -45,6 +54,19 @@ class WifiCredentialSyncableServiceFactory
KeyedService* BuildServiceInstanceFor(
content::BrowserContext* context) const override;
+ // Returns a scoped pointer to a WifiConfigDelegate, which can be
+ // used to configure the platform-specific Wi-Fi settings associated
+ // with |context|.
+ scoped_ptr<WifiConfigDelegate> BuildWifiConfigDelegate(
+ content::BrowserContext* context) const;
+ // ChromeOS-specific code used by BuildWifiConfigDelegate.
+ scoped_ptr<WifiConfigDelegate> BuildWifiConfigDelegateChromeOs(
+ content::BrowserContext* context) const;
+ // Returns the name of the Shill profile associated with |context|.
+ std::string GetShillProfile(content::BrowserContext* context) const;
+
+ bool use_login_state_chrome_os_;
+
DISALLOW_COPY_AND_ASSIGN(WifiCredentialSyncableServiceFactory);
};

Powered by Google App Engine
This is Rietveld 408576698