| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include <algorithm> | 5 #include <algorithm> |
| 6 #include <map> | 6 #include <map> |
| 7 | 7 |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 131 |
| 132 GoogleServiceSigninSuccessDetails details(GetAuthenticatedUsername(), | 132 GoogleServiceSigninSuccessDetails details(GetAuthenticatedUsername(), |
| 133 std::string()); | 133 std::string()); |
| 134 content::NotificationService::current()->Notify( | 134 content::NotificationService::current()->Notify( |
| 135 chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL, | 135 chrome::NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL, |
| 136 content::Source<Profile>(profile_), | 136 content::Source<Profile>(profile_), |
| 137 content::Details<const GoogleServiceSigninSuccessDetails>(&details)); | 137 content::Details<const GoogleServiceSigninSuccessDetails>(&details)); |
| 138 } | 138 } |
| 139 | 139 |
| 140 void SignOut() { | 140 void SignOut() { |
| 141 std::string username = GetAuthenticatedUsername(); |
| 141 clear_authenticated_username(); | 142 clear_authenticated_username(); |
| 143 profile()->GetPrefs()->ClearPref(prefs::kGoogleServicesUsername); |
| 142 | 144 |
| 143 GoogleServiceSignoutDetails details(GetAuthenticatedUsername()); | 145 GoogleServiceSignoutDetails details(username); |
| 144 content::NotificationService::current()->Notify( | 146 content::NotificationService::current()->Notify( |
| 145 chrome::NOTIFICATION_GOOGLE_SIGNED_OUT, | 147 chrome::NOTIFICATION_GOOGLE_SIGNED_OUT, |
| 146 content::Source<Profile>(profile_), | 148 content::Source<Profile>(profile_), |
| 147 content::Details<const GoogleServiceSignoutDetails>(&details)); | 149 content::Details<const GoogleServiceSignoutDetails>(&details)); |
| 148 } | 150 } |
| 149 }; | 151 }; |
| 150 | 152 |
| 151 } // namespace | 153 } // namespace |
| 152 | 154 |
| 153 class FakeGCMEventRouter : public GCMEventRouter { | 155 class FakeGCMEventRouter : public GCMEventRouter { |
| (...skipping 1266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1420 consumer()->gcm_event_router()->clear_results(); | 1422 consumer()->gcm_event_router()->clear_results(); |
| 1421 WaitUntilCompleted(); | 1423 WaitUntilCompleted(); |
| 1422 | 1424 |
| 1423 EXPECT_EQ(FakeGCMEventRouter::MESSAGE_EVENT, | 1425 EXPECT_EQ(FakeGCMEventRouter::MESSAGE_EVENT, |
| 1424 consumer()->gcm_event_router()->received_event()); | 1426 consumer()->gcm_event_router()->received_event()); |
| 1425 EXPECT_TRUE( | 1427 EXPECT_TRUE( |
| 1426 in_message5.data == consumer()->gcm_event_router()->message().data); | 1428 in_message5.data == consumer()->gcm_event_router()->message().data); |
| 1427 } | 1429 } |
| 1428 | 1430 |
| 1429 } // namespace gcm | 1431 } // namespace gcm |
| OLD | NEW |