OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <map> | 7 #include <map> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 return true; | 146 return true; |
147 } | 147 } |
148 | 148 |
149 void PrintViewManager::PrintPreviewForWebNode() { | 149 void PrintViewManager::PrintPreviewForWebNode() { |
150 DCHECK_EQ(NOT_PREVIEWING, print_preview_state_); | 150 DCHECK_EQ(NOT_PREVIEWING, print_preview_state_); |
151 print_preview_state_ = USER_INITIATED_PREVIEW; | 151 print_preview_state_ = USER_INITIATED_PREVIEW; |
152 } | 152 } |
153 | 153 |
154 void PrintViewManager::PrintPreviewDone() { | 154 void PrintViewManager::PrintPreviewDone() { |
155 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 155 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
156 DCHECK_NE(NOT_PREVIEWING, print_preview_state_); | |
157 | 156 |
158 if (print_preview_state_ == SCRIPTED_PREVIEW) { | 157 if (print_preview_state_ == SCRIPTED_PREVIEW) { |
159 ScriptedPrintPreviewClosureMap& map = | 158 ScriptedPrintPreviewClosureMap& map = |
160 g_scripted_print_preview_closure_map.Get(); | 159 g_scripted_print_preview_closure_map.Get(); |
161 ScriptedPrintPreviewClosureMap::iterator it = | 160 ScriptedPrintPreviewClosureMap::iterator it = |
162 map.find(scripted_print_preview_rph_); | 161 map.find(scripted_print_preview_rph_); |
163 CHECK(it != map.end()); | 162 CHECK(it != map.end()); |
164 it->second.Run(); | 163 it->second.Run(); |
165 map.erase(scripted_print_preview_rph_); | 164 map.erase(scripted_print_preview_rph_); |
166 scripted_print_preview_rph_ = NULL; | 165 scripted_print_preview_rph_ = NULL; |
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 scoped_refptr<printing::PrinterQuery> printer_query; | 675 scoped_refptr<printing::PrinterQuery> printer_query; |
677 print_job_manager->PopPrinterQuery(cookie, &printer_query); | 676 print_job_manager->PopPrinterQuery(cookie, &printer_query); |
678 if (!printer_query.get()) | 677 if (!printer_query.get()) |
679 return; | 678 return; |
680 BrowserThread::PostTask( | 679 BrowserThread::PostTask( |
681 BrowserThread::IO, FROM_HERE, | 680 BrowserThread::IO, FROM_HERE, |
682 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); | 681 base::Bind(&PrinterQuery::StopWorker, printer_query.get())); |
683 } | 682 } |
684 | 683 |
685 } // namespace printing | 684 } // namespace printing |
OLD | NEW |