OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaCallba
cks.h" | 123 #include "third_party/WebKit/Source/WebKit/chromium/public/WebStorageQuotaCallba
cks.h" |
124 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" | 124 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" |
125 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" | 125 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" |
126 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h" | 126 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h" |
127 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" | 127 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" |
128 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h" | 128 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h" |
129 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h" | 129 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h" |
130 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 130 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
131 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWindowFeatures.h" | 131 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWindowFeatures.h" |
132 #include "third_party/skia/include/core/SkBitmap.h" | 132 #include "third_party/skia/include/core/SkBitmap.h" |
133 #include "ui/base/message_box_flags.h" | 133 #include "ui/base/message_box_type.h" |
134 #include "ui/gfx/native_widget_types.h" | 134 #include "ui/gfx/native_widget_types.h" |
135 #include "ui/gfx/point.h" | 135 #include "ui/gfx/point.h" |
136 #include "ui/gfx/rect.h" | 136 #include "ui/gfx/rect.h" |
137 #include "v8/include/v8.h" | 137 #include "v8/include/v8.h" |
138 #include "webkit/appcache/web_application_cache_host_impl.h" | 138 #include "webkit/appcache/web_application_cache_host_impl.h" |
139 #include "webkit/glue/alt_error_page_resource_fetcher.h" | 139 #include "webkit/glue/alt_error_page_resource_fetcher.h" |
140 #include "webkit/glue/context_menu.h" | 140 #include "webkit/glue/context_menu.h" |
141 #include "webkit/glue/dom_operations.h" | 141 #include "webkit/glue/dom_operations.h" |
142 #include "webkit/glue/form_data.h" | 142 #include "webkit/glue/form_data.h" |
143 #include "webkit/glue/form_field.h" | 143 #include "webkit/glue/form_field.h" |
(...skipping 1421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1565 ipc_params.title = params.title; | 1565 ipc_params.title = params.title; |
1566 ipc_params.default_file_name = | 1566 ipc_params.default_file_name = |
1567 webkit_glue::WebStringToFilePath(params.initialValue); | 1567 webkit_glue::WebStringToFilePath(params.initialValue); |
1568 ipc_params.accept_types.reserve(params.acceptMIMETypes.size()); | 1568 ipc_params.accept_types.reserve(params.acceptMIMETypes.size()); |
1569 for (size_t i = 0; i < params.acceptMIMETypes.size(); ++i) | 1569 for (size_t i = 0; i < params.acceptMIMETypes.size(); ++i) |
1570 ipc_params.accept_types.push_back(params.acceptMIMETypes[i]); | 1570 ipc_params.accept_types.push_back(params.acceptMIMETypes[i]); |
1571 | 1571 |
1572 return ScheduleFileChooser(ipc_params, chooser_completion); | 1572 return ScheduleFileChooser(ipc_params, chooser_completion); |
1573 } | 1573 } |
1574 | 1574 |
1575 void RenderViewImpl::runModalAlertDialog( | 1575 void RenderViewImpl::runModalAlertDialog(WebFrame* frame, |
1576 WebFrame* frame, const WebString& message) { | 1576 const WebString& message) { |
1577 RunJavaScriptMessage(ui::MessageBoxFlags::kIsJavascriptAlert, | 1577 RunJavaScriptMessage(ui::MESSAGE_BOX_TYPE_JAVASCRIPT_ALERT, |
1578 message, | 1578 message, |
1579 string16(), | 1579 string16(), |
1580 frame->document().url(), | 1580 frame->document().url(), |
1581 NULL); | 1581 NULL); |
1582 } | 1582 } |
1583 | 1583 |
1584 bool RenderViewImpl::runModalConfirmDialog( | 1584 bool RenderViewImpl::runModalConfirmDialog(WebFrame* frame, |
1585 WebFrame* frame, const WebString& message) { | 1585 const WebString& message) { |
1586 return RunJavaScriptMessage(ui::MessageBoxFlags::kIsJavascriptConfirm, | 1586 return RunJavaScriptMessage(ui::MESSAGE_BOX_TYPE_JAVASCRIPT_CONFIRM, |
1587 message, | 1587 message, |
1588 string16(), | 1588 string16(), |
1589 frame->document().url(), | 1589 frame->document().url(), |
1590 NULL); | 1590 NULL); |
1591 } | 1591 } |
1592 | 1592 |
1593 bool RenderViewImpl::runModalPromptDialog( | 1593 bool RenderViewImpl::runModalPromptDialog(WebFrame* frame, |
1594 WebFrame* frame, const WebString& message, const WebString& default_value, | 1594 const WebString& message, |
1595 WebString* actual_value) { | 1595 const WebString& default_value, |
| 1596 WebString* actual_value) { |
1596 string16 result; | 1597 string16 result; |
1597 bool ok = RunJavaScriptMessage(ui::MessageBoxFlags::kIsJavascriptPrompt, | 1598 bool ok = RunJavaScriptMessage(ui::MESSAGE_BOX_TYPE_JAVASCRIPT_PROMPT, |
1598 message, | 1599 message, |
1599 default_value, | 1600 default_value, |
1600 frame->document().url(), | 1601 frame->document().url(), |
1601 &result); | 1602 &result); |
1602 if (ok) | 1603 if (ok) |
1603 actual_value->assign(result); | 1604 actual_value->assign(result); |
1604 return ok; | 1605 return ok; |
1605 } | 1606 } |
1606 | 1607 |
1607 bool RenderViewImpl::runModalBeforeUnloadDialog( | 1608 bool RenderViewImpl::runModalBeforeUnloadDialog( |
(...skipping 3141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4749 return !!RenderThreadImpl::current()->compositor_thread(); | 4750 return !!RenderThreadImpl::current()->compositor_thread(); |
4750 } | 4751 } |
4751 | 4752 |
4752 void RenderViewImpl::OnJavaBridgeInit( | 4753 void RenderViewImpl::OnJavaBridgeInit( |
4753 const IPC::ChannelHandle& channel_handle) { | 4754 const IPC::ChannelHandle& channel_handle) { |
4754 DCHECK(!java_bridge_dispatcher_.get()); | 4755 DCHECK(!java_bridge_dispatcher_.get()); |
4755 #if defined(ENABLE_JAVA_BRIDGE) | 4756 #if defined(ENABLE_JAVA_BRIDGE) |
4756 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this, channel_handle)); | 4757 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this, channel_handle)); |
4757 #endif | 4758 #endif |
4758 } | 4759 } |
OLD | NEW |