Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(439)

Side by Side Diff: chrome/browser/printing/print_view_manager.cc

Issue 9139024: Adding functionality to print PDF embedded in the html page. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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_);
Lei Zhang 2012/01/12 22:10:20 Can you comment this out and add the following? //
128 127
129 if (print_preview_state_ == SCRIPTED_PREVIEW) { 128 if (print_preview_state_ == SCRIPTED_PREVIEW) {
130 ScriptedPrintPreviewClosureMap& map = 129 ScriptedPrintPreviewClosureMap& map =
131 g_scripted_print_preview_closure_map.Get(); 130 g_scripted_print_preview_closure_map.Get();
132 ScriptedPrintPreviewClosureMap::iterator it = 131 ScriptedPrintPreviewClosureMap::iterator it =
133 map.find(scripted_print_preview_rph_); 132 map.find(scripted_print_preview_rph_);
134 CHECK(it != map.end()); 133 CHECK(it != map.end());
135 it->second.Run(); 134 it->second.Run();
136 map.erase(scripted_print_preview_rph_); 135 map.erase(scripted_print_preview_rph_);
137 scripted_print_preview_rph_ = NULL; 136 scripted_print_preview_rph_ = NULL;
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after
593 } 592 }
594 593
595 bool PrintViewManager::PrintNowInternal(IPC::Message* message) { 594 bool PrintViewManager::PrintNowInternal(IPC::Message* message) {
596 // Don't print / print preview interstitials. 595 // Don't print / print preview interstitials.
597 if (web_contents()->ShowingInterstitialPage()) 596 if (web_contents()->ShowingInterstitialPage())
598 return false; 597 return false;
599 return Send(message); 598 return Send(message);
600 } 599 }
601 600
602 } // namespace printing 601 } // namespace printing
OLDNEW
« no previous file with comments | « no previous file | chrome/renderer/chrome_ppb_pdf_impl.cc » ('j') | chrome/renderer/chrome_ppb_pdf_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698