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 <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 381 if (!waiting_for_new_preview_page_ && | 381 if (!waiting_for_new_preview_page_ && |
| 382 transition_type == content::PAGE_TRANSITION_RELOAD && | 382 transition_type == content::PAGE_TRANSITION_RELOAD && |
| 383 nav_type == content::NAVIGATION_TYPE_EXISTING_PAGE && | 383 nav_type == content::NAVIGATION_TYPE_EXISTING_PAGE && |
| 384 IsPrintPreviewURL(details->previous_url)) { | 384 IsPrintPreviewURL(details->previous_url)) { |
| 385 return; | 385 return; |
| 386 } | 386 } |
| 387 } | 387 } |
| 388 NOTREACHED(); | 388 NOTREACHED(); |
| 389 return; | 389 return; |
| 390 } | 390 } |
| 391 | |
| 392 RemoveInitiatorTab(contents); | |
|
Lei Zhang
2013/06/27 00:31:18
Once we do this, then maybe we don't even need wat
Mike Wittman
2013/06/27 00:58:11
Yes, that's true. It would require a bit more comp
Lei Zhang
2013/06/27 02:29:37
Yes it would. If you don't want to, then just put
Mike Wittman
2013/06/27 17:34:04
Not a problem, added the additional logic to not o
| |
| 393 } | 391 } |
| 394 | 392 |
| 395 WebContents* PrintPreviewDialogController::CreatePrintPreviewDialog( | 393 WebContents* PrintPreviewDialogController::CreatePrintPreviewDialog( |
| 396 WebContents* initiator_tab) { | 394 WebContents* initiator_tab) { |
| 397 base::AutoReset<bool> auto_reset(&is_creating_print_preview_dialog_, true); | 395 base::AutoReset<bool> auto_reset(&is_creating_print_preview_dialog_, true); |
| 398 Profile* profile = | 396 Profile* profile = |
| 399 Profile::FromBrowserContext(initiator_tab->GetBrowserContext()); | 397 Profile::FromBrowserContext(initiator_tab->GetBrowserContext()); |
| 400 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeFrame)) { | 398 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeFrame)) { |
| 401 // Chrome Frame only ever runs on the native desktop, so it is safe to | 399 // Chrome Frame only ever runs on the native desktop, so it is safe to |
| 402 // create the popup on the native desktop. | 400 // create the popup on the native desktop. |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 513 PrintPreviewUI* print_preview_ui = | 511 PrintPreviewUI* print_preview_ui = |
| 514 static_cast<PrintPreviewUI*>(preview_dialog->GetWebUI()->GetController()); | 512 static_cast<PrintPreviewUI*>(preview_dialog->GetWebUI()->GetController()); |
| 515 if (print_preview_ui) | 513 if (print_preview_ui) |
| 516 print_preview_ui->OnPrintPreviewDialogDestroyed(); | 514 print_preview_ui->OnPrintPreviewDialogDestroyed(); |
| 517 | 515 |
| 518 preview_dialog_map_.erase(preview_dialog); | 516 preview_dialog_map_.erase(preview_dialog); |
| 519 RemoveObservers(preview_dialog); | 517 RemoveObservers(preview_dialog); |
| 520 } | 518 } |
| 521 | 519 |
| 522 } // namespace printing | 520 } // namespace printing |
| OLD | NEW |