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

Side by Side Diff: chrome/browser/printing/print_preview_dialog_controller.cc

Issue 2201543002: Fix print preview close in gmail. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Moved logic for initiator nav after dialog nav Created 4 years, 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/printing/print_preview_dialog_controller.h" 5 #include "chrome/browser/printing/print_preview_dialog_controller.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 ui::PageTransitionCoreTypeIs(transition_type, 340 ui::PageTransitionCoreTypeIs(transition_type,
341 ui::PAGE_TRANSITION_RELOAD) && 341 ui::PAGE_TRANSITION_RELOAD) &&
342 nav_type == content::NAVIGATION_TYPE_EXISTING_PAGE && 342 nav_type == content::NAVIGATION_TYPE_EXISTING_PAGE &&
343 IsPrintPreviewURL(details->previous_url)) { 343 IsPrintPreviewURL(details->previous_url)) {
344 return; 344 return;
345 } 345 }
346 } 346 }
347 NOTREACHED(); 347 NOTREACHED();
348 return; 348 return;
349 } 349 }
350 if (details) {
351 ui::PageTransition type = details->entry->GetTransitionType();
352 content::NavigationType nav_type = details->type;
353 if (nav_type == content::NAVIGATION_TYPE_EXISTING_PAGE &&
354 (ui::PageTransitionCoreTypeIs(type, ui::PAGE_TRANSITION_TYPED) ||
355 ui::PageTransitionCoreTypeIs(type, ui::PAGE_TRANSITION_LINK)))
356 return;
357 }
350 358
351 RemoveInitiator(contents); 359 RemoveInitiator(contents);
352 } 360 }
353 361
354 WebContents* PrintPreviewDialogController::CreatePrintPreviewDialog( 362 WebContents* PrintPreviewDialogController::CreatePrintPreviewDialog(
355 WebContents* initiator) { 363 WebContents* initiator) {
356 base::AutoReset<bool> auto_reset(&is_creating_print_preview_dialog_, true); 364 base::AutoReset<bool> auto_reset(&is_creating_print_preview_dialog_, true);
357 365
358 // The dialog delegates are deleted when the dialog is closed. 366 // The dialog delegates are deleted when the dialog is closed.
359 ConstrainedWebDialogDelegate* web_dialog_delegate = 367 ConstrainedWebDialogDelegate* web_dialog_delegate =
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
459 if (initiator) { 467 if (initiator) {
460 RemoveObservers(initiator); 468 RemoveObservers(initiator);
461 PrintViewManager::FromWebContents(initiator)->PrintPreviewDone(); 469 PrintViewManager::FromWebContents(initiator)->PrintPreviewDone();
462 } 470 }
463 471
464 preview_dialog_map_.erase(preview_dialog); 472 preview_dialog_map_.erase(preview_dialog);
465 RemoveObservers(preview_dialog); 473 RemoveObservers(preview_dialog);
466 } 474 }
467 475
468 } // namespace printing 476 } // namespace printing
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698