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 1891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1902 | 1902 |
1903 void RenderViewHostImpl::OnAccessibilityNotifications( | 1903 void RenderViewHostImpl::OnAccessibilityNotifications( |
1904 const std::vector<AccessibilityHostMsg_NotificationParams>& params) { | 1904 const std::vector<AccessibilityHostMsg_NotificationParams>& params) { |
1905 if (view_ && !is_swapped_out_) | 1905 if (view_ && !is_swapped_out_) |
1906 view_->OnAccessibilityNotifications(params); | 1906 view_->OnAccessibilityNotifications(params); |
1907 | 1907 |
1908 for (unsigned i = 0; i < params.size(); i++) { | 1908 for (unsigned i = 0; i < params.size(); i++) { |
1909 const AccessibilityHostMsg_NotificationParams& param = params[i]; | 1909 const AccessibilityHostMsg_NotificationParams& param = params[i]; |
1910 AccessibilityNotification src_type = param.notification_type; | 1910 AccessibilityNotification src_type = param.notification_type; |
1911 | 1911 |
1912 if ((src_type == AccessibilityNotificationLayoutComplete || | 1912 bool is_about_blank = false; |
1913 src_type == AccessibilityNotificationLoadComplete) && | 1913 for (unsigned j = 0; j < param.nodes.size(); j++) { |
1914 save_accessibility_tree_for_testing_) { | 1914 std::map<AccessibilityNodeData::StringAttribute, string16>::const_iterator iter; |
David Trainor- moved to gerrit
2013/06/04 20:27:18
line too long.
dmazzoni
2013/06/07 20:23:16
Done.
| |
1915 MakeAccessibilityNodeDataTree(param.nodes, &accessibility_tree_); | 1915 iter = param.nodes[j].string_attributes.find( |
1916 AccessibilityNodeData::ATTR_DOC_URL); | |
1917 if (iter != param.nodes[j].string_attributes.end()) { | |
1918 string16 doc_url = iter->second; | |
1919 if (doc_url == ASCIIToUTF16("about:blank")) | |
David Trainor- moved to gerrit
2013/06/04 20:27:18
I feel like about:blank a constant somewhere. I d
dmazzoni
2013/06/07 20:23:16
Done.
| |
1920 is_about_blank = true; | |
David Trainor- moved to gerrit
2013/06/04 20:27:18
break here? Could also just put the logic in here
dmazzoni
2013/06/07 20:23:16
We'd need to break out of one for loop and continu
| |
1921 } | |
1916 } | 1922 } |
1917 | 1923 |
1918 if (src_type == AccessibilityNotificationLayoutComplete) { | 1924 if (!is_about_blank) { |
1919 accessibility_layout_callback_.Run(); | 1925 if ((src_type == AccessibilityNotificationLayoutComplete || |
1920 } else if (src_type == AccessibilityNotificationLoadComplete) { | 1926 src_type == AccessibilityNotificationLoadComplete) && |
1921 accessibility_load_callback_.Run(); | 1927 save_accessibility_tree_for_testing_) { |
1922 } else { | 1928 MakeAccessibilityNodeDataTree(param.nodes, &accessibility_tree_); |
1923 accessibility_other_callback_.Run(); | 1929 } |
1930 | |
1931 if (src_type == AccessibilityNotificationLayoutComplete) { | |
1932 accessibility_layout_callback_.Run(); | |
1933 } else if (src_type == AccessibilityNotificationLoadComplete) { | |
1934 accessibility_load_callback_.Run(); | |
1935 } else { | |
1936 accessibility_other_callback_.Run(); | |
1937 } | |
1924 } | 1938 } |
1925 } | 1939 } |
1926 | 1940 |
1927 Send(new AccessibilityMsg_Notifications_ACK(GetRoutingID())); | 1941 Send(new AccessibilityMsg_Notifications_ACK(GetRoutingID())); |
1928 } | 1942 } |
1929 | 1943 |
1930 void RenderViewHostImpl::OnScriptEvalResponse(int id, | 1944 void RenderViewHostImpl::OnScriptEvalResponse(int id, |
1931 const base::ListValue& result) { | 1945 const base::ListValue& result) { |
1932 const base::Value* result_value; | 1946 const base::Value* result_value; |
1933 if (!result.Get(0, &result_value)) { | 1947 if (!result.Get(0, &result_value)) { |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2089 const std::vector<base::FilePath>& file_paths = state.GetReferencedFiles(); | 2103 const std::vector<base::FilePath>& file_paths = state.GetReferencedFiles(); |
2090 for (std::vector<base::FilePath>::const_iterator file = file_paths.begin(); | 2104 for (std::vector<base::FilePath>::const_iterator file = file_paths.begin(); |
2091 file != file_paths.end(); ++file) { | 2105 file != file_paths.end(); ++file) { |
2092 if (!policy->CanReadFile(GetProcess()->GetID(), *file)) | 2106 if (!policy->CanReadFile(GetProcess()->GetID(), *file)) |
2093 return false; | 2107 return false; |
2094 } | 2108 } |
2095 return true; | 2109 return true; |
2096 } | 2110 } |
2097 | 2111 |
2098 } // namespace content | 2112 } // namespace content |
OLD | NEW |