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

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

Issue 7845015: Print Preview: Open print preview tab in the right position when the source is a popup. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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 | « no previous file | chrome/browser/printing/print_preview_tab_controller_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/printing/print_preview_tab_controller.cc
===================================================================
--- chrome/browser/printing/print_preview_tab_controller.cc (revision 100320)
+++ chrome/browser/printing/print_preview_tab_controller.cc (working copy)
@@ -91,8 +91,7 @@
if (tab->tab_contents()->showing_interstitial_page())
return;
- PrintPreviewTabController* tab_controller =
- PrintPreviewTabController::GetInstance();
+ PrintPreviewTabController* tab_controller = GetInstance();
if (!tab_controller)
return;
tab_controller->GetOrCreatePreviewTab(tab);
@@ -167,9 +166,10 @@
RenderProcessHost* rph) {
for (PrintPreviewTabMap::iterator iter = preview_tab_map_.begin();
iter != preview_tab_map_.end(); ++iter) {
- if (iter->second != NULL &&
- iter->second->render_view_host()->process() == rph) {
- TabContentsWrapper* preview_tab = GetPrintPreviewForTab(iter->second);
+ TabContentsWrapper* initiator_tab = iter->second;
+ if (initiator_tab &&
+ initiator_tab->render_view_host()->process() == rph) {
+ TabContentsWrapper* preview_tab = iter->first;
PrintPreviewUI* print_preview_ui =
static_cast<PrintPreviewUI*>(preview_tab->web_ui());
print_preview_ui->OnInitiatorTabCrashed();
@@ -320,8 +320,14 @@
params.disposition = NEW_FOREGROUND_TAB;
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeFrame))
params.disposition = NEW_POPUP;
- params.tabstrip_index = current_browser->tabstrip_model()->
- GetIndexOfTabContents(initiator_tab) + 1;
+
+ // For normal tabs, set the position as immediately to the right,
+ // otherwise let the tab strip decide.
+ if (current_browser->is_type_tabbed()) {
+ params.tabstrip_index = current_browser->tabstrip_model()->
+ GetIndexOfTabContents(initiator_tab) + 1;
+ }
+
browser::Navigate(&params);
TabContentsWrapper* preview_tab = params.target_contents;
EnableInternalPDFPluginForTab(preview_tab);
« no previous file with comments | « no previous file | chrome/browser/printing/print_preview_tab_controller_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698