| OLD | NEW |
| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 void PaintContents(SkCanvas* canvas, const gfx::Rect& clip) override; | 69 void PaintContents(SkCanvas* canvas, const gfx::Rect& clip) override; |
| 70 | 70 |
| 71 void StartDebuggerInspectorBackend(); | 71 void StartDebuggerInspectorBackend(); |
| 72 | 72 |
| 73 void GetPixelsForTesting(std::vector<unsigned char>* pixels); | 73 void GetPixelsForTesting(std::vector<unsigned char>* pixels); |
| 74 | 74 |
| 75 private: | 75 private: |
| 76 // WebWidgetClient methods: | 76 // WebWidgetClient methods: |
| 77 void initializeLayerTreeView() override; | 77 void initializeLayerTreeView() override; |
| 78 void scheduleAnimation() override; | 78 void scheduleAnimation() override; |
| 79 blink::WebScreenInfo screenInfo() override; |
| 79 | 80 |
| 80 // WebFrameClient methods: | 81 // WebFrameClient methods: |
| 81 mojo::View* createChildFrame(const blink::WebURL& url) override; | 82 mojo::View* createChildFrame(const blink::WebURL& url) override; |
| 82 void frameDetached(blink::WebFrame*) override; | 83 void frameDetached(blink::WebFrame*) override; |
| 83 blink::WebNavigationPolicy decidePolicyForNavigation( | 84 blink::WebNavigationPolicy decidePolicyForNavigation( |
| 84 const blink::WebFrameClient::NavigationPolicyInfo& info) override; | 85 const blink::WebFrameClient::NavigationPolicyInfo& info) override; |
| 85 void didAddMessageToConsole( | 86 void didAddMessageToConsole( |
| 86 const blink::WebConsoleMessage& message, | 87 const blink::WebConsoleMessage& message, |
| 87 const blink::WebString& source_name, | 88 const blink::WebString& source_name, |
| 88 unsigned source_line, | 89 unsigned source_line, |
| (...skipping 19 matching lines...) Expand all Loading... |
| 108 // ViewObserver methods: | 109 // ViewObserver methods: |
| 109 void OnViewBoundsChanged(mojo::View* view, | 110 void OnViewBoundsChanged(mojo::View* view, |
| 110 const mojo::Rect& old_bounds, | 111 const mojo::Rect& old_bounds, |
| 111 const mojo::Rect& new_bounds) override; | 112 const mojo::Rect& new_bounds) override; |
| 112 void OnViewFocusChanged(mojo::View* gained_focus, | 113 void OnViewFocusChanged(mojo::View* gained_focus, |
| 113 mojo::View* lost_focus) override; | 114 mojo::View* lost_focus) override; |
| 114 void OnViewDestroyed(mojo::View* view) override; | 115 void OnViewDestroyed(mojo::View* view) override; |
| 115 void OnViewInputEvent(mojo::View* view, const mojo::EventPtr& event) override; | 116 void OnViewInputEvent(mojo::View* view, const mojo::EventPtr& event) override; |
| 116 | 117 |
| 117 void Load(mojo::URLResponsePtr response); | 118 void Load(mojo::URLResponsePtr response); |
| 119 float GetDevicePixelRatio() const; |
| 118 | 120 |
| 119 mojo::URLResponsePtr response_; | 121 mojo::URLResponsePtr response_; |
| 120 mojo::ServiceProviderImpl exported_services_; | 122 mojo::ServiceProviderImpl exported_services_; |
| 121 scoped_ptr<mojo::ServiceProvider> imported_services_; | 123 scoped_ptr<mojo::ServiceProvider> imported_services_; |
| 122 mojo::Shell* shell_; | 124 mojo::Shell* shell_; |
| 123 mojo::LazyInterfacePtr<mojo::NavigatorHost> navigator_host_; | 125 mojo::LazyInterfacePtr<mojo::NavigatorHost> navigator_host_; |
| 124 blink::WebView* web_view_; | 126 blink::WebView* web_view_; |
| 125 mojo::View* root_; | 127 mojo::View* root_; |
| 126 mojo::ViewManagerClientFactory view_manager_client_factory_; | 128 mojo::ViewManagerClientFactory view_manager_client_factory_; |
| 127 InspectorServiceFactory inspector_service_factory_; | 129 InspectorServiceFactory inspector_service_factory_; |
| 128 scoped_ptr<LayerHost> layer_host_; | 130 scoped_ptr<LayerHost> layer_host_; |
| 129 scoped_refptr<Layer> root_layer_; | 131 scoped_refptr<Layer> root_layer_; |
| 130 scoped_ptr<ScriptRunner> script_runner_; | 132 scoped_ptr<ScriptRunner> script_runner_; |
| 131 scoped_ptr<InspectorHostImpl> inspector_host_; | 133 scoped_ptr<InspectorHostImpl> inspector_host_; |
| 132 scoped_ptr<inspector::InspectorBackendMojo> inspector_backend_; | 134 scoped_ptr<inspector::InspectorBackendMojo> inspector_backend_; |
| 133 base::WeakPtrFactory<DocumentView> weak_factory_; | 135 base::WeakPtrFactory<DocumentView> weak_factory_; |
| 134 int debugger_id_; | 136 int debugger_id_; |
| 135 | 137 |
| 136 DISALLOW_COPY_AND_ASSIGN(DocumentView); | 138 DISALLOW_COPY_AND_ASSIGN(DocumentView); |
| 137 }; | 139 }; |
| 138 | 140 |
| 139 } // namespace sky | 141 } // namespace sky |
| 140 | 142 |
| 141 #endif // SKY_VIEWER_DOCUMENT_VIEW_H_ | 143 #endif // SKY_VIEWER_DOCUMENT_VIEW_H_ |
| OLD | NEW |