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

Side by Side Diff: ui/accessibility/ax_node_data.cc

Issue 1349783006: Cleanup: Pass std::string as const reference if possible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert third_party changes Created 5 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
OLDNEW
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 "ui/accessibility/ax_node_data.h" 5 #include "ui/accessibility/ax_node_data.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 void AXNodeData::AddBoolAttribute( 237 void AXNodeData::AddBoolAttribute(
238 AXBoolAttribute attribute, bool value) { 238 AXBoolAttribute attribute, bool value) {
239 bool_attributes.push_back(std::make_pair(attribute, value)); 239 bool_attributes.push_back(std::make_pair(attribute, value));
240 } 240 }
241 241
242 void AXNodeData::AddIntListAttribute( 242 void AXNodeData::AddIntListAttribute(
243 AXIntListAttribute attribute, const std::vector<int32>& value) { 243 AXIntListAttribute attribute, const std::vector<int32>& value) {
244 intlist_attributes.push_back(std::make_pair(attribute, value)); 244 intlist_attributes.push_back(std::make_pair(attribute, value));
245 } 245 }
246 246
247 void AXNodeData::SetName(std::string name) { 247 void AXNodeData::SetName(const std::string& name) {
248 string_attributes.push_back(std::make_pair(AX_ATTR_NAME, name)); 248 string_attributes.push_back(std::make_pair(AX_ATTR_NAME, name));
249 } 249 }
250 250
251 void AXNodeData::SetValue(std::string value) { 251 void AXNodeData::SetValue(const std::string& value) {
252 string_attributes.push_back(std::make_pair(AX_ATTR_VALUE, value)); 252 string_attributes.push_back(std::make_pair(AX_ATTR_VALUE, value));
253 } 253 }
254 254
255 std::string AXNodeData::ToString() const { 255 std::string AXNodeData::ToString() const {
256 std::string result; 256 std::string result;
257 257
258 result += "id=" + IntToString(id); 258 result += "id=" + IntToString(id);
259 result += " " + ui::ToString(role); 259 result += " " + ui::ToString(role);
260 260
261 if (state & (1 << AX_STATE_BUSY)) 261 if (state & (1 << AX_STATE_BUSY))
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after
676 bool AXNodeData::IsRoot() const { 676 bool AXNodeData::IsRoot() const {
677 return (role == AX_ROLE_ROOT_WEB_AREA || 677 return (role == AX_ROLE_ROOT_WEB_AREA ||
678 role == AX_ROLE_DESKTOP); 678 role == AX_ROLE_DESKTOP);
679 } 679 }
680 680
681 void AXNodeData::SetRoot() { 681 void AXNodeData::SetRoot() {
682 role = AX_ROLE_ROOT_WEB_AREA; 682 role = AX_ROLE_ROOT_WEB_AREA;
683 } 683 }
684 684
685 } // namespace ui 685 } // namespace ui
OLDNEW
« no previous file with comments | « ui/accessibility/ax_node_data.h ('k') | ui/compositor/layer.cc » ('j') | url/gurl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698