| 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_tab_controller.h" | 5 #include "chrome/browser/printing/print_preview_tab_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 374 | 374 |
| 375 if (source_tab_is_preview_tab) { | 375 if (source_tab_is_preview_tab) { |
| 376 // Preview tab navigated. | 376 // Preview tab navigated. |
| 377 if (details) { | 377 if (details) { |
| 378 content::PageTransition transition_type = | 378 content::PageTransition transition_type = |
| 379 details->entry->GetTransitionType(); | 379 details->entry->GetTransitionType(); |
| 380 content::NavigationType nav_type = details->type; | 380 content::NavigationType nav_type = details->type; |
| 381 | 381 |
| 382 // New |preview_tab| is created. Don't update/erase map entry. | 382 // New |preview_tab| is created. Don't update/erase map entry. |
| 383 if (waiting_for_new_preview_page_ && | 383 if (waiting_for_new_preview_page_ && |
| 384 transition_type == content::PAGE_TRANSITION_START_PAGE && | 384 transition_type == content::PAGE_TRANSITION_AUTO_TOPLEVEL && |
| 385 nav_type == content::NAVIGATION_TYPE_NEW_PAGE) { | 385 nav_type == content::NAVIGATION_TYPE_NEW_PAGE) { |
| 386 waiting_for_new_preview_page_ = false; | 386 waiting_for_new_preview_page_ = false; |
| 387 SetInitiatorTabURLAndTitle(preview_tab); | 387 SetInitiatorTabURLAndTitle(preview_tab); |
| 388 return; | 388 return; |
| 389 } | 389 } |
| 390 | 390 |
| 391 // Cloud print sign-in causes a reload. | 391 // Cloud print sign-in causes a reload. |
| 392 if (!waiting_for_new_preview_page_ && | 392 if (!waiting_for_new_preview_page_ && |
| 393 transition_type == content::PAGE_TRANSITION_RELOAD && | 393 transition_type == content::PAGE_TRANSITION_RELOAD && |
| 394 nav_type == content::NAVIGATION_TYPE_EXISTING_PAGE && | 394 nav_type == content::NAVIGATION_TYPE_EXISTING_PAGE && |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>( | 524 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>( |
| 525 preview_tab->web_contents()->GetWebUI()->GetController()); | 525 preview_tab->web_contents()->GetWebUI()->GetController()); |
| 526 if (print_preview_ui) | 526 if (print_preview_ui) |
| 527 print_preview_ui->OnTabDestroyed(); | 527 print_preview_ui->OnTabDestroyed(); |
| 528 | 528 |
| 529 preview_tab_map_.erase(preview_tab); | 529 preview_tab_map_.erase(preview_tab); |
| 530 RemoveObservers(preview_tab); | 530 RemoveObservers(preview_tab); |
| 531 } | 531 } |
| 532 | 532 |
| 533 } // namespace printing | 533 } // namespace printing |
| OLD | NEW |