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

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

Issue 642313003: [C++11 Allowed Features] Declares a type-safe null pointer converting from NULL to nullptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Including id in the AUTHORS file. Created 6 years, 2 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
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 "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/strings/string_number_conversions.h" 10 #include "base/strings/string_number_conversions.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 std::string title; 71 std::string title;
72 GURL url; 72 GURL url;
73 GURL favicon_url; 73 GURL favicon_url;
74 if (web_contents) { 74 if (web_contents) {
75 // TODO(nasko): Fix the following code to use a consistent set of data 75 // TODO(nasko): Fix the following code to use a consistent set of data
76 // across the URL, title, and favicon. 76 // across the URL, title, and favicon.
77 url = web_contents->GetURL(); 77 url = web_contents->GetURL();
78 title = base::UTF16ToUTF8(web_contents->GetTitle()); 78 title = base::UTF16ToUTF8(web_contents->GetTitle());
79 NavigationController& controller = web_contents->GetController(); 79 NavigationController& controller = web_contents->GetController();
80 NavigationEntry* entry = controller.GetVisibleEntry(); 80 NavigationEntry* entry = controller.GetVisibleEntry();
81 if (entry != NULL && entry->GetURL().is_valid()) 81 if (entry != nullptr && entry->GetURL().is_valid())
82 favicon_url = entry->GetFavicon().url; 82 favicon_url = entry->GetFavicon().url;
83 } 83 }
84 84
85 return BuildTargetDescriptor(url, 85 return BuildTargetDescriptor(url,
86 title, 86 title,
87 favicon_url, 87 favicon_url,
88 rvh->GetProcess()->GetID(), 88 rvh->GetProcess()->GetID(),
89 rvh->GetRoutingID(), 89 rvh->GetRoutingID(),
90 accessibility_mode); 90 accessibility_mode);
91 } 91 }
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 formatter->SetFilters(filters); 232 formatter->SetFilters(filters);
233 formatter->FormatAccessibilityTree(&accessibility_contents_utf16); 233 formatter->FormatAccessibilityTree(&accessibility_contents_utf16);
234 234
235 result->Set("tree", 235 result->Set("tree",
236 new base::StringValue( 236 new base::StringValue(
237 base::UTF16ToUTF8(accessibility_contents_utf16))); 237 base::UTF16ToUTF8(accessibility_contents_utf16)));
238 web_ui()->CallJavascriptFunction("accessibility.showTree", *(result.get())); 238 web_ui()->CallJavascriptFunction("accessibility.showTree", *(result.get()));
239 } 239 }
240 240
241 } // namespace content 241 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698