Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(822)

Side by Side Diff: content/browser/accessibility/accessibility_ui.cc

Issue 2867693004: Snapshot of all changes to get jumbo in blink and content.
Patch Set: Exclude certain files from jumbo because of a Windows problem Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/BUILD.gn ('k') | content/browser/appcache/appcache_storage_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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/accessibility/accessibility_ui.h" 5 #include "content/browser/accessibility/accessibility_ui.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 19 matching lines...) Expand all
30 #include "content/public/browser/render_process_host.h" 30 #include "content/public/browser/render_process_host.h"
31 #include "content/public/browser/render_view_host.h" 31 #include "content/public/browser/render_view_host.h"
32 #include "content/public/browser/render_widget_host.h" 32 #include "content/public/browser/render_widget_host.h"
33 #include "content/public/browser/render_widget_host_iterator.h" 33 #include "content/public/browser/render_widget_host_iterator.h"
34 #include "content/public/browser/web_contents.h" 34 #include "content/public/browser/web_contents.h"
35 #include "content/public/browser/web_ui_data_source.h" 35 #include "content/public/browser/web_ui_data_source.h"
36 #include "content/public/common/content_switches.h" 36 #include "content/public/common/content_switches.h"
37 #include "content/public/common/url_constants.h" 37 #include "content/public/common/url_constants.h"
38 #include "net/base/escape.h" 38 #include "net/base/escape.h"
39 39
40 static const char kDataFile[] = "targets-data.json"; 40 static const char kTargetsDataFile[] = "targets-data.json";
41 41
42 static const char kProcessIdField[] = "processId"; 42 static const char kProcessIdField[] = "processId";
43 static const char kRouteIdField[] = "routeId"; 43 static const char kRouteIdField[] = "routeId";
44 static const char kUrlField[] = "url"; 44 static const char kUrlField[] = "url";
45 static const char kNameField[] = "name"; 45 static const char kNameField[] = "name";
46 static const char kFaviconUrlField[] = "favicon_url"; 46 static const char kFaviconUrlField[] = "favicon_url";
47 static const char kPidField[] = "pid"; 47 static const char kPidField[] = "pid";
48 static const char kAccessibilityModeField[] = "a11y_mode"; 48 static const char kAccessibilityModeField[] = "a11y_mode";
49 49
50 // Global flags 50 // Global flags
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 title, 111 title,
112 favicon_url, 112 favicon_url,
113 rvh->GetProcess()->GetID(), 113 rvh->GetProcess()->GetID(),
114 rvh->GetRoutingID(), 114 rvh->GetRoutingID(),
115 accessibility_mode); 115 accessibility_mode);
116 } 116 }
117 117
118 bool HandleRequestCallback(BrowserContext* current_context, 118 bool HandleRequestCallback(BrowserContext* current_context,
119 const std::string& path, 119 const std::string& path,
120 const WebUIDataSource::GotDataCallback& callback) { 120 const WebUIDataSource::GotDataCallback& callback) {
121 if (path != kDataFile) 121 if (path != kTargetsDataFile)
122 return false; 122 return false;
123 std::unique_ptr<base::ListValue> rvh_list(new base::ListValue()); 123 std::unique_ptr<base::ListValue> rvh_list(new base::ListValue());
124 124
125 std::unique_ptr<RenderWidgetHostIterator> widgets( 125 std::unique_ptr<RenderWidgetHostIterator> widgets(
126 RenderWidgetHost::GetRenderWidgetHosts()); 126 RenderWidgetHost::GetRenderWidgetHosts());
127 127
128 while (RenderWidgetHost* widget = widgets->GetNextHost()) { 128 while (RenderWidgetHost* widget = widgets->GetNextHost()) {
129 // Ignore processes that don't have a connection, such as crashed tabs. 129 // Ignore processes that don't have a connection, such as crashed tabs.
130 if (!widget->GetProcess()->HasConnection()) 130 if (!widget->GetProcess()->HasConnection())
131 continue; 131 continue;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 // Add required resources. 198 // Add required resources.
199 html_source->SetJsonPath("strings.js"); 199 html_source->SetJsonPath("strings.js");
200 html_source->AddResourcePath("accessibility.css", IDR_ACCESSIBILITY_CSS); 200 html_source->AddResourcePath("accessibility.css", IDR_ACCESSIBILITY_CSS);
201 html_source->AddResourcePath("accessibility.js", IDR_ACCESSIBILITY_JS); 201 html_source->AddResourcePath("accessibility.js", IDR_ACCESSIBILITY_JS);
202 html_source->SetDefaultResource(IDR_ACCESSIBILITY_HTML); 202 html_source->SetDefaultResource(IDR_ACCESSIBILITY_HTML);
203 html_source->SetRequestFilter( 203 html_source->SetRequestFilter(
204 base::Bind(&HandleRequestCallback, 204 base::Bind(&HandleRequestCallback,
205 web_ui->GetWebContents()->GetBrowserContext())); 205 web_ui->GetWebContents()->GetBrowserContext()));
206 206
207 std::unordered_set<std::string> exclude_from_gzip; 207 std::unordered_set<std::string> exclude_from_gzip;
208 exclude_from_gzip.insert(kDataFile); 208 exclude_from_gzip.insert(kTargetsDataFile);
209 html_source->UseGzip(exclude_from_gzip); 209 html_source->UseGzip(exclude_from_gzip);
210 210
211 BrowserContext* browser_context = 211 BrowserContext* browser_context =
212 web_ui->GetWebContents()->GetBrowserContext(); 212 web_ui->GetWebContents()->GetBrowserContext();
213 WebUIDataSource::Add(browser_context, html_source); 213 WebUIDataSource::Add(browser_context, html_source);
214 } 214 }
215 215
216 AccessibilityUI::~AccessibilityUI() {} 216 AccessibilityUI::~AccessibilityUI() {}
217 217
218 void AccessibilityUI::ToggleAccessibility(const base::ListValue* args) { 218 void AccessibilityUI::ToggleAccessibility(const base::ListValue* args) {
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 auto* ax_mgr = web_contents->GetOrCreateRootBrowserAccessibilityManager(); 351 auto* ax_mgr = web_contents->GetOrCreateRootBrowserAccessibilityManager();
352 DCHECK(ax_mgr); 352 DCHECK(ax_mgr);
353 formatter->FormatAccessibilityTree(ax_mgr->GetRoot(), 353 formatter->FormatAccessibilityTree(ax_mgr->GetRoot(),
354 &accessibility_contents_utf16); 354 &accessibility_contents_utf16);
355 result->SetString("tree", base::UTF16ToUTF8(accessibility_contents_utf16)); 355 result->SetString("tree", base::UTF16ToUTF8(accessibility_contents_utf16));
356 web_ui()->CallJavascriptFunctionUnsafe("accessibility.showTree", 356 web_ui()->CallJavascriptFunctionUnsafe("accessibility.showTree",
357 *(result.get())); 357 *(result.get()));
358 } 358 }
359 359
360 } // namespace content 360 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/BUILD.gn ('k') | content/browser/appcache/appcache_storage_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698