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