OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 if (print_preview_state_ != NOT_PREVIEWING) { | 117 if (print_preview_state_ != NOT_PREVIEWING) { |
118 NOTREACHED(); | 118 NOTREACHED(); |
119 return false; | 119 return false; |
120 } | 120 } |
121 print_preview_state_ = USER_INITIATED_PREVIEW; | 121 print_preview_state_ = USER_INITIATED_PREVIEW; |
122 return PrintNowInternal(new PrintMsg_InitiatePrintPreview(routing_id())); | 122 return PrintNowInternal(new PrintMsg_InitiatePrintPreview(routing_id())); |
123 } | 123 } |
124 | 124 |
125 void PrintViewManager::PrintPreviewDone() { | 125 void PrintViewManager::PrintPreviewDone() { |
126 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 126 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
127 DCHECK_NE(NOT_PREVIEWING, print_preview_state_); | 127 // DCHECK_NE(NOT_PREVIEWING, print_preview_state_); |
| 128 // TODO(thestig) Fix this. http://crbug.com/105640 |
128 | 129 |
129 if (print_preview_state_ == SCRIPTED_PREVIEW) { | 130 if (print_preview_state_ == SCRIPTED_PREVIEW) { |
130 ScriptedPrintPreviewClosureMap& map = | 131 ScriptedPrintPreviewClosureMap& map = |
131 g_scripted_print_preview_closure_map.Get(); | 132 g_scripted_print_preview_closure_map.Get(); |
132 ScriptedPrintPreviewClosureMap::iterator it = | 133 ScriptedPrintPreviewClosureMap::iterator it = |
133 map.find(scripted_print_preview_rph_); | 134 map.find(scripted_print_preview_rph_); |
134 CHECK(it != map.end()); | 135 CHECK(it != map.end()); |
135 it->second.Run(); | 136 it->second.Run(); |
136 map.erase(scripted_print_preview_rph_); | 137 map.erase(scripted_print_preview_rph_); |
137 scripted_print_preview_rph_ = NULL; | 138 scripted_print_preview_rph_ = NULL; |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
593 } | 594 } |
594 | 595 |
595 bool PrintViewManager::PrintNowInternal(IPC::Message* message) { | 596 bool PrintViewManager::PrintNowInternal(IPC::Message* message) { |
596 // Don't print / print preview interstitials. | 597 // Don't print / print preview interstitials. |
597 if (web_contents()->ShowingInterstitialPage()) | 598 if (web_contents()->ShowingInterstitialPage()) |
598 return false; | 599 return false; |
599 return Send(message); | 600 return Send(message); |
600 } | 601 } |
601 | 602 |
602 } // namespace printing | 603 } // namespace printing |
OLD | NEW |