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

Side by Side Diff: sky/viewer/document_view.h

Issue 797063002: Make reftests work for sky. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: cleanup Created 6 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
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 SKY_VIEWER_DOCUMENT_VIEW_H_ 5 #ifndef SKY_VIEWER_DOCUMENT_VIEW_H_
6 #define SKY_VIEWER_DOCUMENT_VIEW_H_ 6 #define SKY_VIEWER_DOCUMENT_VIEW_H_
7 7
8 #include "base/callback.h" 8 #include "base/callback.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "mojo/public/cpp/application/lazy_interface_ptr.h" 10 #include "mojo/public/cpp/application/lazy_interface_ptr.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 class DocumentView : public blink::ServiceProvider, 42 class DocumentView : public blink::ServiceProvider,
43 public blink::WebViewClient, 43 public blink::WebViewClient,
44 public blink::WebFrameClient, 44 public blink::WebFrameClient,
45 public sky::LayerClient, 45 public sky::LayerClient,
46 public sky::LayerHostClient, 46 public sky::LayerHostClient,
47 public mojo::ViewManagerDelegate, 47 public mojo::ViewManagerDelegate,
48 public mojo::ViewObserver { 48 public mojo::ViewObserver {
49 public: 49 public:
50 DocumentView(mojo::ServiceProviderPtr provider, 50 DocumentView(mojo::ServiceProviderPtr provider,
51 mojo::URLResponsePtr response, 51 mojo::URLResponsePtr response,
52 mojo::Shell* shell); 52 mojo::Shell* shell,
53 bool is_testing);
53 virtual ~DocumentView(); 54 virtual ~DocumentView();
54 55
55 base::WeakPtr<DocumentView> GetWeakPtr(); 56 base::WeakPtr<DocumentView> GetWeakPtr();
56 57
57 blink::WebView* web_view() const { return web_view_; } 58 blink::WebView* web_view() const { return web_view_; }
58 mojo::ServiceProvider* imported_services() const { 59 mojo::ServiceProvider* imported_services() const {
59 return imported_services_.get(); 60 return imported_services_.get();
60 } 61 }
61 62
62 mojo::Shell* shell() const { return shell_; } 63 mojo::Shell* shell() const { return shell_; }
63 64
64 // sky::LayerHostClient 65 // sky::LayerHostClient
65 mojo::Shell* GetShell() override; 66 mojo::Shell* GetShell() override;
66 void BeginFrame(base::TimeTicks frame_time) override; 67 void BeginFrame(base::TimeTicks frame_time) override;
67 void OnSurfaceIdAvailable(mojo::SurfaceIdPtr surface_id) override; 68 void OnSurfaceIdAvailable(mojo::SurfaceIdPtr surface_id) override;
68 // sky::LayerClient 69 // sky::LayerClient
69 void PaintContents(SkCanvas* canvas, const gfx::Rect& clip) override; 70 void PaintContents(SkCanvas* canvas, const gfx::Rect& clip) override;
70 71
71 void StartDebuggerInspectorBackend(); 72 void StartDebuggerInspectorBackend();
72 73
74 std::string GetPixelsForTesting();
75
73 private: 76 private:
74 // WebWidgetClient methods: 77 // WebWidgetClient methods:
75 void initializeLayerTreeView() override; 78 void initializeLayerTreeView() override;
76 void scheduleAnimation() override; 79 void scheduleAnimation() override;
77 80
78 // WebFrameClient methods: 81 // WebFrameClient methods:
79 mojo::View* createChildFrame(const blink::WebURL& url) override; 82 mojo::View* createChildFrame(const blink::WebURL& url) override;
80 void frameDetached(blink::WebFrame*) override; 83 void frameDetached(blink::WebFrame*) override;
81 blink::WebNavigationPolicy decidePolicyForNavigation( 84 blink::WebNavigationPolicy decidePolicyForNavigation(
82 const blink::WebFrameClient::NavigationPolicyInfo& info) override; 85 const blink::WebFrameClient::NavigationPolicyInfo& info) override;
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 mojo::LazyInterfacePtr<mojo::NavigatorHost> navigator_host_; 125 mojo::LazyInterfacePtr<mojo::NavigatorHost> navigator_host_;
123 blink::WebView* web_view_; 126 blink::WebView* web_view_;
124 mojo::View* root_; 127 mojo::View* root_;
125 mojo::ViewManagerClientFactory view_manager_client_factory_; 128 mojo::ViewManagerClientFactory view_manager_client_factory_;
126 InspectorServiceFactory inspector_service_factory_; 129 InspectorServiceFactory inspector_service_factory_;
127 scoped_ptr<LayerHost> layer_host_; 130 scoped_ptr<LayerHost> layer_host_;
128 scoped_refptr<Layer> root_layer_; 131 scoped_refptr<Layer> root_layer_;
129 scoped_ptr<ScriptRunner> script_runner_; 132 scoped_ptr<ScriptRunner> script_runner_;
130 scoped_ptr<InspectorHostImpl> inspector_host_; 133 scoped_ptr<InspectorHostImpl> inspector_host_;
131 scoped_ptr<inspector::InspectorBackendMojo> inspector_backend_; 134 scoped_ptr<inspector::InspectorBackendMojo> inspector_backend_;
135 base::WeakPtrFactory<DocumentView> weak_factory_;
132 int debugger_id_; 136 int debugger_id_;
137 bool is_testing_;
133 138
134 base::WeakPtrFactory<DocumentView> weak_factory_;
135 DISALLOW_COPY_AND_ASSIGN(DocumentView); 139 DISALLOW_COPY_AND_ASSIGN(DocumentView);
136 }; 140 };
137 141
138 } // namespace sky 142 } // namespace sky
139 143
140 #endif // SKY_VIEWER_DOCUMENT_VIEW_H_ 144 #endif // SKY_VIEWER_DOCUMENT_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698