diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-17 00:25:47 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-08-17 00:25:47 +0000 |
commit | 6eae9cf004fba00e78533a12c69f9987cdb0b7c7 (patch) | |
tree | cf6ff07e905adc3f4fed6be43e763876e268e64c /chrome/browser/remoting/remoting_setup_message_handler.h | |
parent | 0cfe5dae9265f8d3be8648e33421c7c76cb31b4e (diff) | |
download | chromium_src-6eae9cf004fba00e78533a12c69f9987cdb0b7c7.zip chromium_src-6eae9cf004fba00e78533a12c69f9987cdb0b7c7.tar.gz chromium_src-6eae9cf004fba00e78533a12c69f9987cdb0b7c7.tar.bz2 |
Setup dialog for remoting
Adding more setup content to remoting. Including the gaia authenication
and done message. This provides the basic flow for the setup.
There's a lot still needs to be worked on:
1. Merge RemotingSetupFlow and RemotingSetupMessageHandler because we shouldn't
splitting the logic into two separate classes.
2. Cleanup the memory ownership.
3. Perform the actual gaia login.
4. Perform host registration.
Review URL: http://codereview.chromium.org/3160016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@56273 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/remoting/remoting_setup_message_handler.h')
-rw-r--r-- | chrome/browser/remoting/remoting_setup_message_handler.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/chrome/browser/remoting/remoting_setup_message_handler.h b/chrome/browser/remoting/remoting_setup_message_handler.h new file mode 100644 index 0000000..b4dcfcb --- /dev/null +++ b/chrome/browser/remoting/remoting_setup_message_handler.h @@ -0,0 +1,44 @@ +// Copyright (c) 2010 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_REMOTING_REMOTING_SETUP_MESSAGE_HANDLER_H_ +#define CHROME_BROWSER_REMOTING_REMOTING_SETUP_MESSAGE_HANDLER_H_ + +#include <string> + +#include "base/values.h" +#include "chrome/browser/dom_ui/html_dialog_ui.h" + +class RemotingSetupFlow; + +// This class is used to handle DOM messages from the setup dialog. +class RemotingSetupMessageHandler : public DOMMessageHandler { + public: + RemotingSetupMessageHandler(RemotingSetupFlow* flow) : flow_(flow) {} + virtual ~RemotingSetupMessageHandler() {} + + // DOMMessageHandler implementation. + virtual void RegisterMessages(); + + // Callbacks from the page. + void HandleSubmitAuth(const Value* value); + + // These functions control which part of the HTML is visible. + // TODO(hclam): I really don't feel right about exposing these as public + // methods. It will be better that we notify RemotingSetupFlow and then get + // a return value for state transition inside this class, or better we merge + // this class into RemotingSetupFlow. + void ShowGaiaSuccessAndSettingUp(); + void ShowGaiaFailed(); + void ShowSetupDone(); + + private: + void ExecuteJavascriptInIFrame(const std::wstring& iframe_xpath, + const std::wstring& js); + RemotingSetupFlow* flow_; + + DISALLOW_COPY_AND_ASSIGN(RemotingSetupMessageHandler); +}; + +#endif // CHROME_BROWSER_REMOTING_REMOTING_SETUP_MESSAGE_HANDLER_H_ |