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

Side by Side Diff: components/dom_distiller/webui/dom_distiller_viewer_handler.h

Issue 105723002: Add the scheme chrome-distiller:// and hook up data source. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changed to use onReceived for javascript Created 7 years 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 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_WEBUI_DOM_DISTILLER_VIEWER_HANDLER_H_
6 #define COMPONENTS_DOM_DISTILLER_WEBUI_DOM_DISTILLER_VIEWER_HANDLER_H_
7
8 #include <vector>
9
10 #include "base/memory/weak_ptr.h"
11 #include "base/values.h"
12 #include "content/public/browser/web_contents_observer.h"
13 #include "content/public/browser/web_ui_message_handler.h"
14 #include "url/gurl.h"
15
16 namespace dom_distiller {
17
18 class DistilledPageProto;
19 class DomDistillerService;
20 class ViewerHandle;
21
22 // Handler class for DOM Distiller viewing operations.
23 class DomDistillerViewerHandler : public content::WebUIMessageHandler,
24 public content::WebContentsObserver {
25 public:
26 DomDistillerViewerHandler(DomDistillerService* service,
27 const GURL& url,
28 content::WebContents* web_contents);
29 virtual ~DomDistillerViewerHandler();
30
31 // content::WebUIMessageHandler implementation.
32 virtual void RegisterMessages() OVERRIDE;
33
34 // content::WebContentsObserver implementation.
35 virtual void DidFinishLoad(
36 int64 frame_num,
37 const GURL& validated_url,
38 bool is_main_frame,
39 content::RenderViewHost* render_view_host) OVERRIDE;
40 virtual void DidFailLoad(
41 int64 frame_num,
42 const GURL& validated_url,
43 bool is_main_frame,
44 int error_code,
45 const string16& error_description,
46 content::RenderViewHost* render_view_host) OVERRIDE;
47
48 private:
49 // Factory for the creating refs in callbacks.
50 base::WeakPtrFactory<DomDistillerViewerHandler> weak_ptr_factory_;
51
52 // The DomDistillerService.
53 DomDistillerService* service_;
54
55 // The URL of the current WebUI.
56 const GURL url_;
57
58 DISALLOW_COPY_AND_ASSIGN(DomDistillerViewerHandler);
59 };
60
61 } // namespace dom_distiller
62
63 #endif // COMPONENTS_DOM_DISTILLER_WEBUI_DOM_DISTILLER_VIEWER_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698