| 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 1881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1892 | 1892 |
| 1893 void RenderViewHostImpl::OnAccessibilityNotifications( | 1893 void RenderViewHostImpl::OnAccessibilityNotifications( |
| 1894 const std::vector<AccessibilityHostMsg_NotificationParams>& params) { | 1894 const std::vector<AccessibilityHostMsg_NotificationParams>& params) { |
| 1895 if (view_ && !is_swapped_out_) | 1895 if (view_ && !is_swapped_out_) |
| 1896 view_->OnAccessibilityNotifications(params); | 1896 view_->OnAccessibilityNotifications(params); |
| 1897 | 1897 |
| 1898 for (unsigned i = 0; i < params.size(); i++) { | 1898 for (unsigned i = 0; i < params.size(); i++) { |
| 1899 const AccessibilityHostMsg_NotificationParams& param = params[i]; | 1899 const AccessibilityHostMsg_NotificationParams& param = params[i]; |
| 1900 AccessibilityNotification src_type = param.notification_type; | 1900 AccessibilityNotification src_type = param.notification_type; |
| 1901 | 1901 |
| 1902 if ((src_type == AccessibilityNotificationLayoutComplete || | 1902 bool is_about_blank = false; |
| 1903 src_type == AccessibilityNotificationLoadComplete) && | 1903 for (unsigned j = 0; j < param.nodes.size(); j++) { |
| 1904 save_accessibility_tree_for_testing_) { | 1904 std::map<AccessibilityNodeData::StringAttribute, string16>::const_iterator
iter; |
| 1905 MakeAccessibilityNodeDataTree(param.nodes, &accessibility_tree_); | 1905 iter = param.nodes[j].string_attributes.find( |
| 1906 AccessibilityNodeData::ATTR_DOC_URL); |
| 1907 if (iter != param.nodes[j].string_attributes.end()) { |
| 1908 string16 doc_url = iter->second; |
| 1909 if (doc_url == ASCIIToUTF16("about:blank")) |
| 1910 is_about_blank = true; |
| 1911 } |
| 1906 } | 1912 } |
| 1907 | 1913 |
| 1908 if (src_type == AccessibilityNotificationLayoutComplete) { | 1914 if (!is_about_blank) { |
| 1909 accessibility_layout_callback_.Run(); | 1915 if ((src_type == AccessibilityNotificationLayoutComplete || |
| 1910 } else if (src_type == AccessibilityNotificationLoadComplete) { | 1916 src_type == AccessibilityNotificationLoadComplete) && |
| 1911 accessibility_load_callback_.Run(); | 1917 save_accessibility_tree_for_testing_) { |
| 1912 } else { | 1918 MakeAccessibilityNodeDataTree(param.nodes, &accessibility_tree_); |
| 1913 accessibility_other_callback_.Run(); | 1919 } |
| 1920 |
| 1921 if (src_type == AccessibilityNotificationLayoutComplete) { |
| 1922 accessibility_layout_callback_.Run(); |
| 1923 } else if (src_type == AccessibilityNotificationLoadComplete) { |
| 1924 accessibility_load_callback_.Run(); |
| 1925 } else { |
| 1926 accessibility_other_callback_.Run(); |
| 1927 } |
| 1914 } | 1928 } |
| 1915 } | 1929 } |
| 1916 | 1930 |
| 1917 Send(new AccessibilityMsg_Notifications_ACK(GetRoutingID())); | 1931 Send(new AccessibilityMsg_Notifications_ACK(GetRoutingID())); |
| 1918 } | 1932 } |
| 1919 | 1933 |
| 1920 void RenderViewHostImpl::OnScriptEvalResponse(int id, | 1934 void RenderViewHostImpl::OnScriptEvalResponse(int id, |
| 1921 const base::ListValue& result) { | 1935 const base::ListValue& result) { |
| 1922 const base::Value* result_value; | 1936 const base::Value* result_value; |
| 1923 if (!result.Get(0, &result_value)) { | 1937 if (!result.Get(0, &result_value)) { |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2079 webkit_glue::FilePathsFromHistoryState(state); | 2093 webkit_glue::FilePathsFromHistoryState(state); |
| 2080 for (std::vector<base::FilePath>::const_iterator file = file_paths.begin(); | 2094 for (std::vector<base::FilePath>::const_iterator file = file_paths.begin(); |
| 2081 file != file_paths.end(); ++file) { | 2095 file != file_paths.end(); ++file) { |
| 2082 if (!policy->CanReadFile(GetProcess()->GetID(), *file)) | 2096 if (!policy->CanReadFile(GetProcess()->GetID(), *file)) |
| 2083 return false; | 2097 return false; |
| 2084 } | 2098 } |
| 2085 return true; | 2099 return true; |
| 2086 } | 2100 } |
| 2087 | 2101 |
| 2088 } // namespace content | 2102 } // namespace content |
| OLD | NEW |