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 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 return; | 344 return; |
345 } | 345 } |
346 } | 346 } |
347 NOTREACHED(); | 347 NOTREACHED(); |
348 return; | 348 return; |
349 } | 349 } |
350 if (details) { | 350 if (details) { |
351 ui::PageTransition type = details->entry->GetTransitionType(); | 351 ui::PageTransition type = details->entry->GetTransitionType(); |
352 content::NavigationType nav_type = details->type; | 352 content::NavigationType nav_type = details->type; |
353 if (nav_type == content::NAVIGATION_TYPE_EXISTING_PAGE && | 353 if (nav_type == content::NAVIGATION_TYPE_EXISTING_PAGE && |
354 (ui::PageTransitionCoreTypeIs(type, ui::PAGE_TRANSITION_TYPED) || | 354 (ui::PageTransitionTypeIncludingQualifiersIs( |
355 ui::PageTransitionCoreTypeIs(type, ui::PAGE_TRANSITION_LINK))) | 355 type, |
| 356 ui::PageTransitionFromInt(ui::PAGE_TRANSITION_TYPED | |
| 357 ui::PAGE_TRANSITION_FROM_ADDRESS_BAR)) || |
| 358 ui::PageTransitionTypeIncludingQualifiersIs(type, |
| 359 ui::PAGE_TRANSITION_LINK))) |
356 return; | 360 return; |
357 } | 361 } |
358 | 362 |
359 RemoveInitiator(contents); | 363 RemoveInitiator(contents); |
360 } | 364 } |
361 | 365 |
362 WebContents* PrintPreviewDialogController::CreatePrintPreviewDialog( | 366 WebContents* PrintPreviewDialogController::CreatePrintPreviewDialog( |
363 WebContents* initiator) { | 367 WebContents* initiator) { |
364 base::AutoReset<bool> auto_reset(&is_creating_print_preview_dialog_, true); | 368 base::AutoReset<bool> auto_reset(&is_creating_print_preview_dialog_, true); |
365 | 369 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 if (initiator) { | 471 if (initiator) { |
468 RemoveObservers(initiator); | 472 RemoveObservers(initiator); |
469 PrintViewManager::FromWebContents(initiator)->PrintPreviewDone(); | 473 PrintViewManager::FromWebContents(initiator)->PrintPreviewDone(); |
470 } | 474 } |
471 | 475 |
472 preview_dialog_map_.erase(preview_dialog); | 476 preview_dialog_map_.erase(preview_dialog); |
473 RemoveObservers(preview_dialog); | 477 RemoveObservers(preview_dialog); |
474 } | 478 } |
475 | 479 |
476 } // namespace printing | 480 } // namespace printing |
OLD | NEW |