diff options
9 files changed, 102 insertions, 11 deletions
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 9d3be1d..bf992dd 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -8392,6 +8392,9 @@ Keep your key file in a safe place. You will need it to create new versions of y <message name="IDS_REMOTING_SETUP_DIALOG_TITLE" desc="Title of the remoting setup dialog."> Set up remoting </message> + <message name="IDS_REMOTING_SETTING_UP_MESSAGE" desc="Message shown while remoting host is being started"> + Setting up remote access to this computer. + </message> <message name="IDS_REMOTING_SUCCESS_TITLE" desc="Header of the page that is shown when remoting configuration is finished."> Success! </message> diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd index 3d03dbf..e3bc1e4 100644 --- a/chrome/browser/browser_resources.grd +++ b/chrome/browser/browser_resources.grd @@ -70,6 +70,7 @@ without changes to the corresponding grd file. etaa --> <include name="IDR_REMOTING_SETUP_FLOW_HTML" file="remoting\resources\remoting_setup_flow.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_REMOTING_SETUP_DONE_HTML" file="remoting\resources\remoting_setup_done.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_REMOTING_SETUP_ERROR_HTML" file="remoting\resources\remoting_setup_error.html" flattenhtml="true" type="BINDATA" /> + <include name="IDR_REMOTING_SETTING_UP_HTML" file="remoting\resources\remoting_setting_up.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_CLOUD_PRINT_SETUP_FLOW_HTML" file="printing\cloud_print\resources\cloud_print_setup_flow.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_CLOUD_PRINT_SETUP_LOGIN_HTML" file="printing\cloud_print\resources\cloud_print_setup_login.html" flattenhtml="true" type="BINDATA" /> <include name="IDR_CLOUD_PRINT_SETUP_DONE_HTML" file="printing\cloud_print\resources\cloud_print_setup_done.html" flattenhtml="true" type="BINDATA" /> 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()); |