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