| 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 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 497 } | 497 } |
| 498 | 498 |
| 499 void PrintPreviewHandler::HandleCancelPendingPrintRequest( | 499 void PrintPreviewHandler::HandleCancelPendingPrintRequest( |
| 500 const ListValue* /*args*/) { | 500 const ListValue* /*args*/) { |
| 501 TabContents* initiator_tab = GetInitiatorTab(); | 501 TabContents* initiator_tab = GetInitiatorTab(); |
| 502 if (initiator_tab) | 502 if (initiator_tab) |
| 503 ClearInitiatorTabDetails(); | 503 ClearInitiatorTabDetails(); |
| 504 gfx::NativeWindow parent = initiator_tab ? | 504 gfx::NativeWindow parent = initiator_tab ? |
| 505 initiator_tab->web_contents()->GetView()->GetTopLevelNativeWindow() : | 505 initiator_tab->web_contents()->GetView()->GetTopLevelNativeWindow() : |
| 506 NULL; | 506 NULL; |
| 507 browser::ShowPrintErrorDialog(parent); | 507 chrome::ShowPrintErrorDialog(parent); |
| 508 } | 508 } |
| 509 | 509 |
| 510 void PrintPreviewHandler::HandleSaveLastPrinter(const ListValue* args) { | 510 void PrintPreviewHandler::HandleSaveLastPrinter(const ListValue* args) { |
| 511 std::string data_to_save; | 511 std::string data_to_save; |
| 512 if (args->GetString(0, &data_to_save) && !data_to_save.empty()) | 512 if (args->GetString(0, &data_to_save) && !data_to_save.empty()) |
| 513 GetStickySettings()->StorePrinterName(data_to_save); | 513 GetStickySettings()->StorePrinterName(data_to_save); |
| 514 | 514 |
| 515 if (args->GetString(1, &data_to_save) && !data_to_save.empty()) | 515 if (args->GetString(1, &data_to_save) && !data_to_save.empty()) |
| 516 GetStickySettings()->StoreCloudPrintData(data_to_save); | 516 GetStickySettings()->StoreCloudPrintData(data_to_save); |
| 517 } | 517 } |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 909 return; | 909 return; |
| 910 | 910 |
| 911 // We no longer require the initiator tab details. Remove those details | 911 // We no longer require the initiator tab details. Remove those details |
| 912 // associated with the preview tab to allow the initiator tab to create | 912 // associated with the preview tab to allow the initiator tab to create |
| 913 // another preview tab. | 913 // another preview tab. |
| 914 printing::PrintPreviewTabController* tab_controller = | 914 printing::PrintPreviewTabController* tab_controller = |
| 915 printing::PrintPreviewTabController::GetInstance(); | 915 printing::PrintPreviewTabController::GetInstance(); |
| 916 if (tab_controller) | 916 if (tab_controller) |
| 917 tab_controller->EraseInitiatorTabInfo(preview_tab_contents()); | 917 tab_controller->EraseInitiatorTabInfo(preview_tab_contents()); |
| 918 } | 918 } |
| OLD | NEW |