| Index: chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc
|
| ===================================================================
|
| --- chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc (revision 176942)
|
| +++ chrome/browser/ui/webui/chromeos/sim_unlock_ui.cc (working copy)
|
| @@ -18,13 +18,13 @@
|
| #include "chrome/browser/chromeos/cros/network_library.h"
|
| #include "chrome/browser/chromeos/sim_dialog_delegate.h"
|
| #include "chrome/browser/profiles/profile.h"
|
| -#include "chrome/browser/ui/webui/chrome_url_data_manager.h"
|
| +#include "chrome/browser/ui/webui/web_ui_util.h"
|
| #include "chrome/common/chrome_notification_types.h"
|
| #include "chrome/common/jstemplate_builder.h"
|
| #include "chrome/common/url_constants.h"
|
| #include "content/public/browser/browser_thread.h"
|
| #include "content/public/browser/notification_service.h"
|
| -#include "content/public/browser/url_data_source_delegate.h"
|
| +#include "content/public/browser/url_data_source.h"
|
| #include "content/public/browser/web_contents.h"
|
| #include "content/public/browser/web_ui.h"
|
| #include "content/public/browser/web_ui_message_handler.h"
|
| @@ -71,15 +71,16 @@
|
|
|
| namespace chromeos {
|
|
|
| -class SimUnlockUIHTMLSource : public content::URLDataSourceDelegate {
|
| +class SimUnlockUIHTMLSource : public content::URLDataSource {
|
| public:
|
| SimUnlockUIHTMLSource();
|
|
|
| - // content::URLDataSourceDelegate implementation.
|
| + // content::URLDataSource implementation.
|
| virtual std::string GetSource() OVERRIDE;
|
| - virtual void StartDataRequest(const std::string& path,
|
| - bool is_incognito,
|
| - int request_id) OVERRIDE;
|
| + virtual void StartDataRequest(
|
| + const std::string& path,
|
| + bool is_incognito,
|
| + const content::URLDataSource::GotDataCallback& callback) OVERRIDE;
|
| virtual std::string GetMimeType(const std::string&) const OVERRIDE {
|
| return "text/html";
|
| }
|
| @@ -253,9 +254,10 @@
|
| return chrome::kChromeUISimUnlockHost;
|
| }
|
|
|
| -void SimUnlockUIHTMLSource::StartDataRequest(const std::string& path,
|
| - bool is_incognito,
|
| - int request_id) {
|
| +void SimUnlockUIHTMLSource::StartDataRequest(
|
| + const std::string& path,
|
| + bool is_incognito,
|
| + const content::URLDataSource::GotDataCallback& callback) {
|
| DictionaryValue strings;
|
| strings.SetString("title",
|
| l10n_util::GetStringUTF16(IDS_SIM_UNLOCK_ENTER_PIN_TITLE));
|
| @@ -309,7 +311,7 @@
|
| strings.SetString("oldPin", l10n_util::GetStringUTF16(
|
| IDS_OPTIONS_SETTINGS_INTERNET_CELLULAR_CHANGE_PIN_OLD_PIN));
|
|
|
| - URLDataSource::SetFontAndTextDirection(&strings);
|
| + web_ui_util::SetFontAndTextDirection(&strings);
|
|
|
| static const base::StringPiece html(
|
| ResourceBundle::GetSharedInstance().GetRawDataResource(
|
| @@ -318,8 +320,7 @@
|
| std::string full_html = jstemplate_builder::GetI18nTemplateHtml(html,
|
| &strings);
|
|
|
| - url_data_source()->SendResponse(
|
| - request_id, base::RefCountedString::TakeString(&full_html));
|
| + callback.Run(base::RefCountedString::TakeString(&full_html));
|
| }
|
|
|
| // SimUnlockHandler ------------------------------------------------------------
|
|
|