From a2da49a5570cef35c57acd35f842cb3f368619a1 Mon Sep 17 00:00:00 2001 From: "thestig@chromium.org" Date: Fri, 3 Dec 2010 22:23:48 +0000 Subject: Disable printing context menus on the print preview page. BUG=none TEST=none Review URL: http://codereview.chromium.org/5320001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68228 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/printing/print_preview_tab_controller.cc | 6 ++---- chrome/browser/printing/print_preview_tab_controller.h | 6 +++--- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'chrome/browser/printing') diff --git a/chrome/browser/printing/print_preview_tab_controller.cc b/chrome/browser/printing/print_preview_tab_controller.cc index 6888f5b..2cc8514 100644 --- a/chrome/browser/printing/print_preview_tab_controller.cc +++ b/chrome/browser/printing/print_preview_tab_controller.cc @@ -35,9 +35,6 @@ TabContents* PrintPreviewTabController::GetOrCreatePreviewTab( TabContents* initiator_tab, int browser_window_id ) { DCHECK(initiator_tab); - if (IsPrintPreviewTab(initiator_tab)) - return initiator_tab; - // Get the print preview tab for |initiator_tab|. TabContents* preview_tab = GetPrintPreviewForTab(initiator_tab); if (preview_tab) { @@ -48,6 +45,7 @@ TabContents* PrintPreviewTabController::GetOrCreatePreviewTab( return CreatePrintPreviewTab(initiator_tab, browser_window_id); } +// static bool PrintPreviewTabController::IsPrintPreviewTab(TabContents* tab) { const GURL& url = tab->GetURL(); return (url.SchemeIs(chrome::kChromeUIScheme) && @@ -192,4 +190,4 @@ void PrintPreviewTabController::Observe(NotificationType type, RemoveObservers(initiator_tab); } -} // namespace printing +} // namespace printing diff --git a/chrome/browser/printing/print_preview_tab_controller.h b/chrome/browser/printing/print_preview_tab_controller.h index 6eec3f4..5be6118 100644 --- a/chrome/browser/printing/print_preview_tab_controller.h +++ b/chrome/browser/printing/print_preview_tab_controller.h @@ -43,12 +43,12 @@ class PrintPreviewTabController const NotificationSource& source, const NotificationDetails& details); + // Returns true if |tab| is a print preview tab. + static bool IsPrintPreviewTab(TabContents* tab); + private: friend class base::RefCounted; - // Returns true if |tab| is a print preview tab. - bool IsPrintPreviewTab(TabContents* tab); - // Returns initiator tab for |preview_tab|. // Returns NULL if no initiator tab exists for |preview_tab|. TabContents* GetInitiatorTab(TabContents* preview_tab); -- cgit v1.1