summaryrefslogtreecommitdiffstats
path: root/chrome/browser/remoting
diff options
context:
space:
mode:
authorsergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-10 20:43:36 +0000
committersergeyu@chromium.org <sergeyu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-10 20:43:36 +0000
commitd00120bddc50d4a4499623b8727119c48122ad7f (patch)
treeb493bcec0c67280caa1115ef22661128b4d8619a /chrome/browser/remoting
parent738eea90c25f553df072450ad973929affe4da42 (diff)
downloadchromium_src-d00120bddc50d4a4499623b8727119c48122ad7f.zip
chromium_src-d00120bddc50d4a4499623b8727119c48122ad7f.tar.gz
chromium_src-d00120bddc50d4a4499623b8727119c48122ad7f.tar.bz2
Add SettingUp page in the Remoting Host setup wizard
BUG=67218 TEST=None Review URL: http://codereview.chromium.org/6094013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70935 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/remoting')
-rw-r--r--chrome/browser/remoting/remoting_resources_source.cc12
-rw-r--r--chrome/browser/remoting/resources/remoting_setting_up.html49
-rw-r--r--chrome/browser/remoting/resources/remoting_setup_flow.css2
-rw-r--r--chrome/browser/remoting/resources/remoting_setup_flow.html38
-rw-r--r--chrome/browser/remoting/setup_flow_get_status_step.cc2
-rw-r--r--chrome/browser/remoting/setup_flow_register_step.cc4
-rw-r--r--chrome/browser/remoting/setup_flow_start_host_step.cc2
7 files changed, 98 insertions, 11 deletions
diff --git a/chrome/browser/remoting/remoting_resources_source.cc b/chrome/browser/remoting/remoting_resources_source.cc
index 656763c..776db3e 100644
--- a/chrome/browser/remoting/remoting_resources_source.cc
+++ b/chrome/browser/remoting/remoting_resources_source.cc
@@ -39,6 +39,7 @@ void RemotingResourcesSource::StartDataRequest(const std::string& path_raw,
const char kRemotingGaiaLoginPath[] = "gaialogin";
const char kRemotingSetupFlowPath[] = "setup";
const char kRemotingSetupDonePath[] = "setupdone";
+ const char kRemotingSettingUpPath[] = "settingup";
const char kRemotingSetupErrorPath[] = "setuperror";
std::string response;
@@ -91,6 +92,17 @@ void RemotingResourcesSource::StartDataRequest(const std::string& path_raw,
SetFontAndTextDirection(&localized_strings);
response = jstemplate_builder::GetI18nTemplateHtml(
html, &localized_strings);
+ } else if (path_raw == kRemotingSettingUpPath) {
+ DictionaryValue localized_strings;
+ localized_strings.SetString("settingup",
+ l10n_util::GetStringUTF16(IDS_REMOTING_SETTING_UP_MESSAGE));
+ localized_strings.SetString("cancel",
+ l10n_util::GetStringUTF16(IDS_CANCEL));
+ static const base::StringPiece html(ResourceBundle::GetSharedInstance()
+ .GetRawDataResource(IDR_REMOTING_SETTING_UP_HTML));
+ SetFontAndTextDirection(&localized_strings);
+ response = jstemplate_builder::GetI18nTemplateHtml(
+ html, &localized_strings);
} else if (path_raw == kRemotingSetupDonePath) {
DictionaryValue localized_strings;
localized_strings.SetString("success",
diff --git a/chrome/browser/remoting/resources/remoting_setting_up.html b/chrome/browser/remoting/resources/remoting_setting_up.html
new file mode 100644
index 0000000..25c594e
--- /dev/null
+++ b/chrome/browser/remoting/resources/remoting_setting_up.html
@@ -0,0 +1,49 @@
+<html i18n-values="dir:textdirection;">
+<head>
+<title></title>
+<link rel="stylesheet" type="text/css" href="remoting_setup_flow.css" />
+<style type="text/css">
+#throb {
+ background-image: url("../../../../app/resources/throbber.png");
+ width: 16px;
+ height: 16px;
+ background-position: 0px;
+ margin: -3px 10px;
+ display: inline-block;
+}
+#setting_up {
+ margin: 100px;
+ text-align: center;
+}
+#setting_up_label {
+ margin: 15px;
+ font-weight: bold;
+ font-size: 125%;
+}
+</style>
+<script src="chrome://resources/js/cr.js"></script>
+<script>
+ function advanceThrobber() {
+ var throbber = document.getElementById('throb');
+ throbber.style.backgroundPositionX =
+ ((parseInt(getComputedStyle(throbber).backgroundPositionX) - 16) %
+ 576) + 'px';
+ }
+ setInterval(advanceThrobber, 30);
+</script>
+</head>
+<body i18n-values=".style.fontFamily:fontfamily">
+<form id="settingUpForm" onSubmit="return false;">
+ <div id="setting_up">
+ <span id="throbber_container">
+ <span id="throb"></span>
+ </span>
+ <div id="setting_up_label" i18n-content="settingup"></div>
+ </div>
+ <div class="remoting-footer">
+ <input id="cancelButton" type="button" i18n-values="value:cancel"
+ onclick='chrome.send("DialogClose", [""])' />
+ </div>
+</form>
+</body>
+</html>
diff --git a/chrome/browser/remoting/resources/remoting_setup_flow.css b/chrome/browser/remoting/resources/remoting_setup_flow.css
index 37094f0..467322e 100644
--- a/chrome/browser/remoting/resources/remoting_setup_flow.css
+++ b/chrome/browser/remoting/resources/remoting_setup_flow.css
@@ -29,10 +29,12 @@ html[dir='rtl'] .remoting-footer {
bottom: 0px;
margin-left: 20px;
}
+input[type='button'],
input[type='submit'] {
min-width: 87px;
min-height: 26px;
}
+html[os='mac'] input[type='button'],
html[os='mac'] input[type='submit'] {
font-size: 12pt;
}
diff --git a/chrome/browser/remoting/resources/remoting_setup_flow.html b/chrome/browser/remoting/resources/remoting_setup_flow.html
index 13affed..97544b9 100644
--- a/chrome/browser/remoting/resources/remoting_setup_flow.html
+++ b/chrome/browser/remoting/resources/remoting_setup_flow.html
@@ -1,6 +1,19 @@
<html id='t'>
<head>
<title></title>
+<style type="text/css">
+body {
+ margin:0;
+ border:0;
+}
+.setup-flow-page {
+ display: none;
+ width: 100%;
+ height: 100%;
+ overflow: hidden;
+ border: 0;
+}
+</style>
<script type="text/javascript">
// Called once, when this html/js is loaded.
function showTheRightIframe() {
@@ -13,6 +26,8 @@
function hideAllPages() {
document.getElementById('login').style.display = 'none';
document.getElementById('login').tabIndex = -1;
+ document.getElementById('settingup').style.display = 'none';
+ document.getElementById('settingup').tabIndex = -1;
document.getElementById('done').style.display = 'none';
document.getElementById('done').tabIndex = -1;
document.getElementById('error').style.display = 'none';
@@ -29,6 +44,10 @@
showPage('login')
}
+ function showSettingUp() {
+ showPage('settingup')
+ }
+
function showSetupDone() {
showPage('done')
}
@@ -38,15 +57,14 @@
}
</script>
</head>
-<body style="margin:0; border:0;" onload="showTheRightIframe();">
- <iframe id="login" frameborder="0" width="100%" scrolling="no" height="100%"
- src="chrome://remotingresources/gaialogin" style="display:none"
- tabindex="-1"></iframe>
- <iframe id="done" frameborder="0" width="100%" scrolling="no" height="100%"
- src="chrome://remotingresources/setupdone" style="display:none"
- tabindex="-1"></iframe>
- <iframe id="error" frameborder="0" width="100%" scrolling="no" height="100%"
- src="chrome://remotingresources/setuperror" style="display:none"
- tabindex="-1"></iframe>
+<body onload="showTheRightIframe();">
+ <iframe id="login" class="setup-flow-page" tabindex="-1"
+ src="chrome://remotingresources/gaialogin"></iframe>
+ <iframe id="settingup" class="setup-flow-page" tabindex="-1"
+ src="chrome://remotingresources/settingup"></iframe>
+ <iframe id="done" class="setup-flow-page" tabindex="-1"
+ src="chrome://remotingresources/setupdone"></iframe>
+ <iframe id="error" class="setup-flow-page" tabindex="-1"
+ src="chrome://remotingresources/setuperror"></iframe>
</body>
</html>
diff --git a/chrome/browser/remoting/setup_flow_get_status_step.cc b/chrome/browser/remoting/setup_flow_get_status_step.cc
index 1f03bb9..57c7b60 100644
--- a/chrome/browser/remoting/setup_flow_get_status_step.cc
+++ b/chrome/browser/remoting/setup_flow_get_status_step.cc
@@ -41,6 +41,8 @@ void SetupFlowGetStatusStep::OnRemotingHostInfo(
}
void SetupFlowGetStatusStep::DoStart() {
+ flow()->dom_ui()->CallJavascriptFunction(L"showSettingUp");
+
process_control_ =
ServiceProcessControlManager::GetInstance()->GetProcessControl(
flow()->profile());
diff --git a/chrome/browser/remoting/setup_flow_register_step.cc b/chrome/browser/remoting/setup_flow_register_step.cc
index 95799b5..3adcad2 100644
--- a/chrome/browser/remoting/setup_flow_register_step.cc
+++ b/chrome/browser/remoting/setup_flow_register_step.cc
@@ -20,11 +20,13 @@ void SetupFlowRegisterStep::HandleMessage(const std::string& message,
}
void SetupFlowRegisterStep::Cancel() {
- // Don't need to do anything here. Ther request will canceled when
+ // Don't need to do anything here. The request will be canceled when
// |request_| is destroyed.
}
void SetupFlowRegisterStep::DoStart() {
+ flow()->dom_ui()->CallJavascriptFunction(L"showSettingUp");
+
request_.reset(new DirectoryAddRequest(
flow()->profile()->GetRequestContext()));
request_->AddHost(flow()->context()->host_info,
diff --git a/chrome/browser/remoting/setup_flow_start_host_step.cc b/chrome/browser/remoting/setup_flow_start_host_step.cc
index 19094de..0a11bb2 100644
--- a/chrome/browser/remoting/setup_flow_start_host_step.cc
+++ b/chrome/browser/remoting/setup_flow_start_host_step.cc
@@ -44,6 +44,8 @@ void SetupFlowStartHostStep::OnRemotingHostInfo(
}
void SetupFlowStartHostStep::DoStart() {
+ flow()->dom_ui()->CallJavascriptFunction(L"showSettingUp");
+
process_control_ =
ServiceProcessControlManager::GetInstance()->GetProcessControl(
flow()->profile());