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

Unified Diff: chrome/browser/ui/webui/print_preview_ui.cc

Issue 7365003: Print Preview: Make preview generation event driven to eliminate synchronous messages. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: clang fix Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/print_preview_ui.h ('k') | chrome/common/print_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/print_preview_ui.cc
===================================================================
--- chrome/browser/ui/webui/print_preview_ui.cc (revision 92822)
+++ chrome/browser/ui/webui/print_preview_ui.cc (working copy)
@@ -16,7 +16,8 @@
PrintPreviewUI::PrintPreviewUI(TabContents* contents)
: ChromeWebUI(contents),
initial_preview_start_time_(base::TimeTicks::Now()),
- request_count_(0U) {
+ request_count_(0U),
+ document_cookie_(0) {
// WebUI owns |handler_|.
handler_ = new PrintPreviewHandler();
AddMessageHandler(handler_->Attach(this));
@@ -54,8 +55,10 @@
request_count_++;
}
-void PrintPreviewUI::OnDidGetPreviewPageCount(int page_count) {
+void PrintPreviewUI::OnDidGetPreviewPageCount(int document_cookie,
+ int page_count) {
DCHECK_GT(page_count, 0);
+ document_cookie_ = document_cookie;
FundamentalValue count(page_count);
CallJavascriptFunction("onDidGetPreviewPageCount", count);
}
@@ -116,7 +119,10 @@
}
void PrintPreviewUI::DecrementRequestCount() {
- DCHECK_GT(request_count_, 0U);
if (request_count_ > 0)
request_count_--;
}
+
+int PrintPreviewUI::document_cookie() {
+ return document_cookie_;
+}
« no previous file with comments | « chrome/browser/ui/webui/print_preview_ui.h ('k') | chrome/common/print_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698