| 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/ui/webui/print_preview/print_preview_handler.h" | 5 #include "chrome/browser/ui/webui/print_preview/print_preview_handler.h" |
| 6 | 6 |
| 7 #include <ctype.h> | 7 #include <ctype.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 int request_id = -1; | 336 int request_id = -1; |
| 337 if (!settings->GetInteger(printing::kPreviewRequestID, &request_id)) | 337 if (!settings->GetInteger(printing::kPreviewRequestID, &request_id)) |
| 338 return; | 338 return; |
| 339 | 339 |
| 340 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>( | 340 PrintPreviewUI* print_preview_ui = static_cast<PrintPreviewUI*>( |
| 341 web_ui()->GetController()); | 341 web_ui()->GetController()); |
| 342 print_preview_ui->OnPrintPreviewRequest(request_id); | 342 print_preview_ui->OnPrintPreviewRequest(request_id); |
| 343 // Add an additional key in order to identify |print_preview_ui| later on | 343 // Add an additional key in order to identify |print_preview_ui| later on |
| 344 // when calling PrintPreviewUI::GetCurrentPrintPreviewStatus() on the IO | 344 // when calling PrintPreviewUI::GetCurrentPrintPreviewStatus() on the IO |
| 345 // thread. | 345 // thread. |
| 346 settings->SetString(printing::kPreviewUIAddr, | 346 settings->SetInteger(printing::kPreviewUIID, |
| 347 print_preview_ui->GetPrintPreviewUIAddress()); | 347 print_preview_ui->GetIDForPrintPreviewUI()); |
| 348 | 348 |
| 349 // Increment request count. | 349 // Increment request count. |
| 350 ++regenerate_preview_request_count_; | 350 ++regenerate_preview_request_count_; |
| 351 | 351 |
| 352 TabContents* initiator_tab = GetInitiatorTab(); | 352 TabContents* initiator_tab = GetInitiatorTab(); |
| 353 if (!initiator_tab) { | 353 if (!initiator_tab) { |
| 354 ReportUserActionHistogram(INITIATOR_TAB_CLOSED); | 354 ReportUserActionHistogram(INITIATOR_TAB_CLOSED); |
| 355 print_preview_ui->OnClosePrintPreviewTab(); | 355 print_preview_ui->OnClosePrintPreviewTab(); |
| 356 return; | 356 return; |
| 357 } | 357 } |
| (...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 969 return; | 969 return; |
| 970 | 970 |
| 971 // We no longer require the initiator tab details. Remove those details | 971 // We no longer require the initiator tab details. Remove those details |
| 972 // associated with the preview tab to allow the initiator tab to create | 972 // associated with the preview tab to allow the initiator tab to create |
| 973 // another preview tab. | 973 // another preview tab. |
| 974 printing::PrintPreviewTabController* tab_controller = | 974 printing::PrintPreviewTabController* tab_controller = |
| 975 printing::PrintPreviewTabController::GetInstance(); | 975 printing::PrintPreviewTabController::GetInstance(); |
| 976 if (tab_controller) | 976 if (tab_controller) |
| 977 tab_controller->EraseInitiatorTabInfo(preview_tab_contents()); | 977 tab_controller->EraseInitiatorTabInfo(preview_tab_contents()); |
| 978 } | 978 } |
| OLD | NEW |