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 COMPONENTS_HTML_VIEWER_HTML_DOCUMENT_H_ | 5 #ifndef COMPONENTS_HTML_VIEWER_HTML_DOCUMENT_H_ |
6 #define COMPONENTS_HTML_VIEWER_HTML_DOCUMENT_H_ | 6 #define COMPONENTS_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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 | 74 |
75 // Load a new HTMLDocument with |response|. | 75 // Load a new HTMLDocument with |response|. |
76 // |html_document_app| is the application this app was created in, and | 76 // |html_document_app| is the application this app was created in, and |
77 // |connection| the specific connection triggering this new instance. | 77 // |connection| the specific connection triggering this new instance. |
78 // |setup| is used to obtain init type state (such as resources). | 78 // |setup| is used to obtain init type state (such as resources). |
79 explicit HTMLDocument(CreateParams* params); | 79 explicit HTMLDocument(CreateParams* params); |
80 | 80 |
81 // Deletes this object. | 81 // Deletes this object. |
82 void Destroy(); | 82 void Destroy(); |
83 | 83 |
84 private: | 84 blink::WebView* web_view() const { return web_view_; } |
85 // Data associated with a child iframe. | |
86 struct ChildFrameData { | |
87 mojo::View* view; | |
88 blink::WebTreeScopeType scope; | |
89 }; | |
90 | 85 |
| 86 protected: |
91 ~HTMLDocument() override; | 87 ~HTMLDocument() override; |
92 | 88 |
93 // Updates the size and scale factor of the webview and related classes from | |
94 // |root_|. | |
95 void UpdateWebviewSizeFromViewSize(); | |
96 | |
97 void InitGlobalStateAndLoadIfNecessary(); | |
98 | |
99 // WebViewClient methods: | 89 // WebViewClient methods: |
100 virtual blink::WebStorageNamespace* createSessionStorageNamespace(); | 90 virtual blink::WebStorageNamespace* createSessionStorageNamespace(); |
101 | 91 |
102 // WebWidgetClient methods: | 92 // WebWidgetClient methods: |
103 void initializeLayerTreeView() override; | 93 void initializeLayerTreeView() override; |
104 blink::WebLayerTreeView* layerTreeView() override; | 94 blink::WebLayerTreeView* layerTreeView() override; |
105 | 95 |
106 // WebFrameClient methods: | 96 // WebFrameClient methods: |
107 virtual blink::WebMediaPlayer* createMediaPlayer( | 97 virtual blink::WebMediaPlayer* createMediaPlayer( |
108 blink::WebLocalFrame* frame, | 98 blink::WebLocalFrame* frame, |
(...skipping 14 matching lines...) Expand all Loading... |
123 virtual void didAddMessageToConsole(const blink::WebConsoleMessage& message, | 113 virtual void didAddMessageToConsole(const blink::WebConsoleMessage& message, |
124 const blink::WebString& source_name, | 114 const blink::WebString& source_name, |
125 unsigned source_line, | 115 unsigned source_line, |
126 const blink::WebString& stack_trace); | 116 const blink::WebString& stack_trace); |
127 virtual void didFinishLoad(blink::WebLocalFrame* frame); | 117 virtual void didFinishLoad(blink::WebLocalFrame* frame); |
128 virtual void didNavigateWithinPage(blink::WebLocalFrame* frame, | 118 virtual void didNavigateWithinPage(blink::WebLocalFrame* frame, |
129 const blink::WebHistoryItem& history_item, | 119 const blink::WebHistoryItem& history_item, |
130 blink::WebHistoryCommitType commit_type); | 120 blink::WebHistoryCommitType commit_type); |
131 virtual blink::WebEncryptedMediaClient* encryptedMediaClient(); | 121 virtual blink::WebEncryptedMediaClient* encryptedMediaClient(); |
132 | 122 |
| 123 private: |
| 124 // Data associated with a child iframe. |
| 125 struct ChildFrameData { |
| 126 mojo::View* view; |
| 127 blink::WebTreeScopeType scope; |
| 128 }; |
| 129 |
| 130 // Updates the size and scale factor of the webview and related classes from |
| 131 // |root_|. |
| 132 void UpdateWebviewSizeFromViewSize(); |
| 133 |
| 134 void InitGlobalStateAndLoadIfNecessary(); |
| 135 |
133 // ViewManagerDelegate methods: | 136 // ViewManagerDelegate methods: |
134 void OnEmbed(mojo::View* root) override; | 137 void OnEmbed(mojo::View* root) override; |
135 void OnViewManagerDestroyed(mojo::ViewManager* view_manager) override; | 138 void OnViewManagerDestroyed(mojo::ViewManager* view_manager) override; |
136 | 139 |
137 // ViewObserver methods: | 140 // ViewObserver methods: |
138 void OnViewBoundsChanged(mojo::View* view, | 141 void OnViewBoundsChanged(mojo::View* view, |
139 const mojo::Rect& old_bounds, | 142 const mojo::Rect& old_bounds, |
140 const mojo::Rect& new_bounds) override; | 143 const mojo::Rect& new_bounds) override; |
141 void OnViewViewportMetricsChanged( | 144 void OnViewViewportMetricsChanged( |
142 mojo::View* view, | 145 mojo::View* view, |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 scoped_ptr<DevToolsAgentImpl> devtools_agent_; | 188 scoped_ptr<DevToolsAgentImpl> devtools_agent_; |
186 | 189 |
187 DeleteCallback delete_callback_; | 190 DeleteCallback delete_callback_; |
188 | 191 |
189 DISALLOW_COPY_AND_ASSIGN(HTMLDocument); | 192 DISALLOW_COPY_AND_ASSIGN(HTMLDocument); |
190 }; | 193 }; |
191 | 194 |
192 } // namespace html_viewer | 195 } // namespace html_viewer |
193 | 196 |
194 #endif // COMPONENTS_HTML_VIEWER_HTML_DOCUMENT_H_ | 197 #endif // COMPONENTS_HTML_VIEWER_HTML_DOCUMENT_H_ |
OLD | NEW |