forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathweb_contents_top_sites_observer.h
43 lines (31 loc) · 1.48 KB
/
web_contents_top_sites_observer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef COMPONENTS_HISTORY_CONTENT_BROWSER_WEB_CONTENTS_TOP_SITES_OBSERVER_H_
#define COMPONENTS_HISTORY_CONTENT_BROWSER_WEB_CONTENTS_TOP_SITES_OBSERVER_H_
#include "content/public/browser/web_contents_observer.h"
#include "content/public/browser/web_contents_user_data.h"
namespace history {
class TopSites;
// WebContentsTopSitesObserver forwards navigation events from
// content::WebContents to TopSites.
class WebContentsTopSitesObserver
: public content::WebContentsObserver,
public content::WebContentsUserData<WebContentsTopSitesObserver> {
public:
static void CreateForWebContents(content::WebContents* web_contents,
TopSites* top_sites);
private:
friend class content::WebContentsUserData<WebContentsTopSitesObserver>;
WebContentsTopSitesObserver(content::WebContents* web_contents,
TopSites* top_sites);
~WebContentsTopSitesObserver() override;
// content::WebContentsObserver implementation.
void NavigationEntryCommitted(
const content::LoadCommittedDetails& load_details) override;
// Underlying TopSites instance, may be null during testing.
TopSites* top_sites_;
DISALLOW_COPY_AND_ASSIGN(WebContentsTopSitesObserver);
};
} // namespace history
#endif // COMPONENTS_HISTORY_CONTENT_BROWSER_WEB_CONTENTS_TOP_SITES_OBSERVER_H_