diff options
author | Kristian Monsen <kristianm@google.com> | 2011-05-11 20:53:37 +0100 |
---|---|---|
committer | Kristian Monsen <kristianm@google.com> | 2011-05-16 13:54:48 +0100 |
commit | 21d179b334e59e9a3bfcaed4c4430bef1bc5759d (patch) | |
tree | 64e2bb6da27af6a5c93ca34f6051584aafbfcb9e /chrome/browser/printing/cloud_print | |
parent | 0c63f00edd6ed0482fd5cbcea937ca088baf7858 (diff) | |
download | external_chromium-21d179b334e59e9a3bfcaed4c4430bef1bc5759d.zip external_chromium-21d179b334e59e9a3bfcaed4c4430bef1bc5759d.tar.gz external_chromium-21d179b334e59e9a3bfcaed4c4430bef1bc5759d.tar.bz2 |
Merge Chromium at 10.0.621.0: Initial merge by git.
Change-Id: I070cc91c608dfa4a968a5a54c173260765ac8097
Diffstat (limited to 'chrome/browser/printing/cloud_print')
6 files changed, 26 insertions, 17 deletions
diff --git a/chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc b/chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc index c27b1a3..cafad5a 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc +++ b/chrome/browser/printing/cloud_print/cloud_print_proxy_service.cc @@ -11,11 +11,12 @@ #include "base/utf_string_conversions.h" #include "chrome/browser/browser_list.h" #include "chrome/browser/browser_process.h" +#include "chrome/browser/browser_thread.h" #include "chrome/browser/notifications/desktop_notification_service.h" #include "chrome/browser/notifications/notification.h" #include "chrome/browser/notifications/notification_ui_manager.h" #include "chrome/browser/prefs/pref_service.h" -#include "chrome/browser/profile.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/service/service_process_control.h" #include "chrome/browser/service/service_process_control_manager.h" #include "chrome/common/pref_names.h" @@ -140,7 +141,7 @@ void CloudPrintProxyService::OnDialogClosed() { void CloudPrintProxyService::RefreshCloudPrintProxyStatus() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); ServiceProcessControl* process_control = - ServiceProcessControlManager::instance()->GetProcessControl(profile_); + ServiceProcessControlManager::GetInstance()->GetProcessControl(profile_); DCHECK(process_control->is_connected()); Callback2<bool, std::string>::Type* callback = NewCallback(this, &CloudPrintProxyService::StatusCallback); @@ -151,7 +152,7 @@ void CloudPrintProxyService::RefreshCloudPrintProxyStatus() { void CloudPrintProxyService::EnableCloudPrintProxy(const std::string& lsid, const std::string& email) { ServiceProcessControl* process_control = - ServiceProcessControlManager::instance()->GetProcessControl(profile_); + ServiceProcessControlManager::GetInstance()->GetProcessControl(profile_); DCHECK(process_control->is_connected()); process_control->Send(new ServiceMsg_EnableCloudPrintProxy(lsid)); // Assume the IPC worked. @@ -160,7 +161,7 @@ void CloudPrintProxyService::EnableCloudPrintProxy(const std::string& lsid, void CloudPrintProxyService::DisableCloudPrintProxy() { ServiceProcessControl* process_control = - ServiceProcessControlManager::instance()->GetProcessControl(profile_); + ServiceProcessControlManager::GetInstance()->GetProcessControl(profile_); DCHECK(process_control->is_connected()); process_control->Send(new ServiceMsg_DisableCloudPrintProxy); // Assume the IPC worked. @@ -174,7 +175,7 @@ void CloudPrintProxyService::StatusCallback(bool enabled, std::string email) { bool CloudPrintProxyService::InvokeServiceTask(Task* task) { ServiceProcessControl* process_control = - ServiceProcessControlManager::instance()->GetProcessControl(profile_); + ServiceProcessControlManager::GetInstance()->GetProcessControl(profile_); DCHECK(process_control); if (process_control) process_control->Launch(task, NULL); diff --git a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc index 79e32f4..fddff26 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc +++ b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.cc @@ -11,6 +11,7 @@ #include "base/utf_string_conversions.h" #include "base/values.h" #include "chrome/browser/browser_list.h" +#include "chrome/browser/browser_thread.h" #include "chrome/browser/dom_ui/chrome_url_data_manager.h" #include "chrome/browser/dom_ui/dom_ui_util.h" #if defined(TOOLKIT_GTK) @@ -22,7 +23,7 @@ #include "chrome/browser/printing/cloud_print/cloud_print_setup_message_handler.h" #include "chrome/browser/printing/cloud_print/cloud_print_setup_source.h" #include "chrome/browser/printing/cloud_print/cloud_print_url.h" -#include "chrome/browser/profile.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/browser/renderer_host/render_view_host.h" #include "chrome/browser/service/service_process_control.h" #include "chrome/browser/service/service_process_control_manager.h" @@ -101,7 +102,7 @@ CloudPrintSetupFlow::CloudPrintSetupFlow(const std::string& args, profile_ = profile; BrowserThread::PostTask( BrowserThread::IO, FROM_HERE, - NewRunnableMethod(Singleton<ChromeURLDataManager>::get(), + NewRunnableMethod(ChromeURLDataManager::GetInstance(), &ChromeURLDataManager::AddDataSource, make_scoped_refptr(new CloudPrintSetupSource()))); } @@ -164,19 +165,23 @@ std::string CloudPrintSetupFlow::GetDialogArgs() const { return dialog_start_args_; } -void CloudPrintSetupFlow::OnCloseContents(TabContents* source, - bool* out_close_dialog) { +void CloudPrintSetupFlow::OnCloseContents(TabContents* source, + bool* out_close_dialog) { } -std::wstring CloudPrintSetupFlow::GetDialogTitle() const { +std::wstring CloudPrintSetupFlow::GetDialogTitle() const { return l10n_util::GetString(IDS_CLOUD_PRINT_SETUP_DIALOG_TITLE); } -bool CloudPrintSetupFlow::IsDialogModal() const { +bool CloudPrintSetupFlow::IsDialogModal() const { // We are always modeless. return false; } +bool CloudPrintSetupFlow::ShouldShowDialogTitle() const { + return true; +} + /////////////////////////////////////////////////////////////////////////////// // GaiaAuthConsumer implementation. void CloudPrintSetupFlow::OnClientLoginFailure( diff --git a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.h b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.h index 14354e3..86077ab 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_setup_flow.h +++ b/chrome/browser/printing/cloud_print/cloud_print_setup_flow.h @@ -70,7 +70,7 @@ class CloudPrintSetupFlow : public HtmlDialogUIDelegate, virtual void OnCloseContents(TabContents* source, bool* out_close_dialog); virtual std::wstring GetDialogTitle() const; virtual bool IsDialogModal() const; - virtual bool ShouldShowDialogTitle() const { return true; } + virtual bool ShouldShowDialogTitle() const; // GaiaAuthConsumer implementation. virtual void OnClientLoginFailure( diff --git a/chrome/browser/printing/cloud_print/cloud_print_setup_source.cc b/chrome/browser/printing/cloud_print/cloud_print_setup_source.cc index 62a9a3f..972f088 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_setup_source.cc +++ b/chrome/browser/printing/cloud_print/cloud_print_setup_source.cc @@ -4,12 +4,13 @@ #include "chrome/browser/printing/cloud_print/cloud_print_setup_source.h" +#include <algorithm> + #include "app/l10n_util.h" #include "app/resource_bundle.h" #include "base/message_loop.h" #include "base/utf_string_conversions.h" #include "base/values.h" -#include "chrome/browser/browser_thread.h" #include "chrome/browser/google/google_util.h" #include "chrome/common/pref_names.h" #include "chrome/common/jstemplate_builder.h" @@ -125,6 +126,10 @@ void CloudPrintSetupSource::StartDataRequest(const std::string& path_raw, SendResponse(request_id, html_bytes); } +std::string CloudPrintSetupSource::GetMimeType(const std::string& path) const { + return "text/html"; +} + std::string CloudPrintSetupSource::GetLocalizedUrl( const std::string& url) const { GURL original_url(url); diff --git a/chrome/browser/printing/cloud_print/cloud_print_setup_source.h b/chrome/browser/printing/cloud_print/cloud_print_setup_source.h index 3fa3048..7050c5e 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_setup_source.h +++ b/chrome/browser/printing/cloud_print/cloud_print_setup_source.h @@ -18,9 +18,7 @@ class CloudPrintSetupSource : public ChromeURLDataManager::DataSource { bool is_off_the_record, int request_id); - virtual std::string GetMimeType(const std::string& path) const { - return "text/html"; - } + virtual std::string GetMimeType(const std::string& path) const; static const char kInvalidPasswordHelpUrl[]; static const char kCanNotAccessAccountUrl[]; diff --git a/chrome/browser/printing/cloud_print/cloud_print_url.cc b/chrome/browser/printing/cloud_print/cloud_print_url.cc index 1001f5f..236c03d 100644 --- a/chrome/browser/printing/cloud_print/cloud_print_url.cc +++ b/chrome/browser/printing/cloud_print/cloud_print_url.cc @@ -7,7 +7,7 @@ #include "base/command_line.h" #include "base/logging.h" #include "chrome/browser/prefs/pref_service.h" -#include "chrome/browser/profile.h" +#include "chrome/browser/profiles/profile.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/pref_names.h" #include "googleurl/src/gurl.h" |