Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(87)

Side by Side Diff: components/plugins/renderer/webview_plugin.h

Issue 2733083004: Emit error events if the loading of an object element failed (Closed)
Patch Set: Emit error events if the loading of an object element failed Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_PLUGINS_RENDERER_WEBVIEW_PLUGIN_H_ 5 #ifndef COMPONENTS_PLUGINS_RENDERER_WEBVIEW_PLUGIN_H_
6 #define COMPONENTS_PLUGINS_RENDERER_WEBVIEW_PLUGIN_H_ 6 #define COMPONENTS_PLUGINS_RENDERER_WEBVIEW_PLUGIN_H_
7 7
8 #include <list> 8 #include <list>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 // Called when the WebViewPlugin is destroyed. 49 // Called when the WebViewPlugin is destroyed.
50 virtual void PluginDestroyed() = 0; 50 virtual void PluginDestroyed() = 0;
51 51
52 // Called to enable JavaScript pass-through to a throttled plugin, which is 52 // Called to enable JavaScript pass-through to a throttled plugin, which is
53 // loaded but idle. Doesn't work for blocked plugins, which is not loaded. 53 // loaded but idle. Doesn't work for blocked plugins, which is not loaded.
54 virtual v8::Local<v8::Object> GetV8ScriptableObject(v8::Isolate*) const = 0; 54 virtual v8::Local<v8::Object> GetV8ScriptableObject(v8::Isolate*) const = 0;
55 55
56 // Called when the unobscured rect of the plugin is updated. 56 // Called when the unobscured rect of the plugin is updated.
57 virtual void OnUnobscuredRectUpdate(const gfx::Rect& unobscured_rect) {} 57 virtual void OnUnobscuredRectUpdate(const gfx::Rect& unobscured_rect) {}
58
59 virtual bool IsErrorPlaceholder() = 0;
58 }; 60 };
59 61
60 // Convenience method to set up a new WebViewPlugin using |preferences| 62 // Convenience method to set up a new WebViewPlugin using |preferences|
61 // and displaying |html_data|. |url| should be a (fake) data:text/html URL; 63 // and displaying |html_data|. |url| should be a (fake) data:text/html URL;
62 // it is only used for navigation and never actually resolved. 64 // it is only used for navigation and never actually resolved.
63 static WebViewPlugin* Create(content::RenderView* render_view, 65 static WebViewPlugin* Create(content::RenderView* render_view,
64 Delegate* delegate, 66 Delegate* delegate,
65 const content::WebPreferences& preferences, 67 const content::WebPreferences& preferences,
66 const std::string& html_data, 68 const std::string& html_data,
67 const GURL& url); 69 const GURL& url);
68 70
69 blink::WebView* web_view() { return web_view_helper_.web_view(); } 71 blink::WebView* web_view() { return web_view_helper_.web_view(); }
70 72
71 const blink::WebString& old_title() const { return old_title_; } 73 const blink::WebString& old_title() const { return old_title_; }
72 74
73 // When loading a plugin document (i.e. a full page plugin not embedded in 75 // When loading a plugin document (i.e. a full page plugin not embedded in
74 // another page), we save all data that has been received, and replay it with 76 // another page), we save all data that has been received, and replay it with
75 // this method on the actual plugin. 77 // this method on the actual plugin.
76 void ReplayReceivedData(blink::WebPlugin* plugin); 78 void ReplayReceivedData(blink::WebPlugin* plugin);
77 79
78 // WebPlugin methods: 80 // WebPlugin methods:
79 blink::WebPluginContainer* Container() const override; 81 blink::WebPluginContainer* Container() const override;
80 // The WebViewPlugin, by design, never fails to initialize. It's used to 82 // The WebViewPlugin, by design, never fails to initialize. It's used to
81 // display placeholders and error messages, so it must never fail. 83 // display placeholders and error messages, so it must never fail.
82 bool Initialize(blink::WebPluginContainer*) override; 84 bool Initialize(blink::WebPluginContainer*) override;
83 void Destroy() override; 85 void Destroy() override;
84 86
85 v8::Local<v8::Object> V8ScriptableObject(v8::Isolate* isolate) override; 87 v8::Local<v8::Object> V8ScriptableObject(v8::Isolate* isolate) override;
86 88
89 bool IsErrorPlaceholder() override;
90
87 void UpdateAllLifecyclePhases() override; 91 void UpdateAllLifecyclePhases() override;
88 void Paint(blink::WebCanvas* canvas, const blink::WebRect& rect) override; 92 void Paint(blink::WebCanvas* canvas, const blink::WebRect& rect) override;
89 93
90 // Coordinates are relative to the containing window. 94 // Coordinates are relative to the containing window.
91 void UpdateGeometry(const blink::WebRect& window_rect, 95 void UpdateGeometry(const blink::WebRect& window_rect,
92 const blink::WebRect& clip_rect, 96 const blink::WebRect& clip_rect,
93 const blink::WebRect& unobscured_rect, 97 const blink::WebRect& unobscured_rect,
94 const blink::WebVector<blink::WebRect>& cut_outs_rects, 98 const blink::WebVector<blink::WebRect>& cut_outs_rects,
95 bool is_visible) override; 99 bool is_visible) override;
96 100
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 // Owned by us, deleted via |close()|. 182 // Owned by us, deleted via |close()|.
179 blink::WebView* web_view_; 183 blink::WebView* web_view_;
180 }; 184 };
181 WebViewHelper web_view_helper_; 185 WebViewHelper web_view_helper_;
182 186
183 // Should be invalidated when destroy() is called. 187 // Should be invalidated when destroy() is called.
184 base::WeakPtrFactory<WebViewPlugin> weak_factory_; 188 base::WeakPtrFactory<WebViewPlugin> weak_factory_;
185 }; 189 };
186 190
187 #endif // COMPONENTS_PLUGINS_RENDERER_WEBVIEW_PLUGIN_H_ 191 #endif // COMPONENTS_PLUGINS_RENDERER_WEBVIEW_PLUGIN_H_
OLDNEW
« no previous file with comments | « components/plugins/renderer/plugin_placeholder.cc ('k') | components/plugins/renderer/webview_plugin.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698