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

Side by Side Diff: chrome/browser/chromeos/login/wizard_accessibility_handler.cc

Issue 6609008: Change other usages of .size() to .empty() when applicable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Peter nits Created 9 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/chromeos/login/wizard_accessibility_handler.h" 5 #include "chrome/browser/chromeos/login/wizard_accessibility_handler.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/i18n/char_iterator.h" 9 #include "base/i18n/char_iterator.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 old_indices[prefix_char_len], 423 old_indices[prefix_char_len],
424 old_indices[old_suffix_char_start] - old_indices[prefix_char_len]); 424 old_indices[old_suffix_char_start] - old_indices[prefix_char_len]);
425 425
426 // Find the substring that was inserted (if any) to get the new string 426 // Find the substring that was inserted (if any) to get the new string
427 // from the old - it's the part in the middle of the new string if you 427 // from the old - it's the part in the middle of the new string if you
428 // remove the common prefix and suffix. 428 // remove the common prefix and suffix.
429 std::string inserted = new_value.substr( 429 std::string inserted = new_value.substr(
430 new_indices[prefix_char_len], 430 new_indices[prefix_char_len],
431 new_indices[new_suffix_char_start] - new_indices[prefix_char_len]); 431 new_indices[new_suffix_char_start] - new_indices[prefix_char_len]);
432 432
433 if (inserted.size() > 0 && deleted.size() > 0) { 433 if (!inserted.empty() && !deleted.empty()) {
434 // Replace one substring with another, speak inserted text. 434 // Replace one substring with another, speak inserted text.
435 AppendUtterance(inserted, out_spoken_description); 435 AppendUtterance(inserted, out_spoken_description);
436 } else if (inserted.size() > 0) { 436 } else if (!inserted.empty()) {
437 // Speak inserted text. 437 // Speak inserted text.
438 AppendUtterance(inserted, out_spoken_description); 438 AppendUtterance(inserted, out_spoken_description);
439 } else if (deleted.size() > 0) { 439 } else if (!deleted.empty()) {
440 // Speak deleted text. 440 // Speak deleted text.
441 AppendUtterance(deleted, out_spoken_description); 441 AppendUtterance(deleted, out_spoken_description);
442 } 442 }
443 } 443 }
444 444
445 } // namespace chromeos 445 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/bookmark_pasteboard_helper_mac.mm ('k') | chrome/browser/debugger/devtools_remote_listen_socket.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698