diff options
author | Kristian Monsen <kristianm@google.com> | 2011-06-28 21:49:31 +0100 |
---|---|---|
committer | Kristian Monsen <kristianm@google.com> | 2011-07-08 17:55:00 +0100 |
commit | ddb351dbec246cf1fab5ec20d2d5520909041de1 (patch) | |
tree | 158e3fb57bdcac07c7f1e767fde3c70687c9fbb1 /chrome/browser/remoting | |
parent | 6b92e04f5f151c896e3088e86f70db7081009308 (diff) | |
download | external_chromium-ddb351dbec246cf1fab5ec20d2d5520909041de1.zip external_chromium-ddb351dbec246cf1fab5ec20d2d5520909041de1.tar.gz external_chromium-ddb351dbec246cf1fab5ec20d2d5520909041de1.tar.bz2 |
Merge Chromium at r12.0.742.93: Initial merge by git
Change-Id: Ic5ee2fec31358bbee305f7e915442377bfa6cda6
Diffstat (limited to 'chrome/browser/remoting')
13 files changed, 36 insertions, 20 deletions
diff --git a/chrome/browser/remoting/directory_add_request.cc b/chrome/browser/remoting/directory_add_request.cc index 691c7a2..9c3d6c6 100644 --- a/chrome/browser/remoting/directory_add_request.cc +++ b/chrome/browser/remoting/directory_add_request.cc @@ -10,8 +10,8 @@ #include "base/json/json_writer.h" #include "base/values.h" #include "chrome/common/net/http_return.h" -#include "chrome/common/net/url_request_context_getter.h" #include "net/http/http_request_headers.h" +#include "net/url_request/url_request_context_getter.h" #include "net/url_request/url_request_status.h" namespace remoting { @@ -19,7 +19,7 @@ namespace remoting { static const char kRemotingDirectoryUrl[] = "https://www.googleapis.com/chromoting/v1/@me/hosts"; -DirectoryAddRequest::DirectoryAddRequest(URLRequestContextGetter* getter) +DirectoryAddRequest::DirectoryAddRequest(net::URLRequestContextGetter* getter) : getter_(getter) { } diff --git a/chrome/browser/remoting/directory_add_request.h b/chrome/browser/remoting/directory_add_request.h index c87cbf2..8bcfaf4 100644 --- a/chrome/browser/remoting/directory_add_request.h +++ b/chrome/browser/remoting/directory_add_request.h @@ -8,7 +8,7 @@ #include <string> #include "base/callback.h" -#include "base/scoped_ptr.h" +#include "base/memory/scoped_ptr.h" #include "chrome/common/remoting/chromoting_host_info.h" #include "chrome/common/net/url_fetcher.h" #include "googleurl/src/gurl.h" @@ -42,7 +42,7 @@ class DirectoryAddRequest : public URLFetcher::Delegate { // to the user. typedef Callback2<Result, const std::string&>::Type DoneCallback; - explicit DirectoryAddRequest(URLRequestContextGetter* getter); + explicit DirectoryAddRequest(net::URLRequestContextGetter* getter); ~DirectoryAddRequest(); // Add this computer as a host. Use the token for @@ -63,7 +63,7 @@ class DirectoryAddRequest : public URLFetcher::Delegate { private: friend class DirectoryAddRequestTest; - URLRequestContextGetter* getter_; + net::URLRequestContextGetter* getter_; scoped_ptr<DoneCallback> done_callback_; scoped_ptr<URLFetcher> fetcher_; diff --git a/chrome/browser/remoting/remoting_options_handler.cc b/chrome/browser/remoting/remoting_options_handler.cc index 9c8b735..39bfc92 100644 --- a/chrome/browser/remoting/remoting_options_handler.cc +++ b/chrome/browser/remoting/remoting_options_handler.cc @@ -6,7 +6,10 @@ #include "base/utf_string_conversions.h" #include "base/values.h" +#include "chrome/browser/prefs/pref_service.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/service/service_process_control_manager.h" +#include "chrome/common/pref_names.h" #include "chrome/common/remoting/chromoting_host_info.h" #include "content/browser/webui/web_ui.h" #include "grit/generated_resources.h" @@ -36,6 +39,8 @@ void RemotingOptionsHandler::Init(WebUI* web_ui) { // Assume that host is not started if we can't request status. SetStatus(false, ""); } + web_ui_->GetProfile()->GetPrefs()->SetBoolean( + prefs::kRemotingHasSetupCompleted, false); } // ServiceProcessControl::MessageHandler interface @@ -56,7 +61,7 @@ void RemotingOptionsHandler::SetStatus( FundamentalValue enabled_value(enabled); StringValue status_value(status); - web_ui_->CallJavascriptFunction(L"options.AdvancedOptions.SetRemotingStatus", + web_ui_->CallJavascriptFunction("options.AdvancedOptions.SetRemotingStatus", enabled_value, status_value); } diff --git a/chrome/browser/remoting/remoting_resources_source.cc b/chrome/browser/remoting/remoting_resources_source.cc index fdf5ba1..0106836 100644 --- a/chrome/browser/remoting/remoting_resources_source.cc +++ b/chrome/browser/remoting/remoting_resources_source.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 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. @@ -23,9 +23,9 @@ // Define the values of standard URLs. const char RemotingResourcesSource::kInvalidPasswordHelpUrl[] = - "http://www.google.com/support/accounts/bin/answer.py?ctx=ch&answer=27444"; + "https://www.google.com/support/accounts/bin/answer.py?ctx=ch&answer=27444"; const char RemotingResourcesSource::kCanNotAccessAccountUrl[] = - "http://www.google.com/support/accounts/bin/answer.py?answer=48598"; + "https://www.google.com/support/accounts/bin/answer.py?answer=48598"; const char RemotingResourcesSource::kCreateNewAccountUrl[] = "https://www.google.com/accounts/NewAccount?service=chromiumsync"; @@ -35,7 +35,8 @@ RemotingResourcesSource::RemotingResourcesSource() } void RemotingResourcesSource::StartDataRequest(const std::string& path_raw, - bool is_off_the_record, int request_id) { + bool is_incognito, + int request_id) { const char kRemotingGaiaLoginPath[] = "gaialogin"; const char kRemotingSetupFlowPath[] = "setup"; const char kRemotingSetupDonePath[] = "setupdone"; diff --git a/chrome/browser/remoting/remoting_resources_source.h b/chrome/browser/remoting/remoting_resources_source.h index 83d8943..0a42bce 100644 --- a/chrome/browser/remoting/remoting_resources_source.h +++ b/chrome/browser/remoting/remoting_resources_source.h @@ -13,7 +13,7 @@ class RemotingResourcesSource : public ChromeURLDataManager::DataSource { public: RemotingResourcesSource(); virtual void StartDataRequest(const std::string& path, - bool is_off_the_record, + bool is_incognito, int request_id); virtual std::string GetMimeType(const std::string& path) const; diff --git a/chrome/browser/remoting/resources/remoting_setup_done.html b/chrome/browser/remoting/resources/remoting_setup_done.html index 6d54e62..494dab0 100644 --- a/chrome/browser/remoting/resources/remoting_setup_done.html +++ b/chrome/browser/remoting/resources/remoting_setup_done.html @@ -18,7 +18,7 @@ <body i18n-values=".style.fontFamily:fontfamily"> <div class="remoting-header" i18n-content="success"></div> <div class="remoting-success-image"> - <img src="../../sync/resources/success-large.png" /> + <img src="../../resources/options/success-large.png" /> </div> <div id="msgContent"></div> <div class="remoting-footer"> diff --git a/chrome/browser/remoting/setup_flow.cc b/chrome/browser/remoting/setup_flow.cc index 74c9540..0309d07 100644 --- a/chrome/browser/remoting/setup_flow.cc +++ b/chrome/browser/remoting/setup_flow.cc @@ -84,7 +84,7 @@ void SetupFlowErrorStepBase::DoStart() { L"setMessage('" + UTF16ToWide(GetErrorMessage()) + L"');"; ExecuteJavascriptInIFrame(kErrorIframeXPath, javascript); - flow()->web_ui()->CallJavascriptFunction(L"showError"); + flow()->web_ui()->CallJavascriptFunction("showError"); ExecuteJavascriptInIFrame(kErrorIframeXPath, L"onPageShown();"); } @@ -110,7 +110,7 @@ void SetupFlowDoneStep::DoStart() { L"setMessage('" + UTF16ToWide(message_) + L"');"; ExecuteJavascriptInIFrame(kDoneIframeXPath, javascript); - flow()->web_ui()->CallJavascriptFunction(L"showSetupDone"); + flow()->web_ui()->CallJavascriptFunction("showSetupDone"); ExecuteJavascriptInIFrame(kDoneIframeXPath, L"onPageShown();"); } diff --git a/chrome/browser/remoting/setup_flow.h b/chrome/browser/remoting/setup_flow.h index 6dd31cc..c952bd6 100644 --- a/chrome/browser/remoting/setup_flow.h +++ b/chrome/browser/remoting/setup_flow.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_REMOTING_SETUP_FLOW_H_ #include "base/callback.h" -#include "base/scoped_ptr.h" +#include "base/memory/scoped_ptr.h" #include "chrome/browser/ui/webui/html_dialog_ui.h" #include "chrome/common/remoting/chromoting_host_info.h" #include "content/browser/webui/web_ui.h" diff --git a/chrome/browser/remoting/setup_flow_get_status_step.cc b/chrome/browser/remoting/setup_flow_get_status_step.cc index 02e47ca..e21965c 100644 --- a/chrome/browser/remoting/setup_flow_get_status_step.cc +++ b/chrome/browser/remoting/setup_flow_get_status_step.cc @@ -41,7 +41,7 @@ void SetupFlowGetStatusStep::OnRemotingHostInfo( } void SetupFlowGetStatusStep::DoStart() { - flow()->web_ui()->CallJavascriptFunction(L"showSettingUp"); + flow()->web_ui()->CallJavascriptFunction("showSettingUp"); process_control_ = ServiceProcessControlManager::GetInstance()->GetProcessControl( diff --git a/chrome/browser/remoting/setup_flow_login_step.cc b/chrome/browser/remoting/setup_flow_login_step.cc index e58c674..d69afe2 100644 --- a/chrome/browser/remoting/setup_flow_login_step.cc +++ b/chrome/browser/remoting/setup_flow_login_step.cc @@ -13,7 +13,6 @@ #include "chrome/browser/remoting/setup_flow_get_status_step.h" #include "chrome/common/net/gaia/gaia_constants.h" #include "chrome/common/net/gaia/google_service_auth_error.h" -#include "content/browser/webui/web_ui_util.h" namespace remoting { @@ -135,7 +134,7 @@ void SetupFlowLoginStep::ShowGaiaLogin(const DictionaryValue& args) { WebUI* web_ui = flow()->web_ui(); DCHECK(web_ui); - web_ui->CallJavascriptFunction(L"showLogin"); + web_ui->CallJavascriptFunction("showLogin"); std::string json; base::JSONWriter::Write(&args, false, &json); diff --git a/chrome/browser/remoting/setup_flow_register_step.cc b/chrome/browser/remoting/setup_flow_register_step.cc index 699e290..7fb02eb 100644 --- a/chrome/browser/remoting/setup_flow_register_step.cc +++ b/chrome/browser/remoting/setup_flow_register_step.cc @@ -4,9 +4,11 @@ #include "chrome/browser/remoting/setup_flow_register_step.h" +#include "chrome/browser/prefs/pref_service.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/remoting/setup_flow_login_step.h" #include "chrome/browser/remoting/setup_flow_start_host_step.h" +#include "chrome/common/pref_names.h" #include "grit/generated_resources.h" #include "ui/base/l10n/l10n_util.h" @@ -25,7 +27,7 @@ void SetupFlowRegisterStep::Cancel() { } void SetupFlowRegisterStep::DoStart() { - flow()->web_ui()->CallJavascriptFunction(L"showSettingUp"); + flow()->web_ui()->CallJavascriptFunction("showSettingUp"); request_.reset(new DirectoryAddRequest( flow()->profile()->GetRequestContext())); @@ -34,13 +36,20 @@ void SetupFlowRegisterStep::DoStart() { NewCallback(this, &SetupFlowRegisterStep::OnRequestDone)); } +void SetupFlowRegisterStep::SetRemotingEnabled() { + flow()->profile()->GetPrefs()->SetBoolean( + prefs::kRemotingHasSetupCompleted, true); +} + void SetupFlowRegisterStep::OnRequestDone(DirectoryAddRequest::Result result, const std::string& error_message) { switch (result) { case DirectoryAddRequest::SUCCESS: + SetRemotingEnabled(); FinishStep(new SetupFlowStartHostStep()); break; case DirectoryAddRequest::ERROR_EXISTS: + SetRemotingEnabled(); LOG(INFO) << "Chromoting host is already registered."; FinishStep(new SetupFlowStartHostStep()); break; diff --git a/chrome/browser/remoting/setup_flow_register_step.h b/chrome/browser/remoting/setup_flow_register_step.h index d8b9fe7..69a6e39 100644 --- a/chrome/browser/remoting/setup_flow_register_step.h +++ b/chrome/browser/remoting/setup_flow_register_step.h @@ -26,6 +26,8 @@ class SetupFlowRegisterStep : public SetupFlowStepBase { protected: virtual void DoStart(); + // This methods is called when are sure remoting is enabled. + void SetRemotingEnabled(); void OnRequestDone(DirectoryAddRequest::Result result, const std::string& error_message); diff --git a/chrome/browser/remoting/setup_flow_start_host_step.cc b/chrome/browser/remoting/setup_flow_start_host_step.cc index 8c53c2e..0152138 100644 --- a/chrome/browser/remoting/setup_flow_start_host_step.cc +++ b/chrome/browser/remoting/setup_flow_start_host_step.cc @@ -44,7 +44,7 @@ void SetupFlowStartHostStep::OnRemotingHostInfo( } void SetupFlowStartHostStep::DoStart() { - flow()->web_ui()->CallJavascriptFunction(L"showSettingUp"); + flow()->web_ui()->CallJavascriptFunction("showSettingUp"); process_control_ = ServiceProcessControlManager::GetInstance()->GetProcessControl( |