| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/renderer/print_web_view_helper.h" | 5 #include "chrome/renderer/print_web_view_helper.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/process_util.h" | 9 #include "base/process_util.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 } | 177 } |
| 178 | 178 |
| 179 void PrintWebViewHelper::DidFinishPrinting(bool success) { | 179 void PrintWebViewHelper::DidFinishPrinting(bool success) { |
| 180 if (!success) { | 180 if (!success) { |
| 181 WebView* web_view = print_web_view_; | 181 WebView* web_view = print_web_view_; |
| 182 if (!web_view) | 182 if (!web_view) |
| 183 web_view = render_view_->webview(); | 183 web_view = render_view_->webview(); |
| 184 | 184 |
| 185 render_view_->runModalAlertDialog( | 185 render_view_->runModalAlertDialog( |
| 186 web_view->mainFrame(), | 186 web_view->mainFrame(), |
| 187 WideToUTF16Hack( | 187 l10n_util::GetStringUTF16(IDS_PRINT_SPOOL_FAILED_ERROR_TEXT)); |
| 188 l10n_util::GetString(IDS_PRINT_SPOOL_FAILED_ERROR_TEXT))); | |
| 189 } | 188 } |
| 190 | 189 |
| 191 if (print_web_view_) { | 190 if (print_web_view_) { |
| 192 print_web_view_->close(); | 191 print_web_view_->close(); |
| 193 print_web_view_ = NULL; | 192 print_web_view_ = NULL; |
| 194 } | 193 } |
| 195 print_pages_params_.reset(); | 194 print_pages_params_.reset(); |
| 196 } | 195 } |
| 197 | 196 |
| 198 bool PrintWebViewHelper::CopyAndPrint(WebFrame* web_frame) { | 197 bool PrintWebViewHelper::CopyAndPrint(WebFrame* web_frame) { |
| (...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 495 shared_buf.GiveToProcess(base::GetCurrentProcessHandle(), | 494 shared_buf.GiveToProcess(base::GetCurrentProcessHandle(), |
| 496 shared_mem_handle); | 495 shared_mem_handle); |
| 497 return true; | 496 return true; |
| 498 } | 497 } |
| 499 } | 498 } |
| 500 } | 499 } |
| 501 NOTREACHED(); | 500 NOTREACHED(); |
| 502 return false; | 501 return false; |
| 503 } | 502 } |
| 504 #endif | 503 #endif |
| OLD | NEW |