| 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/browser/renderer_host/render_view_host.h" | 5 #include "content/browser/renderer_host/render_view_host.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "base/i18n/rtl.h" | 12 #include "base/i18n/rtl.h" |
| 13 #include "base/json/json_reader.h" | 13 #include "base/json/json_reader.h" |
| 14 #include "base/string_util.h" | 14 #include "base/string_util.h" |
| 15 #include "base/time.h" | 15 #include "base/time.h" |
| 16 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
| 17 #include "base/values.h" | 17 #include "base/values.h" |
| 18 #include "chrome/browser/debugger/devtools_manager.h" | 18 #include "chrome/browser/debugger/devtools_manager.h" |
| 19 #include "chrome/browser/dom_operation_notification_details.h" | 19 #include "chrome/browser/dom_operation_notification_details.h" |
| 20 #include "chrome/browser/extensions/extension_message_service.h" | 20 #include "chrome/browser/extensions/extension_message_service.h" |
| 21 #include "chrome/browser/metrics/user_metrics.h" | 21 #include "chrome/browser/metrics/user_metrics.h" |
| 22 #include "chrome/browser/net/predictor_api.h" | 22 #include "chrome/browser/net/predictor_api.h" |
| 23 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
| 24 #include "chrome/common/bindings_policy.h" | 24 #include "chrome/common/bindings_policy.h" |
| 25 #include "chrome/common/chrome_constants.h" | 25 #include "chrome/common/chrome_constants.h" |
| 26 #include "chrome/common/chrome_switches.h" | 26 #include "chrome/common/chrome_switches.h" |
| 27 #include "chrome/common/net/url_request_context_getter.h" | 27 #include "chrome/common/net/url_request_context_getter.h" |
| 28 #include "chrome/common/render_messages.h" | 28 #include "chrome/common/render_messages.h" |
| 29 #include "chrome/common/render_messages_params.h" | 29 #include "chrome/common/render_messages_params.h" |
| 30 #include "chrome/common/safebrowsing_messages.h" |
| 30 #include "chrome/common/thumbnail_score.h" | 31 #include "chrome/common/thumbnail_score.h" |
| 31 #include "chrome/common/translate_errors.h" | 32 #include "chrome/common/translate_errors.h" |
| 32 #include "chrome/common/url_constants.h" | 33 #include "chrome/common/url_constants.h" |
| 33 #include "chrome/common/web_apps.h" | 34 #include "chrome/common/web_apps.h" |
| 34 #include "content/browser/child_process_security_policy.h" | 35 #include "content/browser/child_process_security_policy.h" |
| 35 #include "content/browser/cross_site_request_manager.h" | 36 #include "content/browser/cross_site_request_manager.h" |
| 36 #include "content/browser/in_process_webkit/session_storage_namespace.h" | 37 #include "content/browser/in_process_webkit/session_storage_namespace.h" |
| 37 #include "content/browser/renderer_host/render_process_host.h" | 38 #include "content/browser/renderer_host/render_process_host.h" |
| 38 #include "content/browser/renderer_host/render_view_host_delegate.h" | 39 #include "content/browser/renderer_host/render_view_host_delegate.h" |
| 39 #include "content/browser/renderer_host/render_widget_host.h" | 40 #include "content/browser/renderer_host/render_widget_host.h" |
| (...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1311 RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); | 1312 RenderViewHostDelegate::View* view = delegate_->GetViewDelegate(); |
| 1312 if (view) | 1313 if (view) |
| 1313 view->HandleKeyboardEvent(event); | 1314 view->HandleKeyboardEvent(event); |
| 1314 } | 1315 } |
| 1315 | 1316 |
| 1316 void RenderViewHost::OnUserGesture() { | 1317 void RenderViewHost::OnUserGesture() { |
| 1317 delegate_->OnUserGesture(); | 1318 delegate_->OnUserGesture(); |
| 1318 } | 1319 } |
| 1319 | 1320 |
| 1320 void RenderViewHost::GetMalwareDOMDetails() { | 1321 void RenderViewHost::GetMalwareDOMDetails() { |
| 1321 Send(new ViewMsg_GetMalwareDOMDetails(routing_id())); | 1322 Send(new SafeBrowsingMsg_GetMalwareDOMDetails(routing_id())); |
| 1322 } | 1323 } |
| 1323 | 1324 |
| 1324 void RenderViewHost::GetAllSavableResourceLinksForCurrentPage( | 1325 void RenderViewHost::GetAllSavableResourceLinksForCurrentPage( |
| 1325 const GURL& page_url) { | 1326 const GURL& page_url) { |
| 1326 Send(new ViewMsg_GetAllSavableResourceLinksForCurrentPage(routing_id(), | 1327 Send(new ViewMsg_GetAllSavableResourceLinksForCurrentPage(routing_id(), |
| 1327 page_url)); | 1328 page_url)); |
| 1328 } | 1329 } |
| 1329 | 1330 |
| 1330 void RenderViewHost::GetSerializedHtmlDataForCurrentPageWithLocalLinks( | 1331 void RenderViewHost::GetSerializedHtmlDataForCurrentPageWithLocalLinks( |
| 1331 const std::vector<GURL>& links, | 1332 const std::vector<GURL>& links, |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1569 void RenderViewHost::OnAccessibilityNotifications( | 1570 void RenderViewHost::OnAccessibilityNotifications( |
| 1570 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params) { | 1571 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params) { |
| 1571 if (view()) | 1572 if (view()) |
| 1572 view()->OnAccessibilityNotifications(params); | 1573 view()->OnAccessibilityNotifications(params); |
| 1573 | 1574 |
| 1574 if (!params.empty()) { | 1575 if (!params.empty()) { |
| 1575 for (unsigned i = 0; i < params.size(); i++) { | 1576 for (unsigned i = 0; i < params.size(); i++) { |
| 1576 const ViewHostMsg_AccessibilityNotification_Params& param = params[i]; | 1577 const ViewHostMsg_AccessibilityNotification_Params& param = params[i]; |
| 1577 | 1578 |
| 1578 if (param.notification_type == | 1579 if (param.notification_type == |
| 1579 ViewHostMsg_AccessibilityNotification_Params:: | 1580 ViewHostMsg_AccessibilityNotification_Type:: |
| 1580 NOTIFICATION_TYPE_LOAD_COMPLETE) { | 1581 NOTIFICATION_TYPE_LOAD_COMPLETE) { |
| 1581 // TODO(ctguil): Remove when mac processes OnAccessibilityNotifications. | 1582 // TODO(ctguil): Remove when mac processes OnAccessibilityNotifications. |
| 1582 if (view()) | 1583 if (view()) |
| 1583 view()->UpdateAccessibilityTree(param.acc_obj); | 1584 view()->UpdateAccessibilityTree(param.acc_obj); |
| 1584 | 1585 |
| 1585 if (save_accessibility_tree_for_testing_) | 1586 if (save_accessibility_tree_for_testing_) |
| 1586 accessibility_tree_ = param.acc_obj; | 1587 accessibility_tree_ = param.acc_obj; |
| 1587 } | 1588 } |
| 1588 } | 1589 } |
| 1589 | 1590 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1678 LOG(DFATAL) << "Invalid checked state " << checked_state; | 1679 LOG(DFATAL) << "Invalid checked state " << checked_state; |
| 1679 return; | 1680 return; |
| 1680 } | 1681 } |
| 1681 | 1682 |
| 1682 CommandState state; | 1683 CommandState state; |
| 1683 state.is_enabled = is_enabled; | 1684 state.is_enabled = is_enabled; |
| 1684 state.checked_state = | 1685 state.checked_state = |
| 1685 static_cast<RenderViewCommandCheckedState>(checked_state); | 1686 static_cast<RenderViewCommandCheckedState>(checked_state); |
| 1686 command_states_[static_cast<RenderViewCommand>(command)] = state; | 1687 command_states_[static_cast<RenderViewCommand>(command)] = state; |
| 1687 } | 1688 } |
| OLD | NEW |