| 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 MOJO_SERVICES_HTML_VIEWER_HTML_DOCUMENT_H_ | 5 #ifndef MOJO_SERVICES_HTML_VIEWER_HTML_DOCUMENT_H_ |
| 6 #define MOJO_SERVICES_HTML_VIEWER_HTML_DOCUMENT_H_ | 6 #define MOJO_SERVICES_HTML_VIEWER_HTML_DOCUMENT_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // Commonly, the connecting application is the ViewManager and it will | 59 // Commonly, the connecting application is the ViewManager and it will |
| 60 // request ViewManagerClient. | 60 // request ViewManagerClient. |
| 61 // | 61 // |
| 62 // |shell| is the Shell connection for this mojo::Application. | 62 // |shell| is the Shell connection for this mojo::Application. |
| 63 HTMLDocument(mojo::InterfaceRequest<mojo::ServiceProvider> services, | 63 HTMLDocument(mojo::InterfaceRequest<mojo::ServiceProvider> services, |
| 64 mojo::URLResponsePtr response, | 64 mojo::URLResponsePtr response, |
| 65 mojo::Shell* shell, | 65 mojo::Shell* shell, |
| 66 scoped_refptr<base::MessageLoopProxy> compositor_thread, | 66 scoped_refptr<base::MessageLoopProxy> compositor_thread, |
| 67 WebMediaPlayerFactory* web_media_player_factory, | 67 WebMediaPlayerFactory* web_media_player_factory, |
| 68 bool is_headless); | 68 bool is_headless); |
| 69 virtual ~HTMLDocument(); | 69 ~HTMLDocument() override; |
| 70 | 70 |
| 71 private: | 71 private: |
| 72 // Updates the size and scale factor of the webview and related classes from | 72 // Updates the size and scale factor of the webview and related classes from |
| 73 // |root_|. | 73 // |root_|. |
| 74 void UpdateWebviewSizeFromViewSize(); | 74 void UpdateWebviewSizeFromViewSize(); |
| 75 | 75 |
| 76 // WebViewClient methods: | 76 // WebViewClient methods: |
| 77 virtual blink::WebStorageNamespace* createSessionStorageNamespace(); | 77 blink::WebStorageNamespace* createSessionStorageNamespace() override; |
| 78 | 78 |
| 79 // WebWidgetClient methods: | 79 // WebWidgetClient methods: |
| 80 virtual void initializeLayerTreeView(); | 80 void initializeLayerTreeView() override; |
| 81 virtual blink::WebLayerTreeView* layerTreeView(); | 81 blink::WebLayerTreeView* layerTreeView() override; |
| 82 | 82 |
| 83 // WebFrameClient methods: | 83 // WebFrameClient methods: |
| 84 virtual blink::WebMediaPlayer* createMediaPlayer( | 84 virtual blink::WebMediaPlayer* createMediaPlayer( |
| 85 blink::WebLocalFrame* frame, | 85 blink::WebLocalFrame* frame, |
| 86 const blink::WebURL& url, | 86 const blink::WebURL& url, |
| 87 blink::WebMediaPlayerClient* client); | 87 blink::WebMediaPlayerClient* client); |
| 88 virtual blink::WebMediaPlayer* createMediaPlayer( | 88 blink::WebMediaPlayer* createMediaPlayer( |
| 89 blink::WebLocalFrame* frame, | 89 blink::WebLocalFrame* frame, |
| 90 const blink::WebURL& url, | 90 const blink::WebURL& url, |
| 91 blink::WebMediaPlayerClient* client, | 91 blink::WebMediaPlayerClient* client, |
| 92 blink::WebContentDecryptionModule* initial_cdm); | 92 blink::WebContentDecryptionModule* initial_cdm) override; |
| 93 virtual blink::WebFrame* createChildFrame( | 93 blink::WebFrame* createChildFrame( |
| 94 blink::WebLocalFrame* parent, | 94 blink::WebLocalFrame* parent, |
| 95 const blink::WebString& frameName, | 95 const blink::WebString& frameName, |
| 96 blink::WebSandboxFlags sandboxFlags); | 96 blink::WebSandboxFlags sandboxFlags) override; |
| 97 virtual void frameDetached(blink::WebFrame*); | 97 void frameDetached(blink::WebFrame*) override; |
| 98 virtual blink::WebCookieJar* cookieJar(blink::WebLocalFrame* frame); | 98 blink::WebCookieJar* cookieJar(blink::WebLocalFrame* frame) override; |
| 99 virtual blink::WebNavigationPolicy decidePolicyForNavigation( | 99 blink::WebNavigationPolicy decidePolicyForNavigation( |
| 100 blink::WebLocalFrame* frame, | 100 blink::WebLocalFrame* frame, |
| 101 blink::WebDataSource::ExtraData* data, | 101 blink::WebDataSource::ExtraData* data, |
| 102 const blink::WebURLRequest& request, | 102 const blink::WebURLRequest& request, |
| 103 blink::WebNavigationType nav_type, | 103 blink::WebNavigationType nav_type, |
| 104 blink::WebNavigationPolicy default_policy, | 104 blink::WebNavigationPolicy default_policy, |
| 105 bool isRedirect); | 105 bool isRedirect) override; |
| 106 virtual void didAddMessageToConsole(const blink::WebConsoleMessage& message, | 106 void didAddMessageToConsole(const blink::WebConsoleMessage& message, |
| 107 const blink::WebString& source_name, | 107 const blink::WebString& source_name, |
| 108 unsigned source_line, | 108 unsigned source_line, |
| 109 const blink::WebString& stack_trace); | 109 const blink::WebString& stack_trace) override; |
| 110 virtual void didNavigateWithinPage(blink::WebLocalFrame* frame, | 110 void didNavigateWithinPage(blink::WebLocalFrame* frame, |
| 111 const blink::WebHistoryItem& history_item, | 111 const blink::WebHistoryItem& history_item, |
| 112 blink::WebHistoryCommitType commit_type); | 112 blink::WebHistoryCommitType commit_type) override; |
| 113 virtual blink::WebEncryptedMediaClient* encryptedMediaClient(); | 113 blink::WebEncryptedMediaClient* encryptedMediaClient() override; |
| 114 | 114 |
| 115 // ViewManagerDelegate methods: | 115 // ViewManagerDelegate methods: |
| 116 void OnEmbed(mojo::View* root, | 116 void OnEmbed(mojo::View* root, |
| 117 mojo::InterfaceRequest<mojo::ServiceProvider> services, | 117 mojo::InterfaceRequest<mojo::ServiceProvider> services, |
| 118 mojo::ServiceProviderPtr exposed_services) override; | 118 mojo::ServiceProviderPtr exposed_services) override; |
| 119 void OnViewManagerDisconnected(mojo::ViewManager* view_manager) override; | 119 void OnViewManagerDisconnected(mojo::ViewManager* view_manager) override; |
| 120 | 120 |
| 121 // ViewObserver methods: | 121 // ViewObserver methods: |
| 122 void OnViewBoundsChanged(mojo::View* view, | 122 void OnViewBoundsChanged(mojo::View* view, |
| 123 const mojo::Rect& old_bounds, | 123 const mojo::Rect& old_bounds, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 152 | 152 |
| 153 // Set if the content will never be displayed. | 153 // Set if the content will never be displayed. |
| 154 bool is_headless_; | 154 bool is_headless_; |
| 155 | 155 |
| 156 DISALLOW_COPY_AND_ASSIGN(HTMLDocument); | 156 DISALLOW_COPY_AND_ASSIGN(HTMLDocument); |
| 157 }; | 157 }; |
| 158 | 158 |
| 159 } // namespace html_viewer | 159 } // namespace html_viewer |
| 160 | 160 |
| 161 #endif // MOJO_SERVICES_HTML_VIEWER_HTML_DOCUMENT_H_ | 161 #endif // MOJO_SERVICES_HTML_VIEWER_HTML_DOCUMENT_H_ |
| OLD | NEW |