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

Unified Diff: chrome/browser/printing/print_preview_message_handler.cc

Issue 8564044: Revert 110056 - Print Preview: Make print preview tab modal. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 1 month 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
Index: chrome/browser/printing/print_preview_message_handler.cc
===================================================================
--- chrome/browser/printing/print_preview_message_handler.cc (revision 110058)
+++ chrome/browser/printing/print_preview_message_handler.cc (working copy)
@@ -13,13 +13,16 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/printing/print_job_manager.h"
#include "chrome/browser/printing/print_preview_tab_controller.h"
+#include "chrome/browser/printing/print_view_manager.h"
#include "chrome/browser/printing/printer_query.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
+#include "chrome/browser/ui/webui/print_preview_handler.h"
#include "chrome/browser/ui/webui/print_preview_ui.h"
#include "chrome/common/print_messages.h"
#include "content/browser/renderer_host/render_view_host.h"
#include "content/browser/tab_contents/tab_contents.h"
#include "content/public/browser/browser_thread.h"
+#include "content/public/common/content_restriction.h"
#include "printing/page_size_margins.h"
#include "printing/print_job_constants.h"
@@ -178,6 +181,8 @@
return;
}
+ print_preview_tab->print_view_manager()->OverrideTitle(tab_contents());
+
// TODO(joth): This seems like a good match for using RefCountedStaticMemory
// to avoid the memory copy, but the SetPrintPreviewData call chain below
// needs updating to accept the RefCountedMemory* base class.
@@ -247,16 +252,10 @@
return handled;
}
-void PrintPreviewMessageHandler::NavigateToPendingEntry(
- const GURL& url,
- NavigationController::ReloadType reload_type) {
- TabContentsWrapper* tab = tab_contents_wrapper();
- TabContentsWrapper* preview_tab = GetPrintPreviewTab();
- if (tab == preview_tab) {
- // Cloud print sign-in reloads the page.
- DCHECK(PrintPreviewTabController::IsPrintPreviewURL(url));
- DCHECK_EQ(NavigationController::RELOAD, reload_type);
- return;
+void PrintPreviewMessageHandler::DidStartLoading() {
+ if (tab_contents()->delegate() &&
+ PrintPreviewTabController::IsPrintPreviewTab(tab_contents_wrapper())) {
+ tab_contents()->SetContentRestrictions(content::CONTENT_RESTRICTION_PRINT);
}
}
« no previous file with comments | « chrome/browser/printing/print_preview_message_handler.h ('k') | chrome/browser/printing/print_preview_tab_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698