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

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

Issue 1248643004: Test distillability without JavaScript (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@early
Patch Set: fix browsertest, merge webkit CL, merge http://crrev.com/1403413004 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 "content/public/browser/web_contents_observer.h"
9 #include "content/public/browser/web_contents_user_data.h"
10
11 namespace dom_distiller {
12
13 // This is an IPC helper for determining whether a page should be distilled.
14 class WebContentsDistillabilityDriver
15 : public content::WebContentsObserver,
16 public content::WebContentsUserData<WebContentsDistillabilityDriver> {
17 public:
18 ~WebContentsDistillabilityDriver() override;
19
20 void SetCallback(const base::Callback<void(bool, bool)>& callback);
21
22 // content::WebContentsObserver implementation.
23 bool OnMessageReceived(const IPC::Message& message,
24 content::RenderFrameHost* rfh) override;
25 void RenderProcessGone(base::TerminationStatus status) override;
26
27 private:
28 explicit WebContentsDistillabilityDriver(content::WebContents* web_contents);
29 friend class content::WebContentsUserData<WebContentsDistillabilityDriver>;
30
31 void OnDistillability(bool distillable, bool is_last);
32
33 // Removes the observer and clears the WebContents member.
34 void CleanUp();
35
36 base::Callback<void(bool, bool)> m_callback_;
37
38 DISALLOW_COPY_AND_ASSIGN(WebContentsDistillabilityDriver);
39 };
40
41 } // namespace dom_distiller
42
43 #endif // COMPONENTS_DOM_DISTILLER_CONTENT_BROWSER_DISTILLIBILITY_DRIVER_H_
OLDNEW
« no previous file with comments | « components/dom_distiller/content/DEPS ('k') | components/dom_distiller/content/browser/distillability_driver.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698