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 "chrome/renderer/render_view.h" | 5 #include "chrome/renderer/render_view.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> |
11 | 11 |
12 #include "app/l10n_util.h" | 12 #include "app/l10n_util.h" |
13 #include "app/message_box_flags.h" | |
14 #include "app/resource_bundle.h" | 13 #include "app/resource_bundle.h" |
15 #include "base/callback.h" | 14 #include "base/callback.h" |
16 #include "base/command_line.h" | 15 #include "base/command_line.h" |
17 #include "base/compiler_specific.h" | 16 #include "base/compiler_specific.h" |
18 #include "base/lazy_instance.h" | 17 #include "base/lazy_instance.h" |
19 #include "base/metrics/histogram.h" | 18 #include "base/metrics/histogram.h" |
20 #include "base/path_service.h" | 19 #include "base/path_service.h" |
21 #include "base/process_util.h" | 20 #include "base/process_util.h" |
22 #include "base/string_piece.h" | 21 #include "base/string_piece.h" |
23 #include "base/string_util.h" | 22 #include "base/string_util.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" | 151 #include "third_party/WebKit/Source/WebKit/chromium/public/WebString.h" |
153 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" | 152 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURL.h" |
154 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h" | 153 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLError.h" |
155 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" | 154 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLRequest.h" |
156 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h" | 155 #include "third_party/WebKit/Source/WebKit/chromium/public/WebURLResponse.h" |
157 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h" | 156 #include "third_party/WebKit/Source/WebKit/chromium/public/WebVector.h" |
158 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" | 157 #include "third_party/WebKit/Source/WebKit/chromium/public/WebView.h" |
159 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWindowFeatures.h" | 158 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWindowFeatures.h" |
160 #include "third_party/cld/encodings/compact_lang_det/win/cld_unicodetext.h" | 159 #include "third_party/cld/encodings/compact_lang_det/win/cld_unicodetext.h" |
161 #include "third_party/skia/include/core/SkBitmap.h" | 160 #include "third_party/skia/include/core/SkBitmap.h" |
| 161 #include "ui/base/message_box_flags.h" |
162 #include "v8/include/v8.h" | 162 #include "v8/include/v8.h" |
163 #include "v8/include/v8-testing.h" | 163 #include "v8/include/v8-testing.h" |
164 #include "webkit/appcache/web_application_cache_host_impl.h" | 164 #include "webkit/appcache/web_application_cache_host_impl.h" |
165 #include "webkit/glue/alt_error_page_resource_fetcher.h" | 165 #include "webkit/glue/alt_error_page_resource_fetcher.h" |
166 #include "webkit/glue/context_menu.h" | 166 #include "webkit/glue/context_menu.h" |
167 #include "webkit/glue/dom_operations.h" | 167 #include "webkit/glue/dom_operations.h" |
168 #include "webkit/glue/form_data.h" | 168 #include "webkit/glue/form_data.h" |
169 #include "webkit/glue/form_field.h" | 169 #include "webkit/glue/form_field.h" |
170 #include "webkit/glue/glue_serialize.h" | 170 #include "webkit/glue/glue_serialize.h" |
171 #include "webkit/glue/image_decoder.h" | 171 #include "webkit/glue/image_decoder.h" |
(...skipping 2206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2378 ipc_params.title = params.title; | 2378 ipc_params.title = params.title; |
2379 ipc_params.default_file_name = | 2379 ipc_params.default_file_name = |
2380 webkit_glue::WebStringToFilePath(params.initialValue); | 2380 webkit_glue::WebStringToFilePath(params.initialValue); |
2381 ipc_params.accept_types = params.acceptTypes; | 2381 ipc_params.accept_types = params.acceptTypes; |
2382 | 2382 |
2383 return ScheduleFileChooser(ipc_params, chooser_completion); | 2383 return ScheduleFileChooser(ipc_params, chooser_completion); |
2384 } | 2384 } |
2385 | 2385 |
2386 void RenderView::runModalAlertDialog( | 2386 void RenderView::runModalAlertDialog( |
2387 WebFrame* frame, const WebString& message) { | 2387 WebFrame* frame, const WebString& message) { |
2388 RunJavaScriptMessage(MessageBoxFlags::kIsJavascriptAlert, | 2388 RunJavaScriptMessage(ui::MessageBoxFlags::kIsJavascriptAlert, |
2389 UTF16ToWideHack(message), | 2389 UTF16ToWideHack(message), |
2390 std::wstring(), | 2390 std::wstring(), |
2391 frame->url(), | 2391 frame->url(), |
2392 NULL); | 2392 NULL); |
2393 } | 2393 } |
2394 | 2394 |
2395 bool RenderView::runModalConfirmDialog( | 2395 bool RenderView::runModalConfirmDialog( |
2396 WebFrame* frame, const WebString& message) { | 2396 WebFrame* frame, const WebString& message) { |
2397 return RunJavaScriptMessage(MessageBoxFlags::kIsJavascriptConfirm, | 2397 return RunJavaScriptMessage(ui::MessageBoxFlags::kIsJavascriptConfirm, |
2398 UTF16ToWideHack(message), | 2398 UTF16ToWideHack(message), |
2399 std::wstring(), | 2399 std::wstring(), |
2400 frame->url(), | 2400 frame->url(), |
2401 NULL); | 2401 NULL); |
2402 } | 2402 } |
2403 | 2403 |
2404 bool RenderView::runModalPromptDialog( | 2404 bool RenderView::runModalPromptDialog( |
2405 WebFrame* frame, const WebString& message, const WebString& default_value, | 2405 WebFrame* frame, const WebString& message, const WebString& default_value, |
2406 WebString* actual_value) { | 2406 WebString* actual_value) { |
2407 std::wstring result; | 2407 std::wstring result; |
2408 bool ok = RunJavaScriptMessage(MessageBoxFlags::kIsJavascriptPrompt, | 2408 bool ok = RunJavaScriptMessage(ui::MessageBoxFlags::kIsJavascriptPrompt, |
2409 UTF16ToWideHack(message), | 2409 UTF16ToWideHack(message), |
2410 UTF16ToWideHack(default_value), | 2410 UTF16ToWideHack(default_value), |
2411 frame->url(), | 2411 frame->url(), |
2412 &result); | 2412 &result); |
2413 if (ok) | 2413 if (ok) |
2414 actual_value->assign(WideToUTF16Hack(result)); | 2414 actual_value->assign(WideToUTF16Hack(result)); |
2415 return ok; | 2415 return ok; |
2416 } | 2416 } |
2417 | 2417 |
2418 bool RenderView::runModalBeforeUnloadDialog( | 2418 bool RenderView::runModalBeforeUnloadDialog( |
(...skipping 3265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5684 if (cmd == kJavaScriptStressTestSetStressRunType) { | 5684 if (cmd == kJavaScriptStressTestSetStressRunType) { |
5685 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param)); | 5685 v8::Testing::SetStressRunType(static_cast<v8::Testing::StressType>(param)); |
5686 } else if (cmd == kJavaScriptStressTestPrepareStressRun) { | 5686 } else if (cmd == kJavaScriptStressTestPrepareStressRun) { |
5687 v8::Testing::PrepareStressRun(param); | 5687 v8::Testing::PrepareStressRun(param); |
5688 } | 5688 } |
5689 } | 5689 } |
5690 | 5690 |
5691 void RenderView::OnContextMenuClosed() { | 5691 void RenderView::OnContextMenuClosed() { |
5692 context_menu_node_.reset(); | 5692 context_menu_node_.reset(); |
5693 } | 5693 } |
OLD | NEW |