summaryrefslogtreecommitdiffstats
path: root/chrome/browser/browser_process_impl.cc
diff options
context:
space:
mode:
authorkmadhusu@chromium.org <kmadhusu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-16 20:34:16 +0000
committerkmadhusu@chromium.org <kmadhusu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-16 20:34:16 +0000
commitdbeebd5ee33f26e2f719e87546f51371a63801b5 (patch)
treefd9627decf2a31c88a866ff46139d4e9b302dfb5 /chrome/browser/browser_process_impl.cc
parent3cd6bbf33030ba47b73a10d503e97fba3de2095f (diff)
downloadchromium_src-dbeebd5ee33f26e2f719e87546f51371a63801b5.zip
chromium_src-dbeebd5ee33f26e2f719e87546f51371a63801b5.tar.gz
chromium_src-dbeebd5ee33f26e2f719e87546f51371a63801b5.tar.bz2
Implement print preview tab controller.
For print preview, a PP tab should be linked with the tab that initiated the printing operation. If the tab initiates a second printing operation while the first print preview tab is still open, that PP tab should be focused/activated. There may be more than one PP tab open. Hook ctrl+p to show print preview tab. BUG=59653, 57893 TEST=new unittest created. Review URL: http://codereview.chromium.org/4338001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66319 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/browser_process_impl.cc')
-rw-r--r--chrome/browser/browser_process_impl.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc
index 5331621..bf1a52f 100644
--- a/chrome/browser/browser_process_impl.cc
+++ b/chrome/browser/browser_process_impl.cc
@@ -41,6 +41,7 @@
#include "chrome/browser/plugin_updater.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/printing/print_job_manager.h"
+#include "chrome/browser/printing/print_preview_tab_controller.h"
#include "chrome/browser/profile_manager.h"
#include "chrome/browser/renderer_host/render_process_host.h"
#include "chrome/browser/renderer_host/resource_dispatcher_host.h"
@@ -434,6 +435,14 @@ printing::PrintJobManager* BrowserProcessImpl::print_job_manager() {
return print_job_manager_.get();
}
+printing::PrintPreviewTabController*
+ BrowserProcessImpl::print_preview_tab_controller() {
+ DCHECK(CalledOnValidThread());
+ if (!print_preview_tab_controller_.get())
+ CreatePrintPreviewTabController();
+ return print_preview_tab_controller_.get();
+}
+
GoogleURLTracker* BrowserProcessImpl::google_url_tracker() {
DCHECK(CalledOnValidThread());
if (!google_url_tracker_.get())
@@ -699,6 +708,11 @@ void BrowserProcessImpl::CreateTabCloseableStateWatcher() {
tab_closeable_state_watcher_.reset(TabCloseableStateWatcher::Create());
}
+void BrowserProcessImpl::CreatePrintPreviewTabController() {
+ DCHECK(print_preview_tab_controller_.get() == NULL);
+ print_preview_tab_controller_ = new printing::PrintPreviewTabController();
+}
+
// The BrowserProcess object must outlive the file thread so we use traits
// which don't do any management.
DISABLE_RUNNABLE_METHOD_REFCOUNT(BrowserProcessImpl);