OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |