| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 WebContents* contents, content::LoadCommittedDetails* details) { | 330 WebContents* contents, content::LoadCommittedDetails* details) { |
| 331 WebContents* preview_dialog = GetPrintPreviewForContents(contents); | 331 WebContents* preview_dialog = GetPrintPreviewForContents(contents); |
| 332 if (!preview_dialog) { | 332 if (!preview_dialog) { |
| 333 NOTREACHED(); | 333 NOTREACHED(); |
| 334 return; | 334 return; |
| 335 } | 335 } |
| 336 | 336 |
| 337 if (contents == preview_dialog) { | 337 if (contents == preview_dialog) { |
| 338 // Preview dialog navigated. | 338 // Preview dialog navigated. |
| 339 if (details) { | 339 if (details) { |
| 340 content::PageTransition transition_type = | 340 ui::PageTransition transition_type = |
| 341 details->entry->GetTransitionType(); | 341 details->entry->GetTransitionType(); |
| 342 content::NavigationType nav_type = details->type; | 342 content::NavigationType nav_type = details->type; |
| 343 | 343 |
| 344 // New |preview_dialog| is created. Don't update/erase map entry. | 344 // New |preview_dialog| is created. Don't update/erase map entry. |
| 345 if (waiting_for_new_preview_page_ && | 345 if (waiting_for_new_preview_page_ && |
| 346 transition_type == content::PAGE_TRANSITION_AUTO_TOPLEVEL && | 346 transition_type == ui::PAGE_TRANSITION_AUTO_TOPLEVEL && |
| 347 nav_type == content::NAVIGATION_TYPE_NEW_PAGE) { | 347 nav_type == content::NAVIGATION_TYPE_NEW_PAGE) { |
| 348 waiting_for_new_preview_page_ = false; | 348 waiting_for_new_preview_page_ = false; |
| 349 SaveInitiatorTitle(preview_dialog); | 349 SaveInitiatorTitle(preview_dialog); |
| 350 return; | 350 return; |
| 351 } | 351 } |
| 352 | 352 |
| 353 // Cloud print sign-in causes a reload. | 353 // Cloud print sign-in causes a reload. |
| 354 if (!waiting_for_new_preview_page_ && | 354 if (!waiting_for_new_preview_page_ && |
| 355 transition_type == content::PAGE_TRANSITION_RELOAD && | 355 transition_type == ui::PAGE_TRANSITION_RELOAD && |
| 356 nav_type == content::NAVIGATION_TYPE_EXISTING_PAGE && | 356 nav_type == content::NAVIGATION_TYPE_EXISTING_PAGE && |
| 357 IsPrintPreviewURL(details->previous_url)) { | 357 IsPrintPreviewURL(details->previous_url)) { |
| 358 return; | 358 return; |
| 359 } | 359 } |
| 360 } | 360 } |
| 361 NOTREACHED(); | 361 NOTREACHED(); |
| 362 return; | 362 return; |
| 363 } | 363 } |
| 364 | 364 |
| 365 RemoveInitiator(contents); | 365 RemoveInitiator(contents); |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 static_cast<PrintPreviewUI*>(web_ui->GetController()); | 473 static_cast<PrintPreviewUI*>(web_ui->GetController()); |
| 474 if (print_preview_ui) | 474 if (print_preview_ui) |
| 475 print_preview_ui->OnPrintPreviewDialogDestroyed(); | 475 print_preview_ui->OnPrintPreviewDialogDestroyed(); |
| 476 } | 476 } |
| 477 | 477 |
| 478 preview_dialog_map_.erase(preview_dialog); | 478 preview_dialog_map_.erase(preview_dialog); |
| 479 RemoveObservers(preview_dialog); | 479 RemoveObservers(preview_dialog); |
| 480 } | 480 } |
| 481 | 481 |
| 482 } // namespace printing | 482 } // namespace printing |
| OLD | NEW |