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

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

Issue 16413002: Moved theme related state from BrowserInstantController to InstantService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 6 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 | « no previous file | chrome/browser/search/instant_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search/instant_service.h
diff --git a/chrome/browser/search/instant_service.h b/chrome/browser/search/instant_service.h
index 4832dedc21ef65289c1739bd4138519831b228e5..31660a165a0b179830c7a1454962c13d74cca87d 100644
--- a/chrome/browser/search/instant_service.h
+++ b/chrome/browser/search/instant_service.h
@@ -13,7 +13,9 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
+#include "base/observer_list.h"
#include "chrome/browser/history/history_types.h"
#include "chrome/common/instant_types.h"
#include "components/browser_context_keyed_service/browser_context_keyed_service.h"
@@ -22,7 +24,9 @@
class GURL;
class InstantIOContext;
+class InstantServiceObserver;
class Profile;
+class ThemeService;
namespace net {
class URLRequest;
@@ -40,6 +44,10 @@ class InstantService : public BrowserContextKeyedService,
void AddInstantProcess(int process_id);
bool IsInstantProcess(int process_id) const;
+ // Adds/Removes InstantService observers.
+ void AddObserver(InstantServiceObserver* observer);
+ void RemoveObserver(InstantServiceObserver* observer);
+
#if defined(UNIT_TEST)
int GetInstantProcessCount() const {
return process_ids_.size();
@@ -64,6 +72,12 @@ class InstantService : public BrowserContextKeyedService,
void GetCurrentMostVisitedItems(
std::vector<InstantMostVisitedItem>* items) const;
+ // Invoked by the InstantController to update theme information for NTP.
+ //
+ // TODO(kmadhusu): Invoking this from InstantController shouldn't be
+ // necessary. Investigate more and remove this from here.
+ void UpdateThemeInfo();
+
private:
// Overridden from BrowserContextKeyedService:
virtual void Shutdown() OVERRIDE;
@@ -78,6 +92,9 @@ class InstantService : public BrowserContextKeyedService,
// SendMostVisitedItems.
void OnMostVisitedItemsReceived(const history::MostVisitedURLList& data);
+ // Theme changed notification handler.
+ void OnThemeChanged(ThemeService* theme_service);
+
Profile* const profile_;
// The process ids associated with Instant processes.
@@ -86,6 +103,11 @@ class InstantService : public BrowserContextKeyedService,
// InstantMostVisitedItems sent to the Instant Pages.
std::vector<InstantMostVisitedItem> most_visited_items_;
+ // Theme-related data for NTP overlay to adopt themes.
+ scoped_ptr<ThemeBackgroundInfo> theme_info_;
+
+ ObserverList<InstantServiceObserver> observers_;
+
content::NotificationRegistrar registrar_;
scoped_refptr<InstantIOContext> instant_io_context_;
« no previous file with comments | « no previous file | chrome/browser/search/instant_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698