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

Unified Diff: chrome/test/testing_device_token_fetcher.cc

Issue 4960003: Don't register gmail users at the device management server (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/testing_device_token_fetcher.cc
diff --git a/chrome/test/testing_device_token_fetcher.cc b/chrome/test/testing_device_token_fetcher.cc
new file mode 100644
index 0000000000000000000000000000000000000000..ed491e155a0b0c79b5020d1ad8c2ccf4e4429db3
--- /dev/null
+++ b/chrome/test/testing_device_token_fetcher.cc
@@ -0,0 +1,45 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/test/testing_device_token_fetcher.h"
+
+#include "chrome/common/notification_service.h"
+#include "chrome/common/notification_source.h"
+#include "chrome/common/notification_type.h"
+#include "chrome/browser/policy/device_token_fetcher.h"
+#include "chrome/browser/profile.h"
+
+#if defined(OS_CHROMEOS)
+#include "chrome/browser/chromeos/login/user_manager.h"
+#else
+#include "chrome/browser/sync/signin_manager.h"
+#endif
+
+namespace policy {
+
+const char* kTestManagedDomainUsername = "___@example.com";
+
+void TestingDeviceTokenFetcher::SimulateLogin(const std::string& username) {
+ username_ = username;
+#if defined(OS_CHROMEOS)
+ chromeos::UserManager::User user;
+ user.set_email(username_);
+ NotificationService::current()->Notify(
+ NotificationType::LOGIN_USER_CHANGED,
+ Source<chromeos::UserManager>(NULL),
+ Details<const chromeos::UserManager::User>(&user));
+#else
+ GoogleServiceSigninSuccessDetails details(username_, "");
+ NotificationService::current()->Notify(
+ NotificationType::GOOGLE_SIGNIN_SUCCESSFUL,
+ Source<Profile>(profile_),
+ Details<const GoogleServiceSigninSuccessDetails>(&details));
+#endif
+}
+
+std::string TestingDeviceTokenFetcher::GetCurrentUser() {
+ return username_;
+}
+
+} // namespace policy
« chrome/browser/policy/device_token_fetcher.cc ('K') | « chrome/test/testing_device_token_fetcher.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698