| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_PRINTING_CLOUD_PRINT_CLOUD_PRINT_SETUP_SOURCE_H_ | 5 #ifndef CHROME_BROWSER_PRINTING_CLOUD_PRINT_CLOUD_PRINT_SETUP_SOURCE_H_ |
| 6 #define CHROME_BROWSER_PRINTING_CLOUD_PRINT_CLOUD_PRINT_SETUP_SOURCE_H_ | 6 #define CHROME_BROWSER_PRINTING_CLOUD_PRINT_CLOUD_PRINT_SETUP_SOURCE_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "content/public/browser/url_data_source_delegate.h" | 10 #include "content/public/browser/url_data_source.h" |
| 11 | 11 |
| 12 class CloudPrintSetupSource : public content::URLDataSourceDelegate { | 12 class CloudPrintSetupSource : public content::URLDataSource { |
| 13 public: | 13 public: |
| 14 CloudPrintSetupSource(); | 14 CloudPrintSetupSource(); |
| 15 | 15 |
| 16 // content::URLDataSourceDelegate implementation. | 16 // content::URLDataSource implementation. |
| 17 virtual std::string GetSource() OVERRIDE; | 17 virtual std::string GetSource() OVERRIDE; |
| 18 virtual void StartDataRequest(const std::string& path, | 18 virtual void StartDataRequest( |
| 19 bool is_incognito, | 19 const std::string& path, |
| 20 int request_id) OVERRIDE; | 20 bool is_incognito, |
| 21 const content::URLDataSource::GotDataCallback& callback) OVERRIDE; |
| 21 virtual std::string GetMimeType(const std::string& path) const OVERRIDE; | 22 virtual std::string GetMimeType(const std::string& path) const OVERRIDE; |
| 22 | 23 |
| 23 static const char kInvalidPasswordHelpUrl[]; | 24 static const char kInvalidPasswordHelpUrl[]; |
| 24 static const char kCanNotAccessAccountUrl[]; | 25 static const char kCanNotAccessAccountUrl[]; |
| 25 static const char kCreateNewAccountUrl[]; | 26 static const char kCreateNewAccountUrl[]; |
| 26 | 27 |
| 27 private: | 28 private: |
| 28 virtual ~CloudPrintSetupSource() {} | 29 virtual ~CloudPrintSetupSource() {} |
| 29 | 30 |
| 30 // Takes a string containing an URL and returns an URL containing a CGI | 31 // Takes a string containing an URL and returns an URL containing a CGI |
| 31 // parameter of the form "&hl=xy" where 'xy' is the language code of the | 32 // parameter of the form "&hl=xy" where 'xy' is the language code of the |
| 32 // current locale. | 33 // current locale. |
| 33 std::string GetLocalizedUrl(const std::string& url) const; | 34 std::string GetLocalizedUrl(const std::string& url) const; |
| 34 | 35 |
| 35 DISALLOW_COPY_AND_ASSIGN(CloudPrintSetupSource); | 36 DISALLOW_COPY_AND_ASSIGN(CloudPrintSetupSource); |
| 36 }; | 37 }; |
| 37 | 38 |
| 38 #endif // CHROME_BROWSER_PRINTING_CLOUD_PRINT_CLOUD_PRINT_SETUP_SOURCE_H_ | 39 #endif // CHROME_BROWSER_PRINTING_CLOUD_PRINT_CLOUD_PRINT_SETUP_SOURCE_H_ |
| OLD | NEW |