Chromium Code Reviews| 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 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 311 } | 311 } |
| 312 | 312 |
| 313 void PrintPreviewDialogController::OnNavEntryCommitted( | 313 void PrintPreviewDialogController::OnNavEntryCommitted( |
| 314 WebContents* contents, content::LoadCommittedDetails* details) { | 314 WebContents* contents, content::LoadCommittedDetails* details) { |
| 315 WebContents* preview_dialog = GetPrintPreviewForContents(contents); | 315 WebContents* preview_dialog = GetPrintPreviewForContents(contents); |
| 316 if (!preview_dialog) { | 316 if (!preview_dialog) { |
| 317 NOTREACHED(); | 317 NOTREACHED(); |
| 318 return; | 318 return; |
| 319 } | 319 } |
| 320 | 320 |
| 321 if (details) { | |
|
Lei Zhang
2016/07/30 00:36:30
Isn't this handling navigation for both the initia
rbpotter
2016/07/30 01:06:44
When the gmail auto-navigation happens, the conten
rbpotter
2016/07/30 01:20:18
Done.
| |
| 322 ui::PageTransition type = details->entry->GetTransitionType(); | |
| 323 content::NavigationType nav_type = details->type; | |
| 324 if (nav_type == content::NAVIGATION_TYPE_EXISTING_PAGE && | |
|
rbpotter
2016/07/30 00:03:49
This condition covers the case that appears for th
| |
| 325 (ui::PageTransitionCoreTypeIs(type, ui::PAGE_TRANSITION_TYPED) || | |
| 326 ui::PageTransitionCoreTypeIs(type, ui::PAGE_TRANSITION_LINK))) | |
| 327 return; | |
| 328 } | |
| 321 if (contents == preview_dialog) { | 329 if (contents == preview_dialog) { |
| 322 // Preview dialog navigated. | 330 // Preview dialog navigated. |
| 323 if (details) { | 331 if (details) { |
| 324 ui::PageTransition transition_type = | 332 ui::PageTransition transition_type = |
| 325 details->entry->GetTransitionType(); | 333 details->entry->GetTransitionType(); |
| 326 content::NavigationType nav_type = details->type; | 334 content::NavigationType nav_type = details->type; |
| 327 | 335 |
| 328 // New |preview_dialog| is created. Don't update/erase map entry. | 336 // New |preview_dialog| is created. Don't update/erase map entry. |
| 329 if (waiting_for_new_preview_page_ && | 337 if (waiting_for_new_preview_page_ && |
| 330 ui::PageTransitionCoreTypeIs(transition_type, | 338 ui::PageTransitionCoreTypeIs(transition_type, |
| (...skipping 128 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 |