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

Side by Side Diff: chrome/browser/history/chrome_history_client.h

Issue 441623002: Eliminate sending NOTIFICATION_TOP_SITES_* from TopSites (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixing the commit message Created 6 years, 4 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
« no previous file with comments | « no previous file | chrome/browser/history/chrome_history_client.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_HISTORY_CHROME_HISTORY_CLIENT_H_ 5 #ifndef CHROME_BROWSER_HISTORY_CHROME_HISTORY_CLIENT_H_
6 #define CHROME_BROWSER_HISTORY_CHROME_HISTORY_CLIENT_H_ 6 #define CHROME_BROWSER_HISTORY_CHROME_HISTORY_CLIENT_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "components/history/core/browser/history_client.h" 9 #include "components/history/core/browser/history_client.h"
10 #include "components/history/core/browser/top_sites_observer.h"
10 11
11 class BookmarkModel; 12 class BookmarkModel;
13 class Profile;
14
15 namespace history {
16 class TopSites;
17 }
12 18
13 // This class implements history::HistoryClient to abstract operations that 19 // This class implements history::HistoryClient to abstract operations that
14 // depend on Chrome environment. 20 // depend on Chrome environment.
15 class ChromeHistoryClient : public history::HistoryClient { 21 class ChromeHistoryClient : public history::HistoryClient,
22 public history::TopSitesObserver {
16 public: 23 public:
17 explicit ChromeHistoryClient(BookmarkModel* bookmark_model); 24 explicit ChromeHistoryClient(BookmarkModel* bookmark_model,
25 Profile* profile,
26 history::TopSites* top_sites);
27 virtual ~ChromeHistoryClient();
18 28
19 // history::HistoryClient: 29 // history::HistoryClient:
20 virtual void BlockUntilBookmarksLoaded() OVERRIDE; 30 virtual void BlockUntilBookmarksLoaded() OVERRIDE;
21 virtual bool IsBookmarked(const GURL& url) OVERRIDE; 31 virtual bool IsBookmarked(const GURL& url) OVERRIDE;
22 virtual void GetBookmarks( 32 virtual void GetBookmarks(
23 std::vector<history::URLAndTitle>* bookmarks) OVERRIDE; 33 std::vector<history::URLAndTitle>* bookmarks) OVERRIDE;
24 virtual void NotifyProfileError(sql::InitStatus init_status) OVERRIDE; 34 virtual void NotifyProfileError(sql::InitStatus init_status) OVERRIDE;
25 virtual bool ShouldReportDatabaseError() OVERRIDE; 35 virtual bool ShouldReportDatabaseError() OVERRIDE;
26 36
27 // KeyedService: 37 // KeyedService:
28 virtual void Shutdown() OVERRIDE; 38 virtual void Shutdown() OVERRIDE;
29 39
40 // TopSitesObserver:
41 virtual void TopSitesLoaded(history::TopSites* top_sites) OVERRIDE;
42 virtual void TopSitesChanged(history::TopSites* top_sites) OVERRIDE;
43
30 private: 44 private:
31 // The BookmarkModel, this should outlive ChromeHistoryClient. 45 // The BookmarkModel, this should outlive ChromeHistoryClient.
32 BookmarkModel* bookmark_model_; 46 BookmarkModel* bookmark_model_;
47 Profile* profile_;
48 history::TopSites* top_sites_;
brettw 2014/08/19 22:51:58 Can you put a comment here like you did in the cod
nshaik 2014/08/20 18:31:35 Done.
33 49
34 DISALLOW_COPY_AND_ASSIGN(ChromeHistoryClient); 50 DISALLOW_COPY_AND_ASSIGN(ChromeHistoryClient);
35 }; 51 };
36 52
37 #endif // CHROME_BROWSER_HISTORY_CHROME_HISTORY_CLIENT_H_ 53 #endif // CHROME_BROWSER_HISTORY_CHROME_HISTORY_CLIENT_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/history/chrome_history_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698