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 EXTENSIONS_RENDERER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_CONTA
INER_H_ | 5 #ifndef EXTENSIONS_RENDERER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_CONTA
INER_H_ |
6 #define EXTENSIONS_RENDERER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_CONTA
INER_H_ | 6 #define EXTENSIONS_RENDERER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_CONTA
INER_H_ |
7 | 7 |
8 #include "base/memory/linked_ptr.h" | 8 #include "base/memory/linked_ptr.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "extensions/renderer/guest_view/guest_view_container.h" | 10 #include "extensions/renderer/guest_view/guest_view_container.h" |
11 #include "extensions/renderer/scoped_persistent.h" | 11 #include "extensions/renderer/scoped_persistent.h" |
12 #include "third_party/WebKit/public/platform/WebURLLoader.h" | 12 #include "third_party/WebKit/public/platform/WebURLLoader.h" |
13 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h" | 13 #include "third_party/WebKit/public/platform/WebURLLoaderClient.h" |
| 14 #include "ui/gfx/geometry/size.h" |
14 #include "url/gurl.h" | 15 #include "url/gurl.h" |
15 #include "v8/include/v8.h" | 16 #include "v8/include/v8.h" |
16 | 17 |
17 namespace extensions { | 18 namespace extensions { |
18 | 19 |
19 // A container for loading up an extension inside a BrowserPlugin to handle a | 20 // A container for loading up an extension inside a BrowserPlugin to handle a |
20 // MIME type. A request for the URL of the data to load inside the container is | 21 // MIME type. A request for the URL of the data to load inside the container is |
21 // made and a url is sent back in response which points to the URL which the | 22 // made and a url is sent back in response which points to the URL which the |
22 // container should be navigated to. There are two cases for making this URL | 23 // container should be navigated to. There are two cases for making this URL |
23 // request, the case where the plugin is embedded and the case where it is top | 24 // request, the case where the plugin is embedded and the case where it is top |
(...skipping 13 matching lines...) Expand all Loading... |
37 public: | 38 public: |
38 MimeHandlerViewContainer(content::RenderFrame* render_frame, | 39 MimeHandlerViewContainer(content::RenderFrame* render_frame, |
39 const std::string& mime_type, | 40 const std::string& mime_type, |
40 const GURL& original_url); | 41 const GURL& original_url); |
41 ~MimeHandlerViewContainer() override; | 42 ~MimeHandlerViewContainer() override; |
42 | 43 |
43 // BrowserPluginDelegate implementation. | 44 // BrowserPluginDelegate implementation. |
44 void Ready() override; | 45 void Ready() override; |
45 void DidFinishLoading() override; | 46 void DidFinishLoading() override; |
46 void DidReceiveData(const char* data, int data_length) override; | 47 void DidReceiveData(const char* data, int data_length) override; |
| 48 void DidResizeElement(const gfx::Size& old_size, |
| 49 const gfx::Size& new_size) override; |
47 bool OnMessageReceived(const IPC::Message& message) override; | 50 bool OnMessageReceived(const IPC::Message& message) override; |
48 v8::Local<v8::Object> V8ScriptableObject(v8::Isolate*) override; | 51 v8::Local<v8::Object> V8ScriptableObject(v8::Isolate*) override; |
49 | 52 |
50 // WebURLLoaderClient overrides. | 53 // WebURLLoaderClient overrides. |
51 void didReceiveData(blink::WebURLLoader* loader, | 54 void didReceiveData(blink::WebURLLoader* loader, |
52 const char* data, | 55 const char* data, |
53 int data_length, | 56 int data_length, |
54 int encoded_data_length) override; | 57 int encoded_data_length) override; |
55 void didFinishLoading(blink::WebURLLoader* loader, | 58 void didFinishLoading(blink::WebURLLoader* loader, |
56 double finish_time, | 59 double finish_time, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 | 96 |
94 // Pending postMessage messages that need to be sent to the guest. These are | 97 // Pending postMessage messages that need to be sent to the guest. These are |
95 // queued while the guest is loading and once it is fully loaded they are | 98 // queued while the guest is loading and once it is fully loaded they are |
96 // delivered so that messages aren't lost. | 99 // delivered so that messages aren't lost. |
97 std::vector<linked_ptr<ScopedPersistent<v8::Value>>> pending_messages_; | 100 std::vector<linked_ptr<ScopedPersistent<v8::Value>>> pending_messages_; |
98 | 101 |
99 // True if the guest page has fully loaded and its JavaScript onload function | 102 // True if the guest page has fully loaded and its JavaScript onload function |
100 // has been called. | 103 // has been called. |
101 bool guest_loaded_; | 104 bool guest_loaded_; |
102 | 105 |
| 106 // The size of the element. |
| 107 gfx::Size element_size_; |
| 108 |
103 base::WeakPtrFactory<MimeHandlerViewContainer> weak_factory_; | 109 base::WeakPtrFactory<MimeHandlerViewContainer> weak_factory_; |
104 | 110 |
105 DISALLOW_COPY_AND_ASSIGN(MimeHandlerViewContainer); | 111 DISALLOW_COPY_AND_ASSIGN(MimeHandlerViewContainer); |
106 }; | 112 }; |
107 | 113 |
108 } // namespace extensions | 114 } // namespace extensions |
109 | 115 |
110 #endif // EXTENSIONS_RENDERER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_CO
NTAINER_H_ | 116 #endif // EXTENSIONS_RENDERER_GUEST_VIEW_MIME_HANDLER_VIEW_MIME_HANDLER_VIEW_CO
NTAINER_H_ |
OLD | NEW |