OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/signin/inline_login_ui.h" | 5 #include "chrome/browser/ui/webui/signin/inline_login_ui.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" | 10 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 | 26 |
27 namespace { | 27 namespace { |
28 | 28 |
29 content::WebUIDataSource* CreateWebUIDataSource() { | 29 content::WebUIDataSource* CreateWebUIDataSource() { |
30 content::WebUIDataSource* source = | 30 content::WebUIDataSource* source = |
31 content::WebUIDataSource::Create(chrome::kChromeUIChromeSigninHost); | 31 content::WebUIDataSource::Create(chrome::kChromeUIChromeSigninHost); |
32 source->OverrideContentSecurityPolicyChildSrc("child-src chrome-extension:;"); | 32 source->OverrideContentSecurityPolicyChildSrc("child-src chrome-extension:;"); |
33 source->OverrideContentSecurityPolicyObjectSrc("object-src chrome:;"); | 33 source->OverrideContentSecurityPolicyObjectSrc("object-src chrome:;"); |
34 source->SetJsonPath("strings.js"); | 34 source->SetJsonPath("strings.js"); |
35 | 35 |
36 source->SetDefaultResource(IDR_NEW_INLINE_LOGIN_HTML); | 36 source->SetDefaultResource(IDR_INLINE_LOGIN_HTML); |
37 | 37 |
38 // Only add a filter when runing as test. | 38 // Only add a filter when runing as test. |
39 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 39 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
40 const bool is_running_test = command_line->HasSwitch(::switches::kTestName) || | 40 const bool is_running_test = command_line->HasSwitch(::switches::kTestName) || |
41 command_line->HasSwitch(::switches::kTestType); | 41 command_line->HasSwitch(::switches::kTestType); |
42 if (is_running_test) | 42 if (is_running_test) |
43 source->SetRequestFilter(test::GetTestFilesRequestFilter()); | 43 source->SetRequestFilter(test::GetTestFilesRequestFilter()); |
44 | 44 |
45 source->AddResourcePath("inline_login.css", IDR_INLINE_LOGIN_CSS); | 45 source->AddResourcePath("inline_login.css", IDR_INLINE_LOGIN_CSS); |
46 source->AddResourcePath("inline_login.js", IDR_INLINE_LOGIN_JS); | 46 source->AddResourcePath("inline_login.js", IDR_INLINE_LOGIN_JS); |
(...skipping 24 matching lines...) Expand all Loading... |
71 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( | 71 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( |
72 contents); | 72 contents); |
73 extensions::TabHelper::CreateForWebContents(contents); | 73 extensions::TabHelper::CreateForWebContents(contents); |
74 // Ensure that the login UI has a tab ID, which will allow the GAIA auth | 74 // Ensure that the login UI has a tab ID, which will allow the GAIA auth |
75 // extension's background script to tell it apart from iframes injected by | 75 // extension's background script to tell it apart from iframes injected by |
76 // other extensions. | 76 // other extensions. |
77 SessionTabHelper::CreateForWebContents(contents); | 77 SessionTabHelper::CreateForWebContents(contents); |
78 } | 78 } |
79 | 79 |
80 InlineLoginUI::~InlineLoginUI() {} | 80 InlineLoginUI::~InlineLoginUI() {} |
OLD | NEW |