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

Side by Side Diff: chrome/browser/chromeos/login/signed_settings_helper.h

Issue 10824112: Move Chrome OS device settings stuff to chrome/browser/chromeos/settings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 8 years, 4 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 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_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_HELPER_H_
6 #define CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_HELPER_H_
7
8 #include "chrome/browser/chromeos/login/signed_settings.h"
9
10 namespace enterprise_management {
11 class PolicyFetchResponse;
12 } // namespace enterprise_management
13
14 namespace chromeos {
15
16 // Helper to serialize signed settings ops, provide unified callback interface,
17 // and handle callbacks destruction before ops completion.
18 class SignedSettingsHelper {
19 public:
20 typedef base::Callback<void(SignedSettings::ReturnCode)> StorePolicyCallback;
21 typedef
22 base::Callback<void(SignedSettings::ReturnCode,
23 const enterprise_management::PolicyFetchResponse&)>
24 RetrievePolicyCallback;
25
26 // Class factory
27 static SignedSettingsHelper* Get();
28
29 // Functions to start signed settings ops.
30 virtual void StartStorePolicyOp(
31 const enterprise_management::PolicyFetchResponse& policy,
32 StorePolicyCallback callback) = 0;
33 virtual void StartRetrievePolicyOp(
34 RetrievePolicyCallback callback) = 0;
35
36 class TestDelegate {
37 public:
38 virtual void OnOpCreated(SignedSettings* op) = 0;
39 virtual void OnOpStarted(SignedSettings* op) = 0;
40 virtual void OnOpCompleted(SignedSettings* op) = 0;
41 };
42
43 #if defined(UNIT_TEST)
44 void set_test_delegate(TestDelegate* test_delegate) {
45 test_delegate_ = test_delegate;
46 }
47 #endif // defined(UNIT_TEST)
48
49 protected:
50 SignedSettingsHelper() : test_delegate_(NULL) {
51 }
52
53 TestDelegate* test_delegate_;
54 };
55
56 } // namespace chromeos
57
58 #endif // CHROME_BROWSER_CHROMEOS_LOGIN_SIGNED_SETTINGS_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698