OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/ui/webui/signin/signin_ui.h" |
| 6 |
| 7 #include <string> |
| 8 |
| 9 #include "base/bind.h" |
| 10 #include "base/memory/ref_counted_memory.h" |
| 11 #include "base/memory/scoped_ptr.h" |
| 12 #include "base/strings/string_util.h" |
| 13 #include "base/strings/stringprintf.h" |
| 14 #include "chrome/browser/net/chrome_url_request_context.h" |
| 15 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/common/url_constants.h" |
| 17 #include "content/public/browser/browser_thread.h" |
| 18 #include "content/public/browser/web_contents.h" |
| 19 #include "content/public/browser/web_ui.h" |
| 20 #include "content/public/browser/web_ui_data_source.h" |
| 21 #include "grit/browser_resources.h" |
| 22 #include "net/url_request/url_fetcher.h" |
| 23 #include "net/url_request/url_fetcher_delegate.h" |
| 24 #include "net/url_request/url_request_context_getter.h" |
| 25 #include "ui/base/resource/resource_bundle.h" |
| 26 |
| 27 using content::BrowserThread; |
| 28 using content::WebContents; |
| 29 |
| 30 namespace { |
| 31 |
| 32 content::WebUIDataSource* CreateWebUIDataSource() { |
| 33 content::WebUIDataSource* source = |
| 34 content::WebUIDataSource::Create(chrome::kChromeSigninHost); |
| 35 source->DisableContentSecurityPolicy(); // So we can add iframe. |
| 36 source->SetUseJsonJSFormatV2(); |
| 37 source->SetJsonPath("strings.js"); |
| 38 |
| 39 source->SetDefaultResource(IDR_SIGNIN_HTML); |
| 40 return source; |
| 41 }; |
| 42 |
| 43 } // empty namespace |
| 44 |
| 45 SigninUI::SigninUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
| 46 Profile* profile = Profile::FromWebUI(web_ui); |
| 47 content::WebUIDataSource::Add(profile, CreateWebUIDataSource()); |
| 48 } |
OLD | NEW |