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

Side by Side Diff: components/dom_distiller/content/browser/distillability_driver.h

Issue 1434433002: Pass distillability updates from renderer to browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@model
Patch Set: merge depend, and update interface again Created 5 years, 1 month 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
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DISTILLIBILITY_DRIVER_H_
6 #define COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DISTILLIBILITY_DRIVER_H_
7
8 #include "base/macros.h"
9 #include "content/public/browser/web_contents_observer.h"
10 #include "content/public/browser/web_contents_user_data.h"
11
12 namespace dom_distiller {
13
14 // This is an IPC helper for determining whether a page should be distilled.
15 class WebContentsDistillabilityDriver
blundell 2015/11/05 09:42:41 drive-by nit: this should be named web_contents_do
wychen 2015/11/12 04:59:45 Changed the class name.
16 : public content::WebContentsObserver,
17 public content::WebContentsUserData<WebContentsDistillabilityDriver> {
18 public:
19 ~WebContentsDistillabilityDriver() override;
20
21 void SetDelegate(const base::Callback<void(bool, bool)>& delegate);
22
23 // content::WebContentsObserver implementation.
24 bool OnMessageReceived(const IPC::Message& message,
25 content::RenderFrameHost* rfh) override;
26 void RenderProcessGone(base::TerminationStatus status) override;
27
28 private:
29 explicit WebContentsDistillabilityDriver(content::WebContents* web_contents);
30 friend class content::WebContentsUserData<WebContentsDistillabilityDriver>;
31
32 void OnDistillability(bool distillable, bool is_last);
33
34 // Removes the observer and clears the WebContents member.
35 void CleanUp();
36
37 base::Callback<void(bool, bool)> m_delegate_;
38
39 DISALLOW_COPY_AND_ASSIGN(WebContentsDistillabilityDriver);
40 };
41
42 } // namespace dom_distiller
43
44 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DISTILLIBILITY_DRIVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698