Fix code style.
authorHaojian Wu <hokein.wu@gmail.com>
Sat, 13 Jun 2015 08:02:16 +0000 (16:02 +0800)
committerHaojian Wu <hokein.wu@gmail.com>
Tue, 16 Jun 2015 12:07:45 +0000 (20:07 +0800)
atom/browser/api/atom_api_web_contents.cc
atom/browser/api/atom_api_web_contents.h
atom/browser/common_web_contents_delegate.cc
atom/browser/native_window.cc
chromium_src/chrome/browser/printing/print_preview_message_handler.cc

index d72e553..959b0e3 100644 (file)
@@ -138,7 +138,6 @@ WebContents::WebContents(const mate::Dictionary& options)
   inspectable_web_contents_ = managed_web_contents();
 
   Observe(GetWebContents());
-  printing::PrintPreviewMessageHandler::CreateForWebContents(web_contents);
 }
 
 WebContents::~WebContents() {
@@ -593,7 +592,7 @@ bool WebContents::IsAudioMuted() {
 }
 
 void WebContents::PrintToPDF(const base::DictionaryValue& setting,
-    const PrintToPDFCallback& callback) {
+                             const PrintToPDFCallback& callback) {
   printing::PrintPreviewMessageHandler::FromWebContents(web_contents())->
       PrintToPDF(setting, callback);
 }
index 891fd0b..bab7c9e 100644 (file)
@@ -96,7 +96,7 @@ class WebContents : public mate::EventEmitter,
 
   // Print current page as PDF.
   void PrintToPDF(const base::DictionaryValue& setting,
-    const PrintToPDFCallback& callback);
+                  const PrintToPDFCallback& callback);
 
   // Editing commands.
   void Undo();
index 087205d..437d4d7 100644 (file)
@@ -12,6 +12,7 @@
 #include "atom/browser/ui/file_dialog.h"
 #include "atom/browser/web_dialog_helper.h"
 #include "base/files/file_util.h"
+#include "chrome/browser/printing/print_preview_message_handler.h"
 #include "chrome/browser/ui/browser_dialogs.h"
 #include "content/public/browser/child_process_security_policy.h"
 #include "content/public/browser/render_process_host.h"
@@ -102,6 +103,8 @@ void CommonWebContentsDelegate::InitWithWebContents(
   owner_window_ = owner_window;
   web_contents->SetDelegate(this);
 
+  printing::PrintPreviewMessageHandler::CreateForWebContents(web_contents);
+
   // Create InspectableWebContents.
   web_contents_.reset(brightray::InspectableWebContents::Create(web_contents));
   web_contents_->SetDelegate(this);
index 581565a..8eb05cb 100644 (file)
@@ -28,8 +28,6 @@
 #include "brightray/browser/inspectable_web_contents.h"
 #include "brightray/browser/inspectable_web_contents_view.h"
 #include "chrome/browser/printing/print_view_manager_basic.h"
-#include "chrome/browser/printing/print_preview_message_handler.h"
-#include "chrome/browser/ui/browser_dialogs.h"
 #include "content/browser/renderer_host/render_widget_host_impl.h"
 #include "content/public/browser/navigation_entry.h"
 #include "content/public/browser/notification_details.h"
@@ -99,7 +97,6 @@ NativeWindow::NativeWindow(content::WebContents* web_contents,
       zoom_factor_(1.0),
       weak_factory_(this) {
   printing::PrintViewManagerBasic::CreateForWebContents(web_contents);
-  printing::PrintPreviewMessageHandler::CreateForWebContents(web_contents);
 
   InitWithWebContents(web_contents, this);
 
index 3971b95..51bfffc 100644 (file)
@@ -4,14 +4,7 @@
 
 #include "chrome/browser/printing/print_preview_message_handler.h"
 
-#include <vector>
-
-#include "atom/browser/ui/file_dialog.h"
-#include "atom/browser/native_window.h"
 #include "base/bind.h"
-#include "base/json/json_reader.h"
-#include "base/memory/ref_counted.h"
-#include "base/memory/ref_counted_memory.h"
 #include "base/memory/shared_memory.h"
 #include "chrome/browser/browser_process.h"
 #include "chrome/browser/printing/print_job_manager.h"
@@ -20,7 +13,6 @@
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/render_view_host.h"
 #include "content/public/browser/web_contents.h"
-#include "content/public/browser/web_ui.h"
 #include "printing/page_size_margins.h"
 #include "printing/print_job_constants.h"
 #include "printing/pdf_metafile_skia.h"