Chromium Code Reviews| Index: mojo/services/html_viewer/html_document_view.h |
| diff --git a/mojo/services/html_viewer/html_document_view.h b/mojo/services/html_viewer/html_document_view.h |
| index af315bb75fb25c9e3f1b13abd0c016eb25d27d14..fccd5a9453345f75b88a8b028117f58399167760 100644 |
| --- a/mojo/services/html_viewer/html_document_view.h |
| +++ b/mojo/services/html_viewer/html_document_view.h |
| @@ -19,9 +19,42 @@ namespace mojo { |
| class ViewManager; |
| class View; |
| +class SimpleFrameClient : public blink::WebFrameClient { |
| + public: |
| + SimpleFrameClient(ServiceProvider* service_provider, Id root_id); |
| + virtual ~SimpleFrameClient(); |
| + |
| + protected: |
| + // WebFrameClient methods: |
| + virtual blink::WebFrame* createChildFrame(blink::WebLocalFrame* parent, |
| + const blink::WebString& frameName); |
| + virtual void didDisownOpener(blink::WebLocalFrame*); |
| + virtual void frameDetached(blink::WebFrame*); |
| + virtual void frameFocused(); |
| + virtual void willClose(blink::WebFrame*); |
| + virtual blink::WebCookieJar* cookieJar(blink::WebLocalFrame* frame); |
| + virtual blink::WebNavigationPolicy decidePolicyForNavigation( |
| + blink::WebLocalFrame* frame, blink::WebDataSource::ExtraData* data, |
| + const blink::WebURLRequest& request, blink::WebNavigationType nav_type, |
| + blink::WebNavigationPolicy default_policy, bool isRedirect); |
| + virtual void didAddMessageToConsole( |
| + const blink::WebConsoleMessage& message, |
| + const blink::WebString& source_name, |
| + unsigned source_line, |
| + const blink::WebString& stack_trace); |
| + virtual void didNavigateWithinPage( |
| + blink::WebLocalFrame* frame, |
| + const blink::WebHistoryItem& history_item, |
| + blink::WebHistoryCommitType commit_type); |
| + |
| + ServiceProvider* service_provider_; |
| + LazyInterfacePtr<NavigatorHost> navigator_host_; |
| + Id root_id_; |
| +}; |
| + |
| // A view for a single HTML document. |
| class HTMLDocumentView : public blink::WebViewClient, |
| - public blink::WebFrameClient, |
| + public SimpleFrameClient, |
|
darin (slow to review)
2014/08/14 23:45:52
perhaps it would be better to use composition here
|
| public ViewObserver { |
| public: |
| HTMLDocumentView(ServiceProvider* service_provider, |
| @@ -40,22 +73,6 @@ class HTMLDocumentView : public blink::WebViewClient, |
| virtual void didInvalidateRect(const blink::WebRect& rect); |
| virtual bool allowsBrokenNullLayerTreeView() const; |
| - // WebFrameClient methods: |
| - virtual blink::WebCookieJar* cookieJar(blink::WebLocalFrame* frame); |
| - virtual blink::WebNavigationPolicy decidePolicyForNavigation( |
| - blink::WebLocalFrame* frame, blink::WebDataSource::ExtraData* data, |
| - const blink::WebURLRequest& request, blink::WebNavigationType nav_type, |
| - blink::WebNavigationPolicy default_policy, bool isRedirect); |
| - virtual void didAddMessageToConsole( |
| - const blink::WebConsoleMessage& message, |
| - const blink::WebString& source_name, |
| - unsigned source_line, |
| - const blink::WebString& stack_trace); |
| - virtual void didNavigateWithinPage( |
| - blink::WebLocalFrame* frame, |
| - const blink::WebHistoryItem& history_item, |
| - blink::WebHistoryCommitType commit_type); |
| - |
| // ViewObserver methods: |
| virtual void OnViewBoundsChanged(View* view, |
| const gfx::Rect& old_bounds, |
| @@ -66,11 +83,9 @@ class HTMLDocumentView : public blink::WebViewClient, |
| void Repaint(); |
| ViewManager* view_manager_; |
| - View* view_; |
| blink::WebView* web_view_; |
| View* root_; |
| bool repaint_pending_; |
| - LazyInterfacePtr<NavigatorHost> navigator_host_; |
| base::WeakPtrFactory<HTMLDocumentView> weak_factory_; |
| DISALLOW_COPY_AND_ASSIGN(HTMLDocumentView); |