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

Unified Diff: content/browser/accessibility/browser_accessibility_manager.cc

Issue 2119283002: Use container::back() and container::pop_back() for content. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/android/content_view_core_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/accessibility/browser_accessibility_manager.cc
diff --git a/content/browser/accessibility/browser_accessibility_manager.cc b/content/browser/accessibility/browser_accessibility_manager.cc
index 6e7bf7a42de6c05cd6969c791ea7168d1e7d6a6f..d2fb4326fb4342f16770d8e616400ca732e03b67 100644
--- a/content/browser/accessibility/browser_accessibility_manager.cc
+++ b/content/browser/accessibility/browser_accessibility_manager.cc
@@ -517,9 +517,7 @@ BrowserAccessibility* BrowserAccessibilityManager::GetActiveDescendant(
bool BrowserAccessibilityManager::NativeViewHasFocus() {
BrowserAccessibilityDelegate* delegate = GetDelegateFromRootManager();
- if (delegate)
- return delegate->AccessibilityViewHasFocus();
- return false;
+ return delegate && delegate->AccessibilityViewHasFocus();
}
BrowserAccessibility* BrowserAccessibilityManager::GetFocus() {
@@ -530,7 +528,7 @@ BrowserAccessibility* BrowserAccessibilityManager::GetFocus() {
BrowserAccessibilityManager* focused_manager = nullptr;
if (focused_tree_id)
- focused_manager =BrowserAccessibilityManager::FromID(focused_tree_id);
+ focused_manager = BrowserAccessibilityManager::FromID(focused_tree_id);
// BrowserAccessibilityManager::FromID(focused_tree_id) may return nullptr
// if the tree is not created or has been destroyed.
@@ -853,8 +851,7 @@ base::string16 BrowserAccessibilityManager::GetTextForRange(
text += text_only_objects[i]->GetText();
}
- const BrowserAccessibility* end_text_object =
- text_only_objects[text_only_objects.size() - 1];
+ const BrowserAccessibility* end_text_object = text_only_objects.back();
if (end_offset <= static_cast<int>(end_text_object->GetText().length())) {
text += end_text_object->GetText().substr(0, end_offset);
} else {
« no previous file with comments | « no previous file | content/browser/android/content_view_core_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698