OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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> |
(...skipping 13 matching lines...) Expand all Loading... |
24 #include "base/sys_string_conversions.h" | 24 #include "base/sys_string_conversions.h" |
25 #include "base/time.h" | 25 #include "base/time.h" |
26 #include "base/utf_string_conversions.h" | 26 #include "base/utf_string_conversions.h" |
27 #include "build/build_config.h" | 27 #include "build/build_config.h" |
28 #include "chrome/common/appcache/appcache_dispatcher.h" | 28 #include "chrome/common/appcache/appcache_dispatcher.h" |
29 #include "chrome/common/bindings_policy.h" | 29 #include "chrome/common/bindings_policy.h" |
30 #include "chrome/common/child_process_logging.h" | 30 #include "chrome/common/child_process_logging.h" |
31 #include "chrome/common/chrome_constants.h" | 31 #include "chrome/common/chrome_constants.h" |
32 #include "chrome/common/chrome_paths.h" | 32 #include "chrome/common/chrome_paths.h" |
33 #include "chrome/common/chrome_switches.h" | 33 #include "chrome/common/chrome_switches.h" |
| 34 #include "chrome/common/database_messages.h" |
34 #include "chrome/common/extensions/extension.h" | 35 #include "chrome/common/extensions/extension.h" |
35 #include "chrome/common/file_system/file_system_dispatcher.h" | 36 #include "chrome/common/file_system/file_system_dispatcher.h" |
36 #include "chrome/common/file_system/webfilesystem_callback_dispatcher.h" | 37 #include "chrome/common/file_system/webfilesystem_callback_dispatcher.h" |
37 #include "chrome/common/json_value_serializer.h" | 38 #include "chrome/common/json_value_serializer.h" |
38 #include "chrome/common/jstemplate_builder.h" | 39 #include "chrome/common/jstemplate_builder.h" |
39 #include "chrome/common/notification_service.h" | 40 #include "chrome/common/notification_service.h" |
40 #include "chrome/common/page_zoom.h" | 41 #include "chrome/common/page_zoom.h" |
41 #include "chrome/common/pepper_plugin_registry.h" | 42 #include "chrome/common/pepper_plugin_registry.h" |
42 #include "chrome/common/render_messages.h" | 43 #include "chrome/common/render_messages.h" |
43 #include "chrome/common/renderer_preferences.h" | 44 #include "chrome/common/renderer_preferences.h" |
(...skipping 3715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3759 } | 3760 } |
3760 | 3761 |
3761 bool RenderView::allowDatabase( | 3762 bool RenderView::allowDatabase( |
3762 WebFrame* frame, const WebString& name, const WebString& display_name, | 3763 WebFrame* frame, const WebString& name, const WebString& display_name, |
3763 unsigned long estimated_size) { | 3764 unsigned long estimated_size) { |
3764 WebSecurityOrigin origin = frame->securityOrigin(); | 3765 WebSecurityOrigin origin = frame->securityOrigin(); |
3765 if (origin.isEmpty()) | 3766 if (origin.isEmpty()) |
3766 return false; // Uninitialized document? | 3767 return false; // Uninitialized document? |
3767 | 3768 |
3768 bool result; | 3769 bool result; |
3769 if (!Send(new ViewHostMsg_AllowDatabase(routing_id_, | 3770 if (!Send(new DatabaseHostMsg_Allow(routing_id_, |
3770 origin.toString().utf8(), name, display_name, estimated_size, &result))) | 3771 origin.toString().utf8(), name, display_name, estimated_size, &result))) |
3771 return false; | 3772 return false; |
3772 Send(new ViewHostMsg_WebDatabaseAccessed(routing_id_, | 3773 Send(new ViewHostMsg_WebDatabaseAccessed(routing_id_, |
3773 GURL(origin.toString().utf8()), | 3774 GURL(origin.toString().utf8()), |
3774 name, | 3775 name, |
3775 display_name, | 3776 display_name, |
3776 estimated_size, | 3777 estimated_size, |
3777 !result)); | 3778 !result)); |
3778 return result; | 3779 return result; |
3779 } | 3780 } |
(...skipping 1951 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5731 external_popup_menu_.reset(); | 5732 external_popup_menu_.reset(); |
5732 } | 5733 } |
5733 #endif | 5734 #endif |
5734 | 5735 |
5735 void RenderView::AddErrorToRootConsole(const string16& message) { | 5736 void RenderView::AddErrorToRootConsole(const string16& message) { |
5736 if (webview() && webview()->mainFrame()) { | 5737 if (webview() && webview()->mainFrame()) { |
5737 webview()->mainFrame()->addMessageToConsole( | 5738 webview()->mainFrame()->addMessageToConsole( |
5738 WebConsoleMessage(WebConsoleMessage::LevelError, message)); | 5739 WebConsoleMessage(WebConsoleMessage::LevelError, message)); |
5739 } | 5740 } |
5740 } | 5741 } |
OLD | NEW |