diff options
Diffstat (limited to 'views/controls')
-rw-r--r-- | views/controls/native/native_view_host.cc | 13 | ||||
-rw-r--r-- | views/controls/native/native_view_host.h | 3 | ||||
-rw-r--r-- | views/controls/native/native_view_host_gtk.cc | 4 | ||||
-rw-r--r-- | views/controls/native/native_view_host_gtk.h | 3 | ||||
-rw-r--r-- | views/controls/native/native_view_host_views.cc | 4 | ||||
-rw-r--r-- | views/controls/native/native_view_host_views.h | 3 | ||||
-rw-r--r-- | views/controls/native/native_view_host_win.cc | 18 | ||||
-rw-r--r-- | views/controls/native/native_view_host_win.h | 3 | ||||
-rw-r--r-- | views/controls/native/native_view_host_wrapper.h | 8 | ||||
-rw-r--r-- | views/controls/tabbed_pane/native_tabbed_pane_win.cc | 4 | ||||
-rw-r--r-- | views/controls/tabbed_pane/native_tabbed_pane_win.h | 1 |
11 files changed, 53 insertions, 11 deletions
diff --git a/views/controls/native/native_view_host.cc b/views/controls/native/native_view_host.cc index 42321e5..1b9d74e 100644 --- a/views/controls/native/native_view_host.cc +++ b/views/controls/native/native_view_host.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -200,6 +200,17 @@ bool NativeViewHost::ContainsNativeView(gfx::NativeView native_view) const { return View::ContainsNativeView(native_view); } +gfx::NativeViewAccessible NativeViewHost::GetNativeViewAccessible() { + if (native_wrapper_.get()) { + gfx::NativeViewAccessible accessible_view = + native_wrapper_->GetNativeViewAccessible(); + if (accessible_view) + return accessible_view; + } + + return View::GetNativeViewAccessible(); +} + //////////////////////////////////////////////////////////////////////////////// // NativeViewHost, private: diff --git a/views/controls/native/native_view_host.h b/views/controls/native/native_view_host.h index e19aca2..30e4ddc 100644 --- a/views/controls/native/native_view_host.h +++ b/views/controls/native/native_view_host.h @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -82,6 +82,7 @@ class NativeViewHost : public View { virtual void VisibilityChanged(View* starting_from, bool is_visible); virtual void OnFocus(); virtual bool ContainsNativeView(gfx::NativeView native_view) const; + virtual gfx::NativeViewAccessible GetNativeViewAccessible(); protected: virtual bool NeedsNotificationWhenVisibleBoundsChange() const; diff --git a/views/controls/native/native_view_host_gtk.cc b/views/controls/native/native_view_host_gtk.cc index fedbc416..833e4b4 100644 --- a/views/controls/native/native_view_host_gtk.cc +++ b/views/controls/native/native_view_host_gtk.cc @@ -256,6 +256,10 @@ void NativeViewHostGtk::SetFocus() { gtk_widget_grab_focus(host_->native_view()); } +gfx::NativeViewAccessible NativeViewHostGtk::GetNativeViewAccessible() { + return NULL; +} + //////////////////////////////////////////////////////////////////////////////// // NativeViewHostGtk, private: diff --git a/views/controls/native/native_view_host_gtk.h b/views/controls/native/native_view_host_gtk.h index eb98349..0ecfd99 100644 --- a/views/controls/native/native_view_host_gtk.h +++ b/views/controls/native/native_view_host_gtk.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -38,6 +38,7 @@ class NativeViewHostGtk : public NativeViewHostWrapper { virtual void ShowWidget(int x, int y, int w, int h); virtual void HideWidget(); virtual void SetFocus(); + virtual gfx::NativeViewAccessible GetNativeViewAccessible(); private: // Create and Destroy the GtkFixed that performs clipping on our hosted diff --git a/views/controls/native/native_view_host_views.cc b/views/controls/native/native_view_host_views.cc index 7d44818..4b84a05 100644 --- a/views/controls/native/native_view_host_views.cc +++ b/views/controls/native/native_view_host_views.cc @@ -75,4 +75,8 @@ void NativeViewHostViews::SetFocus() { host_->views_view()->RequestFocus(); } +gfx::NativeViewAccessible NativeViewHostViews::GetNativeViewAccessible() { + return NULL; +} + } // namespace views diff --git a/views/controls/native/native_view_host_views.h b/views/controls/native/native_view_host_views.h index 891cf49..cd9f96b 100644 --- a/views/controls/native/native_view_host_views.h +++ b/views/controls/native/native_view_host_views.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -30,6 +30,7 @@ class NativeViewHostViews : public NativeViewHostWrapper { virtual void ShowWidget(int x, int y, int w, int h); virtual void HideWidget(); virtual void SetFocus(); + virtual gfx::NativeViewAccessible GetNativeViewAccessible(); private: // Our associated NativeViewHost. diff --git a/views/controls/native/native_view_host_win.cc b/views/controls/native/native_view_host_win.cc index f25e722..b7fa074 100644 --- a/views/controls/native/native_view_host_win.cc +++ b/views/controls/native/native_view_host_win.cc @@ -4,6 +4,8 @@ #include "views/controls/native/native_view_host_win.h" +#include <oleacc.h> + #include "base/logging.h" #include "ui/gfx/canvas.h" #include "views/controls/native/native_view_host.h" @@ -123,6 +125,22 @@ void NativeViewHostWin::SetFocus() { ::SetFocus(host_->native_view()); } +gfx::NativeViewAccessible NativeViewHostWin::GetNativeViewAccessible() { + HWND hwnd = host_->native_view(); + if (!IsWindow(hwnd)) + return NULL; + + LRESULT ret = SendMessage(hwnd, WM_GETOBJECT, 0, OBJID_CLIENT); + IAccessible* accessible = NULL; + HRESULT success = ObjectFromLresult( + ret, IID_IDispatch, 0, reinterpret_cast<void**>(accessible)); + if (success == S_OK) { + return accessible; + } else { + return NULL; + } +} + //////////////////////////////////////////////////////////////////////////////// // NativeViewHostWrapper, public: diff --git a/views/controls/native/native_view_host_win.h b/views/controls/native/native_view_host_win.h index fb8d8be..e885399 100644 --- a/views/controls/native/native_view_host_win.h +++ b/views/controls/native/native_view_host_win.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -30,6 +30,7 @@ class NativeViewHostWin : public NativeViewHostWrapper { virtual void ShowWidget(int x, int y, int w, int h); virtual void HideWidget(); virtual void SetFocus(); + virtual gfx::NativeViewAccessible GetNativeViewAccessible(); private: // Our associated NativeViewHost. diff --git a/views/controls/native/native_view_host_wrapper.h b/views/controls/native/native_view_host_wrapper.h index 1b06b3e..8fdd8ad 100644 --- a/views/controls/native/native_view_host_wrapper.h +++ b/views/controls/native/native_view_host_wrapper.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -6,6 +6,8 @@ #define VIEWS_CONTROLS_NATIVE_NATIVE_VIEW_HOST_WRAPPER_H_ #pragma once +#include "ui/gfx/native_widget_types.h" + namespace views { class NativeViewHost; @@ -56,6 +58,10 @@ class NativeViewHostWrapper { // Sets focus to the gfx::NativeView. virtual void SetFocus() = 0; + // Return the native view accessible corresponding to the wrapped native + // view. + virtual gfx::NativeViewAccessible GetNativeViewAccessible() = 0; + // Creates a platform-specific instance of an object implementing this // interface. static NativeViewHostWrapper* CreateWrapper(NativeViewHost* host); diff --git a/views/controls/tabbed_pane/native_tabbed_pane_win.cc b/views/controls/tabbed_pane/native_tabbed_pane_win.cc index a585b1b..829d5a3 100644 --- a/views/controls/tabbed_pane/native_tabbed_pane_win.cc +++ b/views/controls/tabbed_pane/native_tabbed_pane_win.cc @@ -364,10 +364,6 @@ void NativeTabbedPaneWin::ViewHierarchyChanged(bool is_add, } } -Widget* NativeTabbedPaneWin::GetChildWidget() { - return content_window_; -} - //////////////////////////////////////////////////////////////////////////////// // NativeTabbedPaneWin, private: diff --git a/views/controls/tabbed_pane/native_tabbed_pane_win.h b/views/controls/tabbed_pane/native_tabbed_pane_win.h index 4fb2a2e..f3e84ea 100644 --- a/views/controls/tabbed_pane/native_tabbed_pane_win.h +++ b/views/controls/tabbed_pane/native_tabbed_pane_win.h @@ -49,7 +49,6 @@ class NativeTabbedPaneWin : public NativeControlWin, virtual void Layout(); virtual FocusTraversable* GetFocusTraversable(); virtual void ViewHierarchyChanged(bool is_add, View *parent, View *child); - virtual Widget* GetChildWidget(); private: // Called upon creation of native control to initialize tabs that are added |