OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_impl.h" | 5 #include "content/browser/renderer_host/render_view_host_impl.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 #include "content/public/common/content_switches.h" | 65 #include "content/public/common/content_switches.h" |
66 #include "content/public/common/context_menu_params.h" | 66 #include "content/public/common/context_menu_params.h" |
67 #include "content/public/common/drop_data.h" | 67 #include "content/public/common/drop_data.h" |
68 #include "content/public/common/result_codes.h" | 68 #include "content/public/common/result_codes.h" |
69 #include "content/public/common/url_constants.h" | 69 #include "content/public/common/url_constants.h" |
70 #include "content/public/common/url_utils.h" | 70 #include "content/public/common/url_utils.h" |
71 #include "net/base/net_util.h" | 71 #include "net/base/net_util.h" |
72 #include "net/base/network_change_notifier.h" | 72 #include "net/base/network_change_notifier.h" |
73 #include "net/url_request/url_request_context_getter.h" | 73 #include "net/url_request/url_request_context_getter.h" |
74 #include "third_party/skia/include/core/SkBitmap.h" | 74 #include "third_party/skia/include/core/SkBitmap.h" |
| 75 #include "ui/accessibility/ax_tree.h" |
75 #include "ui/base/touch/touch_device.h" | 76 #include "ui/base/touch/touch_device.h" |
76 #include "ui/base/touch/touch_enabled.h" | 77 #include "ui/base/touch/touch_enabled.h" |
77 #include "ui/base/ui_base_switches.h" | 78 #include "ui/base/ui_base_switches.h" |
78 #include "ui/gfx/image/image_skia.h" | 79 #include "ui/gfx/image/image_skia.h" |
79 #include "ui/gfx/native_widget_types.h" | 80 #include "ui/gfx/native_widget_types.h" |
80 #include "ui/shell_dialogs/selected_file_info.h" | 81 #include "ui/shell_dialogs/selected_file_info.h" |
81 #include "webkit/browser/fileapi/isolated_context.h" | 82 #include "webkit/browser/fileapi/isolated_context.h" |
82 | 83 |
83 #if defined(OS_MACOSX) | 84 #if defined(OS_MACOSX) |
84 #include "content/browser/renderer_host/popup_menu_helper_mac.h" | 85 #include "content/browser/renderer_host/popup_menu_helper_mac.h" |
(...skipping 1922 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2007 } | 2008 } |
2008 | 2009 |
2009 void RenderViewHostImpl::DisownOpener() { | 2010 void RenderViewHostImpl::DisownOpener() { |
2010 // This should only be called when swapped out. | 2011 // This should only be called when swapped out. |
2011 DCHECK(is_swapped_out_); | 2012 DCHECK(is_swapped_out_); |
2012 | 2013 |
2013 Send(new ViewMsg_DisownOpener(GetRoutingID())); | 2014 Send(new ViewMsg_DisownOpener(GetRoutingID())); |
2014 } | 2015 } |
2015 | 2016 |
2016 void RenderViewHostImpl::SetAccessibilityCallbackForTesting( | 2017 void RenderViewHostImpl::SetAccessibilityCallbackForTesting( |
2017 const base::Callback<void(blink::WebAXEvent)>& callback) { | 2018 const base::Callback<void(ui::AXEvent)>& callback) { |
2018 accessibility_testing_callback_ = callback; | 2019 accessibility_testing_callback_ = callback; |
2019 } | 2020 } |
2020 | 2021 |
2021 void RenderViewHostImpl::UpdateWebkitPreferences(const WebPreferences& prefs) { | 2022 void RenderViewHostImpl::UpdateWebkitPreferences(const WebPreferences& prefs) { |
2022 Send(new ViewMsg_UpdateWebPreferences(GetRoutingID(), prefs)); | 2023 Send(new ViewMsg_UpdateWebPreferences(GetRoutingID(), prefs)); |
2023 } | 2024 } |
2024 | 2025 |
2025 void RenderViewHostImpl::NotifyTimezoneChange() { | 2026 void RenderViewHostImpl::NotifyTimezoneChange() { |
2026 Send(new ViewMsg_TimezoneChange(GetRoutingID())); | 2027 Send(new ViewMsg_TimezoneChange(GetRoutingID())); |
2027 } | 2028 } |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2124 // Always send an ACK or the renderer can be in a bad state. | 2125 // Always send an ACK or the renderer can be in a bad state. |
2125 Send(new AccessibilityMsg_Events_ACK(GetRoutingID())); | 2126 Send(new AccessibilityMsg_Events_ACK(GetRoutingID())); |
2126 | 2127 |
2127 // The rest of this code is just for testing; bail out if we're not | 2128 // The rest of this code is just for testing; bail out if we're not |
2128 // in that mode. | 2129 // in that mode. |
2129 if (accessibility_testing_callback_.is_null()) | 2130 if (accessibility_testing_callback_.is_null()) |
2130 return; | 2131 return; |
2131 | 2132 |
2132 for (unsigned i = 0; i < params.size(); i++) { | 2133 for (unsigned i = 0; i < params.size(); i++) { |
2133 const AccessibilityHostMsg_EventParams& param = params[i]; | 2134 const AccessibilityHostMsg_EventParams& param = params[i]; |
2134 blink::WebAXEvent src_type = param.event_type; | 2135 if (static_cast<int>(param.event_type) < 0) |
2135 if (src_type == blink::WebAXEventLayoutComplete || | 2136 continue; |
2136 src_type == blink::WebAXEventLoadComplete) { | 2137 ui::AXTreeUpdate update; |
2137 MakeAccessibilityNodeDataTree(param.nodes, &accessibility_tree_); | 2138 update.nodes = param.nodes; |
2138 } | 2139 if (!ax_tree_) |
2139 accessibility_testing_callback_.Run(src_type); | 2140 ax_tree_.reset(new ui::AXTree(update)); |
| 2141 else |
| 2142 CHECK(ax_tree_->Unserialize(update)) << ax_tree_->error(); |
| 2143 accessibility_testing_callback_.Run(param.event_type); |
2140 } | 2144 } |
2141 } | 2145 } |
2142 | 2146 |
2143 void RenderViewHostImpl::OnAccessibilityLocationChanges( | 2147 void RenderViewHostImpl::OnAccessibilityLocationChanges( |
2144 const std::vector<AccessibilityHostMsg_LocationChangeParams>& params) { | 2148 const std::vector<AccessibilityHostMsg_LocationChangeParams>& params) { |
2145 if (view_ && !is_swapped_out_) { | 2149 if (view_ && !is_swapped_out_) { |
2146 view_->CreateBrowserAccessibilityManagerIfNeeded(); | 2150 view_->CreateBrowserAccessibilityManagerIfNeeded(); |
2147 BrowserAccessibilityManager* manager = | 2151 BrowserAccessibilityManager* manager = |
2148 view_->GetBrowserAccessibilityManager(); | 2152 view_->GetBrowserAccessibilityManager(); |
2149 if (manager) | 2153 if (manager) |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2282 void RenderViewHostImpl::AttachToFrameTree() { | 2286 void RenderViewHostImpl::AttachToFrameTree() { |
2283 FrameTree* frame_tree = delegate_->GetFrameTree(); | 2287 FrameTree* frame_tree = delegate_->GetFrameTree(); |
2284 | 2288 |
2285 frame_tree->ResetForMainFrameSwap(); | 2289 frame_tree->ResetForMainFrameSwap(); |
2286 if (main_frame_id() != FrameTreeNode::kInvalidFrameId) { | 2290 if (main_frame_id() != FrameTreeNode::kInvalidFrameId) { |
2287 frame_tree->OnFirstNavigationAfterSwap(main_frame_id()); | 2291 frame_tree->OnFirstNavigationAfterSwap(main_frame_id()); |
2288 } | 2292 } |
2289 } | 2293 } |
2290 | 2294 |
2291 } // namespace content | 2295 } // namespace content |
OLD | NEW |