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 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 1120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1131 | 1131 |
1132 void PrintPreviewHandler::HandleManageCloudPrint( | 1132 void PrintPreviewHandler::HandleManageCloudPrint( |
1133 const base::ListValue* args) { | 1133 const base::ListValue* args) { |
1134 ++manage_cloud_printers_dialog_request_count_; | 1134 ++manage_cloud_printers_dialog_request_count_; |
1135 GURL manage_url(cloud_devices::GetCloudPrintRelativeURL("manage.html")); | 1135 GURL manage_url(cloud_devices::GetCloudPrintRelativeURL("manage.html")); |
1136 std::string user; | 1136 std::string user; |
1137 if (!args->GetString(0, &user)) | 1137 if (!args->GetString(0, &user)) |
1138 return; | 1138 return; |
1139 if (!user.empty()) | 1139 if (!user.empty()) |
1140 manage_url = net::AppendQueryParameter(manage_url, "user", user); | 1140 manage_url = net::AppendQueryParameter(manage_url, "user", user); |
1141 preview_web_contents()->OpenURL(content::OpenURLParams( | 1141 preview_web_contents()->OpenURL( |
1142 manage_url, | 1142 content::OpenURLParams(manage_url, content::Referrer(), |
1143 content::Referrer(), | 1143 WindowOpenDisposition::NEW_FOREGROUND_TAB, |
1144 NEW_FOREGROUND_TAB, | 1144 ui::PAGE_TRANSITION_LINK, false)); |
1145 ui::PAGE_TRANSITION_LINK, | |
1146 false)); | |
1147 } | 1145 } |
1148 | 1146 |
1149 #if defined(ENABLE_BASIC_PRINTING) | 1147 #if defined(ENABLE_BASIC_PRINTING) |
1150 void PrintPreviewHandler::HandleShowSystemDialog( | 1148 void PrintPreviewHandler::HandleShowSystemDialog( |
1151 const base::ListValue* /*args*/) { | 1149 const base::ListValue* /*args*/) { |
1152 ReportStats(); | 1150 ReportStats(); |
1153 ReportUserActionHistogram(FALLBACK_TO_ADVANCED_SETTINGS_DIALOG); | 1151 ReportUserActionHistogram(FALLBACK_TO_ADVANCED_SETTINGS_DIALOG); |
1154 | 1152 |
1155 WebContents* initiator = GetInitiator(); | 1153 WebContents* initiator = GetInitiator(); |
1156 if (!initiator) | 1154 if (!initiator) |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1758 | 1756 |
1759 void PrintPreviewHandler::UnregisterForGaiaCookieChanges() { | 1757 void PrintPreviewHandler::UnregisterForGaiaCookieChanges() { |
1760 if (gaia_cookie_manager_service_) | 1758 if (gaia_cookie_manager_service_) |
1761 gaia_cookie_manager_service_->RemoveObserver(this); | 1759 gaia_cookie_manager_service_->RemoveObserver(this); |
1762 } | 1760 } |
1763 | 1761 |
1764 void PrintPreviewHandler::SetPdfSavedClosureForTesting( | 1762 void PrintPreviewHandler::SetPdfSavedClosureForTesting( |
1765 const base::Closure& closure) { | 1763 const base::Closure& closure) { |
1766 pdf_file_saved_closure_ = closure; | 1764 pdf_file_saved_closure_ = closure; |
1767 } | 1765 } |
OLD | NEW |