| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/printing/print_dialog_gtk.h" | 5 #include "chrome/browser/printing/print_dialog_gtk.h" |
| 6 | 6 |
| 7 #include <gtk/gtkprintjob.h> | 7 #include <gtk/gtkprintjob.h> |
| 8 #include <gtk/gtkprintunixdialog.h> | 8 #include <gtk/gtkprintunixdialog.h> |
| 9 #include <gtk/gtkpagesetupunixdialog.h> | 9 #include <gtk/gtkpagesetupunixdialog.h> |
| 10 | 10 |
| 11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
| 14 #include "chrome/browser/browser_list.h" | 14 #include "chrome/browser/browser_list.h" |
| 15 #include "chrome/browser/browser_window.h" | 15 #include "chrome/browser/browser_window.h" |
| 16 #include "chrome/browser/tab_contents/infobar_delegate.h" | 16 #include "chrome/browser/tab_contents/infobar_delegate.h" |
| 17 #include "chrome/browser/tab_contents/tab_contents.h" | 17 #include "chrome/browser/tab_contents/tab_contents.h" |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 // This is a temporary infobar designed to help gauge how many users are trying | 21 // This is a temporary infobar designed to help gauge how many users are trying |
| 22 // to print to printers that don't support PDF. | 22 // to print to printers that don't support PDF. |
| 23 class PdfUnsupportedInfoBarDelegate : public LinkInfoBarDelegate { | 23 class PdfUnsupportedInfoBarDelegate : public LinkInfoBarDelegate { |
| 24 public: | 24 public: |
| 25 PdfUnsupportedInfoBarDelegate(Browser* browser) | 25 explicit PdfUnsupportedInfoBarDelegate(Browser* browser) |
| 26 : LinkInfoBarDelegate(NULL), | 26 : LinkInfoBarDelegate(NULL), |
| 27 browser_(browser) { | 27 browser_(browser) { |
| 28 } | 28 } |
| 29 | 29 |
| 30 ~PdfUnsupportedInfoBarDelegate() {} | 30 ~PdfUnsupportedInfoBarDelegate() {} |
| 31 | 31 |
| 32 virtual std::wstring GetMessageTextWithOffset(size_t* link_offset) const { | 32 virtual std::wstring GetMessageTextWithOffset(size_t* link_offset) const { |
| 33 std::wstring message(L"Oops! Your printer does not support PDF. Please " | 33 std::wstring message(L"Oops! Your printer does not support PDF. Please " |
| 34 L"report this to us ."); | 34 L"report this to us ."); |
| 35 *link_offset = message.length() - 1; | 35 *link_offset = message.length() - 1; |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 if (error) | 133 if (error) |
| 134 LOG(ERROR) << "Printing failed: " << error->message; | 134 LOG(ERROR) << "Printing failed: " << error->message; |
| 135 | 135 |
| 136 if (job) | 136 if (job) |
| 137 g_object_unref(job); | 137 g_object_unref(job); |
| 138 | 138 |
| 139 file_util::Delete(path_to_pdf_, false); | 139 file_util::Delete(path_to_pdf_, false); |
| 140 | 140 |
| 141 delete this; | 141 delete this; |
| 142 } | 142 } |
| OLD | NEW |