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

Side by Side 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 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
(Empty)
1 // Copyright (c) 2010 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/test/testing_device_token_fetcher.h"
6
7 #include "chrome/common/notification_service.h"
8 #include "chrome/common/notification_source.h"
9 #include "chrome/common/notification_type.h"
10 #include "chrome/browser/policy/device_token_fetcher.h"
11 #include "chrome/browser/profile.h"
12
13 #if defined(OS_CHROMEOS)
14 #include "chrome/browser/chromeos/login/user_manager.h"
15 #else
16 #include "chrome/browser/sync/signin_manager.h"
17 #endif
18
19 namespace policy {
20
21 const char* kTestManagedDomainUsername = "___@example.com";
22
23 void TestingDeviceTokenFetcher::SimulateLogin(const std::string& username) {
24 username_ = username;
25 #if defined(OS_CHROMEOS)
26 chromeos::UserManager::User user;
27 user.set_email(username_);
28 NotificationService::current()->Notify(
29 NotificationType::LOGIN_USER_CHANGED,
30 Source<chromeos::UserManager>(NULL),
31 Details<const chromeos::UserManager::User>(&user));
32 #else
33 GoogleServiceSigninSuccessDetails details(username_, "");
34 NotificationService::current()->Notify(
35 NotificationType::GOOGLE_SIGNIN_SUCCESSFUL,
36 Source<Profile>(profile_),
37 Details<const GoogleServiceSigninSuccessDetails>(&details));
38 #endif
39 }
40
41 std::string TestingDeviceTokenFetcher::GetCurrentUser() {
42 return username_;
43 }
44
45 } // namespace policy
OLDNEW
« 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