| OLD | NEW |
| 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/ui/views/accessible_view_helper.h" | 5 #include "chrome/browser/ui/views/accessible_view_helper.h" |
| 6 | 6 |
| 7 #include "chrome/browser/accessibility_events.h" | 7 #include "chrome/browser/accessibility_events.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ui/views/accessibility_event_router_views.h" | 9 #include "chrome/browser/ui/views/accessibility_event_router_views.h" |
| 10 #include "chrome/common/notification_service.h" | 10 #include "chrome/common/notification_service.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 | 72 |
| 73 void AccessibleViewHelper::SetViewName(views::View* view, int string_id) { | 73 void AccessibleViewHelper::SetViewName(views::View* view, int string_id) { |
| 74 const std::string name = l10n_util::GetStringUTF8(string_id); | 74 const std::string name = l10n_util::GetStringUTF8(string_id); |
| 75 SetViewName(view, name); | 75 SetViewName(view, name); |
| 76 } | 76 } |
| 77 | 77 |
| 78 gfx::NativeView AccessibleViewHelper::GetNativeView(views::View* view) const { | 78 gfx::NativeView AccessibleViewHelper::GetNativeView(views::View* view) const { |
| 79 if (view->GetClassName() == views::NativeViewHost::kViewClassName) | 79 if (view->GetClassName() == views::NativeViewHost::kViewClassName) |
| 80 return static_cast<views::NativeViewHost*>(view)->native_view(); | 80 return static_cast<views::NativeViewHost*>(view)->native_view(); |
| 81 | 81 |
| 82 for (int i = 0; i < view->GetChildViewCount(); i++) { | 82 for (size_t i = 0; i < view->child_count(); i++) { |
| 83 gfx::NativeView native_view = GetNativeView(view->GetChildViewAt(i)); | 83 gfx::NativeView native_view = GetNativeView(view->GetChildViewAt(i)); |
| 84 if (native_view) | 84 if (native_view) |
| 85 return native_view; | 85 return native_view; |
| 86 } | 86 } |
| 87 | 87 |
| 88 return NULL; | 88 return NULL; |
| 89 } | 89 } |
| OLD | NEW |