| 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 "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" | 9 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" |
| 10 #include "chrome/browser/extensions/tab_helper.h" | 10 #include "chrome/browser/extensions/tab_helper.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "content/public/common/content_switches.h" | 22 #include "content/public/common/content_switches.h" |
| 23 #include "grit/browser_resources.h" | 23 #include "grit/browser_resources.h" |
| 24 #include "grit/generated_resources.h" | 24 #include "grit/generated_resources.h" |
| 25 | 25 |
| 26 namespace { | 26 namespace { |
| 27 | 27 |
| 28 content::WebUIDataSource* CreateWebUIDataSource() { | 28 content::WebUIDataSource* CreateWebUIDataSource() { |
| 29 content::WebUIDataSource* source = | 29 content::WebUIDataSource* source = |
| 30 content::WebUIDataSource::Create(chrome::kChromeUIChromeSigninHost); | 30 content::WebUIDataSource::Create(chrome::kChromeUIChromeSigninHost); |
| 31 source->OverrideContentSecurityPolicyChildSrc("child-src chrome-extension:;"); | 31 source->OverrideContentSecurityPolicyChildSrc("child-src chrome-extension:;"); |
| 32 source->OverrideContentSecurityPolicyObjectSrc("object-src chrome:;"); | 32 source->OverrideContentSecurityPolicyObjectSrc("object-src *;"); |
| 33 source->SetJsonPath("strings.js"); | 33 source->SetJsonPath("strings.js"); |
| 34 | 34 |
| 35 source->SetDefaultResource(IDR_NEW_INLINE_LOGIN_HTML); | 35 source->SetDefaultResource(IDR_NEW_INLINE_LOGIN_HTML); |
| 36 | 36 |
| 37 // Only add a filter when runing as test. | 37 // Only add a filter when runing as test. |
| 38 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 38 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 39 const bool is_running_test = command_line->HasSwitch(::switches::kTestName) || | 39 const bool is_running_test = command_line->HasSwitch(::switches::kTestName) || |
| 40 command_line->HasSwitch(::switches::kTestType); | 40 command_line->HasSwitch(::switches::kTestType); |
| 41 if (is_running_test) | 41 if (is_running_test) |
| 42 source->SetRequestFilter(test::GetTestFilesRequestFilter()); | 42 source->SetRequestFilter(test::GetTestFilesRequestFilter()); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 70 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( | 70 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( |
| 71 contents); | 71 contents); |
| 72 extensions::TabHelper::CreateForWebContents(contents); | 72 extensions::TabHelper::CreateForWebContents(contents); |
| 73 // Ensure that the login UI has a tab ID, which will allow the GAIA auth | 73 // Ensure that the login UI has a tab ID, which will allow the GAIA auth |
| 74 // extension's background script to tell it apart from iframes injected by | 74 // extension's background script to tell it apart from iframes injected by |
| 75 // other extensions. | 75 // other extensions. |
| 76 SessionTabHelper::CreateForWebContents(contents); | 76 SessionTabHelper::CreateForWebContents(contents); |
| 77 } | 77 } |
| 78 | 78 |
| 79 InlineLoginUI::~InlineLoginUI() {} | 79 InlineLoginUI::~InlineLoginUI() {} |
| OLD | NEW |