OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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 #include "chrome/browser/extensions/extension_view.h" | 5 #include "chrome/browser/extensions/extension_view.h" |
6 | 6 |
7 #include "chrome/browser/renderer_host/render_view_host.h" | 7 #include "chrome/browser/renderer_host/render_view_host.h" |
8 | 8 |
9 ExtensionView::ExtensionView(const GURL& url, Profile* profile) : | 9 ExtensionView::ExtensionView(const GURL& url, Profile* profile) : |
10 HWNDHtmlView(url, this, false), profile_(profile) { | 10 HWNDHtmlView(url, this, false), profile_(profile) { |
| 11 // TODO(mpcomplete): query this from the renderer somehow? |
| 12 set_preferred_size(gfx::Size(100, 100)); |
11 } | 13 } |
12 | 14 |
13 void ExtensionView::CreatingRenderer() { | 15 void ExtensionView::CreatingRenderer() { |
14 render_view_host()->AllowExtensionBindings(); | 16 render_view_host()->AllowExtensionBindings(); |
15 } | 17 } |
16 | 18 |
17 WebPreferences ExtensionView::GetWebkitPrefs() { | 19 WebPreferences ExtensionView::GetWebkitPrefs() { |
18 // TODO(mpcomplete): return some reasonable prefs. | 20 // TODO(mpcomplete): return some reasonable prefs. |
19 return WebPreferences(); | 21 return WebPreferences(); |
20 } | 22 } |
21 | 23 |
22 void ExtensionView::RunJavaScriptMessage( | 24 void ExtensionView::RunJavaScriptMessage( |
23 const std::wstring& message, | 25 const std::wstring& message, |
24 const std::wstring& default_prompt, | 26 const std::wstring& default_prompt, |
25 const GURL& frame_url, | 27 const GURL& frame_url, |
26 const int flags, | 28 const int flags, |
27 IPC::Message* reply_msg, | 29 IPC::Message* reply_msg, |
28 bool* did_suppress_message) { | 30 bool* did_suppress_message) { |
29 // Automatically cancel the javascript alert (otherwise the renderer hangs | 31 // Automatically cancel the javascript alert (otherwise the renderer hangs |
30 // indefinitely). | 32 // indefinitely). |
31 *did_suppress_message = true; | 33 *did_suppress_message = true; |
32 render_view_host()->JavaScriptMessageBoxClosed(reply_msg, true, L""); | 34 render_view_host()->JavaScriptMessageBoxClosed(reply_msg, true, L""); |
33 } | 35 } |
OLD | NEW |