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 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGED_USER_PASSPHRASE_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGED_USER_PASSPHRASE_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGED_USER_PASSPHRASE_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGED_USER_PASSPHRASE_HANDLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 ManagedUserPassphraseHandler(); | 21 ManagedUserPassphraseHandler(); |
22 virtual ~ManagedUserPassphraseHandler(); | 22 virtual ~ManagedUserPassphraseHandler(); |
23 | 23 |
24 // OptionsPageUIHandler implementation. | 24 // OptionsPageUIHandler implementation. |
25 virtual void InitializeHandler() OVERRIDE; | 25 virtual void InitializeHandler() OVERRIDE; |
26 virtual void RegisterMessages() OVERRIDE; | 26 virtual void RegisterMessages() OVERRIDE; |
27 virtual void GetLocalizedValues( | 27 virtual void GetLocalizedValues( |
28 base::DictionaryValue* localized_strings) OVERRIDE; | 28 base::DictionaryValue* localized_strings) OVERRIDE; |
29 | 29 |
30 private: | 30 private: |
31 // This function is used to set the passphrase of the manager of the managed | 31 // Sets the passphrase of the manager of the managed account. The |
32 // account. The passphrase is expected as the parameter and is passed in from | 32 // passphrase is expected as the parameter and is passed in from the UI. |
33 // the UI. | |
34 void SetLocalPassphrase(const base::ListValue* args); | 33 void SetLocalPassphrase(const base::ListValue* args); |
35 | 34 |
| 35 // Displays the passphrase dialog where the manager of the managed account |
| 36 // can enter the passphrase which allows him to modify the settings. It |
| 37 // expects as parameter the name of the Javascript function which should be |
| 38 // called after the passphrase has been checked. |
| 39 void DisplayPassphraseDialog(const base::ListValue* args); |
| 40 |
| 41 // Calls the UI with the result of the authentication. |success| is true if |
| 42 // the authentication was successful. |
| 43 void PassphraseDialogCallback(bool success); |
| 44 |
| 45 // Resets the authentication state of the manager of the managed account. |
| 46 void EndAuthentication(const base::ListValue* args); |
| 47 |
| 48 // Checks if there is already a passphrase specified. It expects as parameter |
| 49 // the name of the Javascript function which should be called with the results |
| 50 // of this check. |
| 51 void IsPassphraseSet(const base::ListValue* args); |
| 52 |
| 53 // Resets the passphrase to the empty string. |
| 54 void ResetPassphrase(const base::ListValue* args); |
| 55 |
| 56 // The name of the Javascript function which should be called after the |
| 57 // passphrase has been checked. |
| 58 std::string callback_function_name_; |
36 base::WeakPtrFactory<ManagedUserPassphraseHandler> weak_ptr_factory_; | 59 base::WeakPtrFactory<ManagedUserPassphraseHandler> weak_ptr_factory_; |
37 | 60 |
38 DISALLOW_COPY_AND_ASSIGN(ManagedUserPassphraseHandler); | 61 DISALLOW_COPY_AND_ASSIGN(ManagedUserPassphraseHandler); |
39 }; | 62 }; |
40 | 63 |
41 } // namespace options | 64 } // namespace options |
42 | 65 |
43 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGED_USER_PASSPHRASE_HANDLER_H_ | 66 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_MANAGED_USER_PASSPHRASE_HANDLER_H_ |
OLD | NEW |