diff options
author | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-14 00:38:12 +0000 |
---|---|---|
committer | maruel@chromium.org <maruel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-14 00:38:12 +0000 |
commit | 73852b8f9c03c6b7a27436f828ed888f71232257 (patch) | |
tree | da07fd53317f13964f93383f9591fcdfdfa61ea7 /chrome/browser/renderer_host | |
parent | 564551a2ece790b22fd2a70aeb8591805fe943be (diff) | |
download | chromium_src-73852b8f9c03c6b7a27436f828ed888f71232257.zip chromium_src-73852b8f9c03c6b7a27436f828ed888f71232257.tar.gz chromium_src-73852b8f9c03c6b7a27436f828ed888f71232257.tar.bz2 |
[Large; Chromium OS] Work to host the cloud print dialog when built
for Chromium OS. Currently disabled by default behind a command line
switch, and containing a non-real URL for now, this code is at
prototype level. It works (when enabled and pointed at a functioning
cloud print service URL), has the beginnings of some unit tests, and
has the beginnings of deeper communication with the dialog contents,
and it shuts off the DOM UI access from the dialog contents.
Patch contributed by Scott Byer
Review URL: http://codereview.chromium.org/1769006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47228 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host')
3 files changed, 10 insertions, 1 deletions
diff --git a/chrome/browser/renderer_host/resource_message_filter.cc b/chrome/browser/renderer_host/resource_message_filter.cc index f27ee9b..6cb3362 100644 --- a/chrome/browser/renderer_host/resource_message_filter.cc +++ b/chrome/browser/renderer_host/resource_message_filter.cc @@ -329,6 +329,8 @@ ResourceMessageFilter::ResourceMessageFilter( DCHECK(dom_storage_dispatcher_host_.get()); render_widget_helper_->Init(id(), resource_dispatcher_host_); + cloud_print_enabled_ = CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableCloudPrint); } ResourceMessageFilter::~ResourceMessageFilter() { diff --git a/chrome/browser/renderer_host/resource_message_filter.h b/chrome/browser/renderer_host/resource_message_filter.h index 5eef048..88642cd 100644 --- a/chrome/browser/renderer_host/resource_message_filter.h +++ b/chrome/browser/renderer_host/resource_message_filter.h @@ -416,6 +416,8 @@ class ResourceMessageFilter : public IPC::ChannelProxy::MessageFilter, // Whether this process is used for off the record tabs. bool off_the_record_; + bool cloud_print_enabled_; + // A callback to create a routing id for the associated renderer process. scoped_ptr<CallbackWithReturnValue<int>::Type> next_route_id_callback_; diff --git a/chrome/browser/renderer_host/resource_message_filter_gtk.cc b/chrome/browser/renderer_host/resource_message_filter_gtk.cc index 3a64462..c4b6530 100644 --- a/chrome/browser/renderer_host/resource_message_filter_gtk.cc +++ b/chrome/browser/renderer_host/resource_message_filter_gtk.cc @@ -16,6 +16,8 @@ #include "chrome/browser/chrome_thread.h" #if defined(TOOLKIT_GTK) #include "chrome/browser/printing/print_dialog_gtk.h" +#else +#include "chrome/browser/printing/print_dialog_cloud.h" #endif #include "chrome/common/chrome_paths.h" #include "chrome/common/render_messages.h" @@ -308,7 +310,10 @@ void ResourceMessageFilter::OnTempFileForPrintingWritten(int fd_in_browser) { #if defined(TOOLKIT_GTK) PrintDialogGtk::CreatePrintDialogForPdf(it->second); #else - NOTIMPLEMENTED(); + if (cloud_print_enabled_) + PrintDialogCloud::CreatePrintDialogForPdf(it->second); + else + NOTIMPLEMENTED(); #endif // Erase the entry in the map. |