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

Side by Side Diff: components/signin/core/browser/fake_auth_status_provider.h

Issue 1094103005: Profile chooser on mac was passing wrong value to signin error controller. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 5 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 COMPONENTS_SIGNIN_CORE_BROWSER_FAKE_AUTH_STATUS_PROVIDER_H_ 5 #ifndef COMPONENTS_SIGNIN_CORE_BROWSER_FAKE_AUTH_STATUS_PROVIDER_H_
6 #define COMPONENTS_SIGNIN_CORE_BROWSER_FAKE_AUTH_STATUS_PROVIDER_H_ 6 #define COMPONENTS_SIGNIN_CORE_BROWSER_FAKE_AUTH_STATUS_PROVIDER_H_
7 7
8 #include "components/signin/core/browser/signin_error_controller.h" 8 #include "components/signin/core/browser/signin_error_controller.h"
9 9
10 // Helper class that reports auth errors to SigninErrorController. Automatically 10 // Helper class that reports auth errors to SigninErrorController. Automatically
11 // registers and de-registers itself as an AuthStatusProvider in the 11 // registers and de-registers itself as an AuthStatusProvider in the
12 // constructor and destructor. 12 // constructor and destructor.
13 class FakeAuthStatusProvider 13 class FakeAuthStatusProvider
14 : public SigninErrorController::AuthStatusProvider { 14 : public SigninErrorController::AuthStatusProvider {
15 public: 15 public:
16 explicit FakeAuthStatusProvider(SigninErrorController* error); 16 explicit FakeAuthStatusProvider(SigninErrorController* error);
17 ~FakeAuthStatusProvider() override; 17 ~FakeAuthStatusProvider() override;
18 18
19 // Sets the auth error that this provider reports to SigninErrorController. 19 // Sets the auth error that this provider reports to SigninErrorController.
20 // Also notifies SigninErrorController via AuthStatusChanged(). 20 // Also notifies SigninErrorController via AuthStatusChanged().
21 void SetAuthError(const std::string& account_id, 21 void SetAuthError(const std::string& account_id,
22 const std::string& username,
23 const GoogleServiceAuthError& error); 22 const GoogleServiceAuthError& error);
24 23
25 void set_error_without_status_change(const GoogleServiceAuthError& error) { 24 void set_error_without_status_change(const GoogleServiceAuthError& error) {
26 auth_error_ = error; 25 auth_error_ = error;
27 } 26 }
28 27
29 // AuthStatusProvider implementation. 28 // AuthStatusProvider implementation.
30 std::string GetAccountId() const override; 29 std::string GetAccountId() const override;
31 std::string GetUsername() const override;
32 GoogleServiceAuthError GetAuthStatus() const override; 30 GoogleServiceAuthError GetAuthStatus() const override;
33 31
34 private: 32 private:
35 SigninErrorController* error_provider_; 33 SigninErrorController* error_provider_;
36 std::string account_id_; 34 std::string account_id_;
37 std::string username_;
38 GoogleServiceAuthError auth_error_; 35 GoogleServiceAuthError auth_error_;
39 }; 36 };
40 37
41 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_FAKE_AUTH_STATUS_PROVIDER_H_ 38 #endif // COMPONENTS_SIGNIN_CORE_BROWSER_FAKE_AUTH_STATUS_PROVIDER_H_
OLDNEW
« no previous file with comments | « components/signin/core/browser/about_signin_internals.cc ('k') | components/signin/core/browser/fake_auth_status_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698