| 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/search/local_ntp_source.h" | 5 #include "chrome/browser/search/local_ntp_source.h" |
| 6 | 6 |
| 7 #include "base/base64.h" | 7 #include "base/base64.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/feature_list.h" | 9 #include "base/feature_list.h" |
| 10 #include "base/json/json_string_value_serializer.h" | 10 #include "base/json/json_string_value_serializer.h" |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 // While live-editing the local NTP files, turn off CSP. | 418 // While live-editing the local NTP files, turn off CSP. |
| 419 return "script-src *;"; | 419 return "script-src *;"; |
| 420 } | 420 } |
| 421 #endif // !defined(GOOGLE_CHROME_BUILD) | 421 #endif // !defined(GOOGLE_CHROME_BUILD) |
| 422 | 422 |
| 423 return "script-src 'strict-dynamic' " | 423 return "script-src 'strict-dynamic' " |
| 424 "'sha256-" + | 424 "'sha256-" + |
| 425 GetIntegritySha256Value( | 425 GetIntegritySha256Value( |
| 426 GetConfigData(default_search_provider_is_google_io_thread_)) + | 426 GetConfigData(default_search_provider_is_google_io_thread_)) + |
| 427 "' " | 427 "' " |
| 428 "'sha256-yAvSu2Dl9rlQTpQn8P1hcE5GUFQVGbuCMHypwtN6uDg=';"; | 428 "'sha256-//Ntxa12Vzvs6oUFThZ7SAu9dDxHfqgUeSTOrQKqlgE=';"; |
| 429 } | 429 } |
| 430 | 430 |
| 431 std::string LocalNtpSource::GetContentSecurityPolicyChildSrc() const { | 431 std::string LocalNtpSource::GetContentSecurityPolicyChildSrc() const { |
| 432 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); | 432 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); |
| 433 | 433 |
| 434 if (one_google_bar_service_) { | 434 if (one_google_bar_service_) { |
| 435 // Allow embedding of the most visited iframe, as well as the account | 435 // Allow embedding of the most visited iframe, as well as the account |
| 436 // switcher and the notifications dropdown from the One Google Bar. | 436 // switcher and the notifications dropdown from the One Google Bar. |
| 437 return base::StringPrintf("child-src %s https://*.google.com/;", | 437 return base::StringPrintf("child-src %s https://*.google.com/;", |
| 438 chrome::kChromeSearchMostVisitedUrl); | 438 chrome::kChromeSearchMostVisitedUrl); |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 507 | 507 |
| 508 LocalNtpSource::OneGoogleBarRequest::OneGoogleBarRequest( | 508 LocalNtpSource::OneGoogleBarRequest::OneGoogleBarRequest( |
| 509 base::TimeTicks start_time, | 509 base::TimeTicks start_time, |
| 510 const content::URLDataSource::GotDataCallback& callback) | 510 const content::URLDataSource::GotDataCallback& callback) |
| 511 : start_time(start_time), callback(callback) {} | 511 : start_time(start_time), callback(callback) {} |
| 512 | 512 |
| 513 LocalNtpSource::OneGoogleBarRequest::OneGoogleBarRequest( | 513 LocalNtpSource::OneGoogleBarRequest::OneGoogleBarRequest( |
| 514 const OneGoogleBarRequest&) = default; | 514 const OneGoogleBarRequest&) = default; |
| 515 | 515 |
| 516 LocalNtpSource::OneGoogleBarRequest::~OneGoogleBarRequest() = default; | 516 LocalNtpSource::OneGoogleBarRequest::~OneGoogleBarRequest() = default; |
| OLD | NEW |