Chromium Code Reviews| OLD | NEW |
|---|---|
| (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 #ifndef CHROME_TEST_TESTING_DEVICE_TOKEN_FETCHER_H_ | |
| 6 #define CHROME_TEST_TESTING_DEVICE_TOKEN_FETCHER_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include <string> | |
| 10 | |
| 11 #include "chrome/browser/policy/device_token_fetcher.h" | |
| 12 | |
| 13 class DeviceTokenService; | |
| 14 class Profile; | |
| 15 | |
| 16 namespace policy { | |
| 17 | |
| 18 extern const char* kTestDasherDomainUsername; | |
| 19 | |
| 20 // Replacement for DeviceTokenFetcher in tests. The only difference in internal | |
| 21 // logic is that the name of the currently logged in user is not fetched from | |
| 22 // external objects, but stored internally. | |
| 23 class TestingDeviceTokenFetcher | |
| 24 : public DeviceTokenFetcher { | |
| 25 public: | |
| 26 TestingDeviceTokenFetcher( | |
| 27 DeviceManagementBackend* backend, | |
| 28 Profile* profile, | |
| 29 const FilePath& token_path) : | |
| 30 DeviceTokenFetcher(backend, profile, token_path) {} | |
| 31 virtual void SimulateLogin(const std::string& username); | |
|
Mattias Nissler (ping if slow)
2010/11/22 20:36:08
Why is this virtual?
gfeher
2010/11/23 13:47:51
Memories of Java...
| |
| 32 | |
| 33 protected: | |
| 34 virtual std::string GetCurrentUser() { | |
| 35 return username_; | |
| 36 } | |
| 37 | |
| 38 private: | |
| 39 // This username will be reported as currently logged in. | |
| 40 std::string username_; | |
| 41 | |
| 42 DISALLOW_COPY_AND_ASSIGN(TestingDeviceTokenFetcher); | |
| 43 }; | |
| 44 | |
| 45 } // namespace policy | |
| 46 | |
| 47 #endif // CHROME_TEST_TESTING_DEVICE_TOKEN_FETCHER_H_ | |
| OLD | NEW |