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

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

Issue 2819553003: Hook up LocalNtpSource to OneGoogleBarService (Closed)
Patch Set: Tests! 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
« no previous file with comments | « chrome/browser/resources/local_ntp/local_ntp.js ('k') | chrome/browser/search/local_ntp_source.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « chrome/browser/resources/local_ntp/local_ntp.js ('k') | chrome/browser/search/local_ntp_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698