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

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

Issue 8520011: Print Preview: Make print preview tab modal. (try 2) (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: disable tests in touch_ui, fix failing test 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 110066)
+++ chrome/browser/printing/print_preview_message_handler.cc (working copy)
@@ -13,16 +13,13 @@
#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"
@@ -181,8 +178,6 @@
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.
@@ -252,10 +247,16 @@
return handled;
}
-void PrintPreviewMessageHandler::DidStartLoading() {
- if (tab_contents()->delegate() &&
- PrintPreviewTabController::IsPrintPreviewTab(tab_contents_wrapper())) {
- tab_contents()->SetContentRestrictions(content::CONTENT_RESTRICTION_PRINT);
+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;
}
}

Powered by Google App Engine
This is Rietveld 408576698