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 1d2b6526c4c5e5bf0bbd3581cecd2a45d405415d..cc4be714650997d71c99a674c2362dac06d606f3 100644 |
--- a/chrome/browser/search/local_ntp_source.h |
+++ b/chrome/browser/search/local_ntp_source.h |
@@ -6,17 +6,24 @@ |
#define CHROME_BROWSER_SEARCH_LOCAL_NTP_SOURCE_H_ |
#include <memory> |
+#include <string> |
+#include <vector> |
-#include "base/compiler_specific.h" |
#include "base/macros.h" |
#include "base/memory/weak_ptr.h" |
+#include "base/optional.h" |
+#include "base/scoped_observer.h" |
+#include "chrome/browser/search/one_google_bar/one_google_bar_service_observer.h" |
#include "content/public/browser/url_data_source.h" |
+struct OneGoogleBarData; |
+class OneGoogleBarService; |
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 OneGoogleBarServiceObserver { |
public: |
explicit LocalNtpSource(Profile* profile); |
@@ -37,11 +44,26 @@ class LocalNtpSource : public content::URLDataSource { |
std::string GetContentSecurityPolicyScriptSrc() const override; |
std::string GetContentSecurityPolicyChildSrc() const override; |
+ // Overridden from OneGoogleBarServiceObserver: |
+ void OnOneGoogleBarDataChanged() override; |
+ void OnOneGoogleBarFetchFailed() override; |
+ void OnOneGoogleBarServiceShuttingDown() override; |
+ |
+ void ServeOneGoogleBar(const OneGoogleBarData& data); |
+ void ServeNullOneGoogleBar(); |
+ |
void DefaultSearchProviderIsGoogleChanged(bool is_google); |
void SetDefaultSearchProviderIsGoogleOnIOThread(bool is_google); |
- Profile* profile_; |
+ Profile* const profile_; |
+ |
+ OneGoogleBarService* one_google_bar_service_; |
+ |
+ ScopedObserver<OneGoogleBarService, OneGoogleBarServiceObserver> |
+ one_google_bar_service_observer_; |
+ |
+ std::vector<content::URLDataSource::GotDataCallback> one_google_callbacks_; |
std::unique_ptr<GoogleSearchProviderTracker> google_tracker_; |
bool default_search_provider_is_google_; |