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 <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 1004 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1015 ClosePreviewDialog(); | 1015 ClosePreviewDialog(); |
1016 } | 1016 } |
1017 | 1017 |
1018 void PrintPreviewHandler::HandleManageCloudPrint( | 1018 void PrintPreviewHandler::HandleManageCloudPrint( |
1019 const base::ListValue* /*args*/) { | 1019 const base::ListValue* /*args*/) { |
1020 ++manage_cloud_printers_dialog_request_count_; | 1020 ++manage_cloud_printers_dialog_request_count_; |
1021 preview_web_contents()->OpenURL(content::OpenURLParams( | 1021 preview_web_contents()->OpenURL(content::OpenURLParams( |
1022 cloud_devices::GetCloudPrintRelativeURL("manage.html"), | 1022 cloud_devices::GetCloudPrintRelativeURL("manage.html"), |
1023 content::Referrer(), | 1023 content::Referrer(), |
1024 NEW_FOREGROUND_TAB, | 1024 NEW_FOREGROUND_TAB, |
1025 content::PAGE_TRANSITION_LINK, | 1025 ui::PAGE_TRANSITION_LINK, |
1026 false)); | 1026 false)); |
1027 } | 1027 } |
1028 | 1028 |
1029 #if !defined(DISABLE_BASIC_PRINTING) | 1029 #if !defined(DISABLE_BASIC_PRINTING) |
1030 void PrintPreviewHandler::HandleShowSystemDialog( | 1030 void PrintPreviewHandler::HandleShowSystemDialog( |
1031 const base::ListValue* /*args*/) { | 1031 const base::ListValue* /*args*/) { |
1032 ReportStats(); | 1032 ReportStats(); |
1033 ReportUserActionHistogram(FALLBACK_TO_ADVANCED_SETTINGS_DIALOG); | 1033 ReportUserActionHistogram(FALLBACK_TO_ADVANCED_SETTINGS_DIALOG); |
1034 | 1034 |
1035 WebContents* initiator = GetInitiator(); | 1035 WebContents* initiator = GetInitiator(); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1112 | 1112 |
1113 void PrintPreviewHandler::HandleForceOpenNewTab(const base::ListValue* args) { | 1113 void PrintPreviewHandler::HandleForceOpenNewTab(const base::ListValue* args) { |
1114 std::string url; | 1114 std::string url; |
1115 if (!args->GetString(0, &url)) | 1115 if (!args->GetString(0, &url)) |
1116 return; | 1116 return; |
1117 Browser* browser = chrome::FindBrowserWithWebContents(GetInitiator()); | 1117 Browser* browser = chrome::FindBrowserWithWebContents(GetInitiator()); |
1118 if (!browser) | 1118 if (!browser) |
1119 return; | 1119 return; |
1120 chrome::AddSelectedTabWithURL(browser, | 1120 chrome::AddSelectedTabWithURL(browser, |
1121 GURL(url), | 1121 GURL(url), |
1122 content::PAGE_TRANSITION_LINK); | 1122 ui::PAGE_TRANSITION_LINK); |
1123 } | 1123 } |
1124 | 1124 |
1125 void PrintPreviewHandler::SendInitialSettings( | 1125 void PrintPreviewHandler::SendInitialSettings( |
1126 const std::string& default_printer) { | 1126 const std::string& default_printer) { |
1127 PrintPreviewUI* print_preview_ui = | 1127 PrintPreviewUI* print_preview_ui = |
1128 static_cast<PrintPreviewUI*>(web_ui()->GetController()); | 1128 static_cast<PrintPreviewUI*>(web_ui()->GetController()); |
1129 | 1129 |
1130 base::DictionaryValue initial_settings; | 1130 base::DictionaryValue initial_settings; |
1131 initial_settings.SetString(kInitiatorTitle, | 1131 initial_settings.SetString(kInitiatorTitle, |
1132 print_preview_ui->initiator_title()); | 1132 print_preview_ui->initiator_title()); |
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1595 | 1595 |
1596 void PrintPreviewHandler::UnregisterForMergeSession() { | 1596 void PrintPreviewHandler::UnregisterForMergeSession() { |
1597 if (reconcilor_) | 1597 if (reconcilor_) |
1598 reconcilor_->RemoveMergeSessionObserver(this); | 1598 reconcilor_->RemoveMergeSessionObserver(this); |
1599 } | 1599 } |
1600 | 1600 |
1601 void PrintPreviewHandler::SetPdfSavedClosureForTesting( | 1601 void PrintPreviewHandler::SetPdfSavedClosureForTesting( |
1602 const base::Closure& closure) { | 1602 const base::Closure& closure) { |
1603 pdf_file_saved_closure_ = closure; | 1603 pdf_file_saved_closure_ = closure; |
1604 } | 1604 } |
OLD | NEW |