| 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/cloud_print/cloud_print_setup_source.h" | 5 #include "chrome/browser/printing/cloud_print/cloud_print_setup_source.h" |
| 6 | 6 |
| 7 #include "base/memory/ref_counted_memory.h" | 7 #include "base/memory/ref_counted_memory.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 CloudPrintSetupSource::CloudPrintSetupSource() { | 43 CloudPrintSetupSource::CloudPrintSetupSource() { |
| 44 } | 44 } |
| 45 | 45 |
| 46 std::string CloudPrintSetupSource::GetSource() { | 46 std::string CloudPrintSetupSource::GetSource() { |
| 47 return chrome::kChromeUICloudPrintSetupHost; | 47 return chrome::kChromeUICloudPrintSetupHost; |
| 48 } | 48 } |
| 49 | 49 |
| 50 void CloudPrintSetupSource::StartDataRequest( | 50 void CloudPrintSetupSource::StartDataRequest( |
| 51 const std::string& path_raw, | 51 const std::string& path_raw, |
| 52 bool is_incognito, | 52 const content::URLDataSource::ExtraRequestInfo& info, |
| 53 const content::URLDataSource::GotDataCallback& callback) { | 53 const content::URLDataSource::GotDataCallback& callback) { |
| 54 const char kCloudPrintSetupPath[] = "cloudprintsetup"; | 54 const char kCloudPrintSetupPath[] = "cloudprintsetup"; |
| 55 const char kCloudPrintGaiaLoginPath[] = "gaialogin"; | 55 const char kCloudPrintGaiaLoginPath[] = "gaialogin"; |
| 56 const char kCloudPrintSetupFlowPath[] = "setupflow"; | 56 const char kCloudPrintSetupFlowPath[] = "setupflow"; |
| 57 const char kCloudPrintSetupDonePath[] = "setupdone"; | 57 const char kCloudPrintSetupDonePath[] = "setupdone"; |
| 58 | 58 |
| 59 DictionaryValue localized_strings; | 59 DictionaryValue localized_strings; |
| 60 DictionaryValue* dict = &localized_strings; | 60 DictionaryValue* dict = &localized_strings; |
| 61 | 61 |
| 62 std::string response; | 62 std::string response; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 return false; | 138 return false; |
| 139 } | 139 } |
| 140 | 140 |
| 141 std::string CloudPrintSetupSource::GetLocalizedUrl( | 141 std::string CloudPrintSetupSource::GetLocalizedUrl( |
| 142 const std::string& url) const { | 142 const std::string& url) const { |
| 143 GURL original_url(url); | 143 GURL original_url(url); |
| 144 DCHECK(original_url.is_valid()); | 144 DCHECK(original_url.is_valid()); |
| 145 GURL localized_url = google_util::AppendGoogleLocaleParam(original_url); | 145 GURL localized_url = google_util::AppendGoogleLocaleParam(original_url); |
| 146 return localized_url.spec(); | 146 return localized_url.spec(); |
| 147 } | 147 } |
| OLD | NEW |