| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/controls/native/native_view_host.h" | 5 #include "ui/views/controls/native/native_view_host.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ui/gfx/canvas.h" | 8 #include "ui/gfx/canvas.h" |
| 9 #include "ui/views/controls/native/native_view_host_wrapper.h" | 9 #include "ui/views/controls/native/native_view_host_wrapper.h" |
| 10 #include "ui/views/widget/widget.h" | 10 #include "ui/views/widget/widget.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 native_wrapper_->RemovedFromWidget(); | 156 native_wrapper_->RemovedFromWidget(); |
| 157 } | 157 } |
| 158 } | 158 } |
| 159 | 159 |
| 160 std::string NativeViewHost::GetClassName() const { | 160 std::string NativeViewHost::GetClassName() const { |
| 161 return kViewClassName; | 161 return kViewClassName; |
| 162 } | 162 } |
| 163 | 163 |
| 164 void NativeViewHost::OnFocus() { | 164 void NativeViewHost::OnFocus() { |
| 165 native_wrapper_->SetFocus(); | 165 native_wrapper_->SetFocus(); |
| 166 GetWidget()->NotifyAccessibilityEvent( | 166 NotifyAccessibilityEvent(ui::AccessibilityTypes::EVENT_FOCUS, true); |
| 167 this, ui::AccessibilityTypes::EVENT_FOCUS, true); | |
| 168 } | 167 } |
| 169 | 168 |
| 170 gfx::NativeViewAccessible NativeViewHost::GetNativeViewAccessible() { | 169 gfx::NativeViewAccessible NativeViewHost::GetNativeViewAccessible() { |
| 171 if (native_wrapper_.get()) { | 170 if (native_wrapper_.get()) { |
| 172 gfx::NativeViewAccessible accessible_view = | 171 gfx::NativeViewAccessible accessible_view = |
| 173 native_wrapper_->GetNativeViewAccessible(); | 172 native_wrapper_->GetNativeViewAccessible(); |
| 174 if (accessible_view) | 173 if (accessible_view) |
| 175 return accessible_view; | 174 return accessible_view; |
| 176 } | 175 } |
| 177 | 176 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 199 Widget::GetAllChildWidgets(native_view(), &widgets); | 198 Widget::GetAllChildWidgets(native_view(), &widgets); |
| 200 for (Widget::Widgets::iterator i = widgets.begin(); i != widgets.end(); ++i) { | 199 for (Widget::Widgets::iterator i = widgets.begin(); i != widgets.end(); ++i) { |
| 201 focus_manager->ViewRemoved((*i)->GetRootView()); | 200 focus_manager->ViewRemoved((*i)->GetRootView()); |
| 202 if (!focus_manager->GetFocusedView()) | 201 if (!focus_manager->GetFocusedView()) |
| 203 return; | 202 return; |
| 204 } | 203 } |
| 205 } | 204 } |
| 206 | 205 |
| 207 | 206 |
| 208 } // namespace views | 207 } // namespace views |
| OLD | NEW |