| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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_view_manager.h" | 5 #include "chrome/browser/printing/print_view_manager.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
| 9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
| 10 #include "chrome/browser/printing/print_job.h" | 10 #include "chrome/browser/printing/print_job.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 std::wstring PrintViewManager::RenderSourceName() { | 59 std::wstring PrintViewManager::RenderSourceName() { |
| 60 std::wstring name(UTF16ToWideHack(owner_.GetTitle())); | 60 std::wstring name(UTF16ToWideHack(owner_.GetTitle())); |
| 61 if (name.empty()) | 61 if (name.empty()) |
| 62 name = l10n_util::GetString(IDS_DEFAULT_PRINT_DOCUMENT_TITLE); | 62 name = l10n_util::GetString(IDS_DEFAULT_PRINT_DOCUMENT_TITLE); |
| 63 return name; | 63 return name; |
| 64 } | 64 } |
| 65 | 65 |
| 66 GURL PrintViewManager::RenderSourceUrl() { | 66 GURL PrintViewManager::RenderSourceUrl() { |
| 67 NavigationEntry* entry = owner_.controller().GetActiveEntry(); | 67 NavigationEntry* entry = owner_.controller().GetActiveEntry(); |
| 68 if (entry) | 68 if (entry) |
| 69 return entry->display_url(); | 69 return entry->virtual_url(); |
| 70 else | 70 else |
| 71 return GURL(); | 71 return GURL(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 void PrintViewManager::DidGetPrintedPagesCount(int cookie, int number_pages) { | 74 void PrintViewManager::DidGetPrintedPagesCount(int cookie, int number_pages) { |
| 75 DCHECK_GT(cookie, 0); | 75 DCHECK_GT(cookie, 0); |
| 76 if (!OpportunisticallyCreatePrintJob(cookie)) | 76 if (!OpportunisticallyCreatePrintJob(cookie)) |
| 77 return; | 77 return; |
| 78 | 78 |
| 79 PrintedDocument* document = print_job_->document(); | 79 PrintedDocument* document = print_job_->document(); |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 return false; | 405 return false; |
| 406 } | 406 } |
| 407 | 407 |
| 408 // Settings are already loaded. Go ahead. This will set | 408 // Settings are already loaded. Go ahead. This will set |
| 409 // print_job_->is_job_pending() to true. | 409 // print_job_->is_job_pending() to true. |
| 410 print_job_->StartPrinting(); | 410 print_job_->StartPrinting(); |
| 411 return true; | 411 return true; |
| 412 } | 412 } |
| 413 | 413 |
| 414 } // namespace printing | 414 } // namespace printing |
| OLD | NEW |