Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(462)

Side by Side Diff: chrome/browser/search/local_ntp_source.cc

Issue 2852293002: Local NTP: Fade in the OneGoogleBar (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 // While live-editing the local NTP files, turn off CSP. 415 // While live-editing the local NTP files, turn off CSP.
416 return "script-src *;"; 416 return "script-src *;";
417 } 417 }
418 #endif // !defined(GOOGLE_CHROME_BUILD) 418 #endif // !defined(GOOGLE_CHROME_BUILD)
419 419
420 return "script-src 'strict-dynamic' " 420 return "script-src 'strict-dynamic' "
421 "'sha256-" + 421 "'sha256-" +
422 GetIntegritySha256Value( 422 GetIntegritySha256Value(
423 GetConfigData(default_search_provider_is_google_io_thread_)) + 423 GetConfigData(default_search_provider_is_google_io_thread_)) +
424 "' " 424 "' "
425 "'sha256-ROPmcormZEipZzy3Ff+o345FFrhHWsAZjBpGIyZzCYY=';"; 425 "'sha256-yAvSu2Dl9rlQTpQn8P1hcE5GUFQVGbuCMHypwtN6uDg=';";
426 } 426 }
427 427
428 std::string LocalNtpSource::GetContentSecurityPolicyChildSrc() const { 428 std::string LocalNtpSource::GetContentSecurityPolicyChildSrc() const {
429 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); 429 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
430 430
431 if (one_google_bar_service_) { 431 if (one_google_bar_service_) {
432 // Allow embedding of the most visited iframe, as well as the account 432 // Allow embedding of the most visited iframe, as well as the account
433 // switcher and the notifications dropdown from the One Google Bar. 433 // switcher and the notifications dropdown from the One Google Bar.
434 // TODO(treib): Figure out a way to also allow staging instances. 434 // TODO(treib): Figure out a way to also allow staging instances.
435 return base::StringPrintf( 435 return base::StringPrintf(
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
490 base::Bind(&LocalNtpSource::SetDefaultSearchProviderIsGoogleOnIOThread, 490 base::Bind(&LocalNtpSource::SetDefaultSearchProviderIsGoogleOnIOThread,
491 weak_ptr_factory_.GetWeakPtr(), is_google)); 491 weak_ptr_factory_.GetWeakPtr(), is_google));
492 } 492 }
493 493
494 void LocalNtpSource::SetDefaultSearchProviderIsGoogleOnIOThread( 494 void LocalNtpSource::SetDefaultSearchProviderIsGoogleOnIOThread(
495 bool is_google) { 495 bool is_google) {
496 DCHECK_CURRENTLY_ON(content::BrowserThread::IO); 496 DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
497 497
498 default_search_provider_is_google_io_thread_ = is_google; 498 default_search_provider_is_google_io_thread_ = is_google;
499 } 499 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698