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

Unified Diff: chrome/browser/search/local_ntp_source.h

Issue 2805133004: Local NTP: Deploy strict-dynamic CSP (Closed)
Patch Set: fix Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/search/local_ntp_source.h
diff --git a/chrome/browser/search/local_ntp_source.h b/chrome/browser/search/local_ntp_source.h
index 24d81dc9c55fbdc15eea2a785108e1968c35c295..482a870101f70fc8c694f3ddae75c426c6eb4e3d 100644
--- a/chrome/browser/search/local_ntp_source.h
+++ b/chrome/browser/search/local_ntp_source.h
@@ -7,13 +7,17 @@
#include "base/compiler_specific.h"
#include "base/macros.h"
+#include "base/scoped_observer.h"
+#include "chrome/browser/search/google_search_provider_service_observer.h"
#include "content/public/browser/url_data_source.h"
+class GoogleSearchProviderService;
class Profile;
// Serves HTML and resources for the local new tab page i.e.
// chrome-search://local-ntp/local-ntp.html
-class LocalNtpSource : public content::URLDataSource {
+class LocalNtpSource : public content::URLDataSource,
+ public GoogleSearchProviderServiceObserver {
public:
explicit LocalNtpSource(Profile* profile);
@@ -29,10 +33,19 @@ class LocalNtpSource : public content::URLDataSource {
std::string GetMimeType(const std::string& path) const override;
bool AllowCaching() const override;
bool ShouldServiceRequest(const net::URLRequest* request) const override;
+ std::string GetContentSecurityPolicyScriptSrc() const override;
std::string GetContentSecurityPolicyChildSrc() const override;
+ // Overridden from GoogleSearchProviderServiceObserver:
+ void OnDefaultSearchProviderIsGoogleChanged(bool is_google) override;
+ void OnGoogleSearchProviderServiceShuttingDown() override;
+
Profile* profile_;
+ ScopedObserver<GoogleSearchProviderService, LocalNtpSource>
+ default_search_provider_observer_;
+ bool default_search_provider_is_google_;
+
DISALLOW_COPY_AND_ASSIGN(LocalNtpSource);
};

Powered by Google App Engine
This is Rietveld 408576698