| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame_host/render_frame_host_impl.h" | 5 #include "content/browser/frame_host/render_frame_host_impl.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 764 void RenderFrameHostImpl::AccessibilityFatalError() { | 764 void RenderFrameHostImpl::AccessibilityFatalError() { |
| 765 browser_accessibility_manager_.reset(NULL); | 765 browser_accessibility_manager_.reset(NULL); |
| 766 if (accessibility_reset_token_) | 766 if (accessibility_reset_token_) |
| 767 return; | 767 return; |
| 768 | 768 |
| 769 accessibility_reset_count_++; | 769 accessibility_reset_count_++; |
| 770 if (accessibility_reset_count_ >= kMaxAccessibilityResets) { | 770 if (accessibility_reset_count_ >= kMaxAccessibilityResets) { |
| 771 Send(new AccessibilityMsg_FatalError(routing_id_)); | 771 Send(new AccessibilityMsg_FatalError(routing_id_)); |
| 772 } else { | 772 } else { |
| 773 accessibility_reset_token_ = g_next_accessibility_reset_token++; | 773 accessibility_reset_token_ = g_next_accessibility_reset_token++; |
| 774 UMA_HISTOGRAM_COUNTS("Accessibility.FrameResetCount", 1); | |
| 775 Send(new AccessibilityMsg_Reset(routing_id_, accessibility_reset_token_)); | 774 Send(new AccessibilityMsg_Reset(routing_id_, accessibility_reset_token_)); |
| 776 } | 775 } |
| 777 } | 776 } |
| 778 | 777 |
| 779 gfx::AcceleratedWidget | 778 gfx::AcceleratedWidget |
| 780 RenderFrameHostImpl::AccessibilityGetAcceleratedWidget() { | 779 RenderFrameHostImpl::AccessibilityGetAcceleratedWidget() { |
| 781 // Only the main frame's current frame host is connected to the native | 780 // Only the main frame's current frame host is connected to the native |
| 782 // widget tree for accessibility, so return null if this is queried on | 781 // widget tree for accessibility, so return null if this is queried on |
| 783 // any other frame. | 782 // any other frame. |
| 784 if (frame_tree_node()->parent() || | 783 if (frame_tree_node()->parent() || |
| (...skipping 2015 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2800 | 2799 |
| 2801 BrowserAccessibilityManager* | 2800 BrowserAccessibilityManager* |
| 2802 RenderFrameHostImpl::GetOrCreateBrowserAccessibilityManager() { | 2801 RenderFrameHostImpl::GetOrCreateBrowserAccessibilityManager() { |
| 2803 RenderWidgetHostViewBase* view = GetViewForAccessibility(); | 2802 RenderWidgetHostViewBase* view = GetViewForAccessibility(); |
| 2804 if (view && | 2803 if (view && |
| 2805 !browser_accessibility_manager_ && | 2804 !browser_accessibility_manager_ && |
| 2806 !no_create_browser_accessibility_manager_for_testing_) { | 2805 !no_create_browser_accessibility_manager_for_testing_) { |
| 2807 bool is_root_frame = !frame_tree_node()->parent(); | 2806 bool is_root_frame = !frame_tree_node()->parent(); |
| 2808 browser_accessibility_manager_.reset( | 2807 browser_accessibility_manager_.reset( |
| 2809 view->CreateBrowserAccessibilityManager(this, is_root_frame)); | 2808 view->CreateBrowserAccessibilityManager(this, is_root_frame)); |
| 2810 if (browser_accessibility_manager_) | |
| 2811 UMA_HISTOGRAM_COUNTS("Accessibility.FrameEnabledCount", 1); | |
| 2812 else | |
| 2813 UMA_HISTOGRAM_COUNTS("Accessibility.FrameDidNotEnableCount", 1); | |
| 2814 } | 2809 } |
| 2815 return browser_accessibility_manager_.get(); | 2810 return browser_accessibility_manager_.get(); |
| 2816 } | 2811 } |
| 2817 | 2812 |
| 2818 void RenderFrameHostImpl::ActivateFindInPageResultForAccessibility( | 2813 void RenderFrameHostImpl::ActivateFindInPageResultForAccessibility( |
| 2819 int request_id) { | 2814 int request_id) { |
| 2820 AccessibilityMode accessibility_mode = delegate_->GetAccessibilityMode(); | 2815 AccessibilityMode accessibility_mode = delegate_->GetAccessibilityMode(); |
| 2821 if (accessibility_mode & AccessibilityModeFlagPlatform) { | 2816 if (accessibility_mode & AccessibilityModeFlagPlatform) { |
| 2822 BrowserAccessibilityManager* manager = | 2817 BrowserAccessibilityManager* manager = |
| 2823 GetOrCreateBrowserAccessibilityManager(); | 2818 GetOrCreateBrowserAccessibilityManager(); |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3246 // There is no pending NavigationEntry in these cases, so pass 0 as the | 3241 // There is no pending NavigationEntry in these cases, so pass 0 as the |
| 3247 // pending_nav_entry_id. If the previous handle was a prematurely aborted | 3242 // pending_nav_entry_id. If the previous handle was a prematurely aborted |
| 3248 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. | 3243 // navigation loaded via LoadDataWithBaseURL, propagate the entry id. |
| 3249 return NavigationHandleImpl::Create( | 3244 return NavigationHandleImpl::Create( |
| 3250 params.url, frame_tree_node_, is_renderer_initiated, | 3245 params.url, frame_tree_node_, is_renderer_initiated, |
| 3251 params.was_within_same_page, params.is_srcdoc, base::TimeTicks::Now(), | 3246 params.was_within_same_page, params.is_srcdoc, base::TimeTicks::Now(), |
| 3252 entry_id_for_data_nav, false); // started_from_context_menu | 3247 entry_id_for_data_nav, false); // started_from_context_menu |
| 3253 } | 3248 } |
| 3254 | 3249 |
| 3255 } // namespace content | 3250 } // namespace content |
| OLD | NEW |