| Index: chrome/browser/ui/webui/chromeos/cryptohome_web_ui_handler.h
|
| diff --git a/chrome/browser/ui/webui/chromeos/cryptohome_web_ui_handler.h b/chrome/browser/ui/webui/chromeos/cryptohome_web_ui_handler.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..ab230346a60a37b28a53fbd105dc80f7f53f2984
|
| --- /dev/null
|
| +++ b/chrome/browser/ui/webui/chromeos/cryptohome_web_ui_handler.h
|
| @@ -0,0 +1,54 @@
|
| +// Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_CRYPTOHOME_WEB_UI_HANDLER_H_
|
| +#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_CRYPTOHOME_WEB_UI_HANDLER_H_
|
| +
|
| +#include <string>
|
| +
|
| +#include "base/basictypes.h"
|
| +#include "base/memory/weak_ptr.h"
|
| +#include "chromeos/dbus/cryptohome_client.h"
|
| +#include "content/public/browser/web_ui_message_handler.h"
|
| +
|
| +namespace chromeos {
|
| +
|
| +// Class to handle messages from chrome://cryptohome.
|
| +class CryptohomeWebUIHandler : public content::WebUIMessageHandler {
|
| + public:
|
| + CryptohomeWebUIHandler();
|
| +
|
| + virtual ~CryptohomeWebUIHandler();
|
| +
|
| + // WebUIMessageHandler override.
|
| + virtual void RegisterMessages() OVERRIDE;
|
| +
|
| + private:
|
| + // This method is called from JavaScript.
|
| + void OnRequestCryptohomeProperty(const base::ListValue* args);
|
| +
|
| + // Returns a callback to handle Cryptohome property values.
|
| + CryptohomeClient::BoolMethodCallback GetCryptohomeBoolCallback(
|
| + const std::string& destination_id);
|
| +
|
| + // This method is called when Cryptohome D-Bus method call completes.
|
| + void OnCryptohomeBoolProperty(const std::string& destination_id,
|
| + DBusMethodCallStatus call_status,
|
| + bool value);
|
| +
|
| + // Sets textcontent of the element whose id is |destination_id| to true/false.
|
| + void SetCryptohomeBoolProperty(const std::string& destination_id,
|
| + bool value);
|
| +
|
| + // Sets textcontent of the element whose id is |destination_id| to |value|.
|
| + void SetCryptohomeStringProperty(const std::string& destination_id,
|
| + const std::string& value);
|
| +
|
| + base::WeakPtrFactory<CryptohomeWebUIHandler> weak_ptr_factory_;
|
| + DISALLOW_COPY_AND_ASSIGN(CryptohomeWebUIHandler);
|
| +};
|
| +
|
| +} // namespace chromeos
|
| +
|
| +#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_CRYPTOHOME_WEB_UI_HANDLER_H_
|
|
|