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

Side by Side Diff: ui/views/accessibility/native_view_accessibility_auralinux.cc

Issue 1485093003: ui: use base's ContainsValue helper function instead of std::find (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review + view.cc fix Created 5 years 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 | « ui/message_center/message_center_impl.cc ('k') | ui/views/view.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/views/accessibility/native_view_accessibility_auralinux.h" 5 #include "ui/views/accessibility/native_view_accessibility_auralinux.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
11 #include "base/stl_util.h"
11 #include "ui/accessibility/ax_enums.h" 12 #include "ui/accessibility/ax_enums.h"
12 #include "ui/accessibility/ax_node_data.h" 13 #include "ui/accessibility/ax_node_data.h"
13 #include "ui/accessibility/platform/ax_platform_node_auralinux.h" 14 #include "ui/accessibility/platform/ax_platform_node_auralinux.h"
14 #include "ui/accessibility/platform/ax_platform_node_delegate.h" 15 #include "ui/accessibility/platform/ax_platform_node_delegate.h"
15 #include "ui/gfx/native_widget_types.h" 16 #include "ui/gfx/native_widget_types.h"
16 #include "ui/views/views_delegate.h" 17 #include "ui/views/views_delegate.h"
17 #include "ui/views/widget/widget.h" 18 #include "ui/views/widget/widget.h"
18 #include "ui/views/widget/widget_observer.h" 19 #include "ui/views/widget/widget_observer.h"
19 20
20 namespace views { 21 namespace views {
(...skipping 16 matching lines...) Expand all
37 } 38 }
38 39
39 // Called every time we create a new accessibility on a View. 40 // Called every time we create a new accessibility on a View.
40 // Add the top-level widget to our registry so that we can enumerate all 41 // Add the top-level widget to our registry so that we can enumerate all
41 // top-level widgets. 42 // top-level widgets.
42 void RegisterWidget(Widget* widget) { 43 void RegisterWidget(Widget* widget) {
43 if (!widget) 44 if (!widget)
44 return; 45 return;
45 46
46 widget = widget->GetTopLevelWidget(); 47 widget = widget->GetTopLevelWidget();
47 if (std::find(widgets_.begin(), widgets_.end(), widget) != widgets_.end()) 48 if (ContainsValue(widgets_, widget))
48 return; 49 return;
49 50
50 widgets_.push_back(widget); 51 widgets_.push_back(widget);
51 widget->AddObserver(this); 52 widget->AddObserver(this);
52 } 53 }
53 54
54 gfx::NativeViewAccessible GetNativeViewAccessible() { 55 gfx::NativeViewAccessible GetNativeViewAccessible() {
55 return platform_node_->GetNativeViewAccessible(); 56 return platform_node_->GetNativeViewAccessible();
56 } 57 }
57 58
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 } 164 }
164 165
165 gfx::NativeViewAccessible NativeViewAccessibilityAuraLinux::GetParent() { 166 gfx::NativeViewAccessible NativeViewAccessibilityAuraLinux::GetParent() {
166 gfx::NativeViewAccessible parent = NativeViewAccessibility::GetParent(); 167 gfx::NativeViewAccessible parent = NativeViewAccessibility::GetParent();
167 if (!parent) 168 if (!parent)
168 parent = AuraLinuxApplication::GetInstance()->GetNativeViewAccessible(); 169 parent = AuraLinuxApplication::GetInstance()->GetNativeViewAccessible();
169 return parent; 170 return parent;
170 } 171 }
171 172
172 } // namespace views 173 } // namespace views
OLDNEW
« no previous file with comments | « ui/message_center/message_center_impl.cc ('k') | ui/views/view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698