summaryrefslogtreecommitdiffstats
path: root/views/controls/native
diff options
context:
space:
mode:
authorananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-02 06:11:22 +0000
committerananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-03-02 06:11:22 +0000
commit3ef5d1b8cd0d307dda2b03b7d8bf9c8d7d97e870 (patch)
tree7725c4b1c02db26a7e09c30d325c2777109228d6 /views/controls/native
parent99f5dfdbdf3b9d948750a4bbed07b0a2eef2337e (diff)
downloadchromium_src-3ef5d1b8cd0d307dda2b03b7d8bf9c8d7d97e870.zip
chromium_src-3ef5d1b8cd0d307dda2b03b7d8bf9c8d7d97e870.tar.gz
chromium_src-3ef5d1b8cd0d307dda2b03b7d8bf9c8d7d97e870.tar.bz2
Reverting to fix builder redness. Please fix and reland.
Revert 76483 - Remove/replace RootView/Widget getters with new NativeWidget getters. BUG=72040 TEST=existing unittests. Review URL: http://codereview.chromium.org/6598069 TBR=ben@chromium.org Review URL: http://codereview.chromium.org/6597099 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76508 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views/controls/native')
-rw-r--r--views/controls/native/native_view_host.cc12
-rw-r--r--views/controls/native/native_view_host_win.cc29
2 files changed, 20 insertions, 21 deletions
diff --git a/views/controls/native/native_view_host.cc b/views/controls/native/native_view_host.cc
index 162b1f6..9b6dff2 100644
--- a/views/controls/native/native_view_host.cc
+++ b/views/controls/native/native_view_host.cc
@@ -8,7 +8,7 @@
#include "ui/gfx/canvas.h"
#include "views/controls/native/native_view_host_wrapper.h"
#include "views/controls/native/native_view_host_views.h"
-#include "views/widget/native_widget.h"
+#include "views/widget/root_view.h"
#include "views/widget/widget.h"
namespace views {
@@ -188,12 +188,12 @@ bool NativeViewHost::ContainsNativeView(gfx::NativeView native_view) const {
if (!native_view_)
return false;
- views::NativeWidget* native_widget =
- views::NativeWidget::GetNativeWidgetForNativeView(native_view_);
- if (native_widget &&
- native_widget->GetWidget()->ContainsNativeView(native_view)) {
+ views::Widget* native_widget =
+ views::Widget::GetWidgetFromNativeView(native_view_);
+ views::RootView* root_view =
+ native_widget ? native_widget->GetRootView() : NULL;
+ if (root_view && root_view->ContainsNativeView(native_view))
return true;
- }
return View::ContainsNativeView(native_view);
}
diff --git a/views/controls/native/native_view_host_win.cc b/views/controls/native/native_view_host_win.cc
index dbb8461..88feac7 100644
--- a/views/controls/native/native_view_host_win.cc
+++ b/views/controls/native/native_view_host_win.cc
@@ -8,7 +8,6 @@
#include "ui/gfx/canvas.h"
#include "views/controls/native/native_view_host.h"
#include "views/focus/focus_manager.h"
-#include "views/widget/native_widget.h"
#include "views/widget/root_view.h"
#include "views/widget/widget.h"
@@ -38,13 +37,13 @@ void NativeViewHostWin::NativeViewAttached() {
// Need to set the HWND's parent before changing its size to avoid flashing.
SetParent(host_->native_view(), host_->GetWidget()->GetNativeView());
host_->Layout();
- // Notify children that parent changed, so they can adjust focus.
- NativeWidget::NativeWidgets widgets;
- NativeWidget::GetAllNativeWidgets(host_->native_view(), &widgets);
- for (NativeWidget::NativeWidgets::iterator it = widgets.begin();
- it != widgets.end(); ++it) {
- (*it)->GetWidget()->GetRootView()->NotifyNativeViewHierarchyChanged(
- true,
+ // Notify children that parent changed, so they could adjust the focus
+ std::vector<RootView*> root_views;
+ Widget::FindAllRootViews(host_->native_view(), &root_views);
+ for (std::vector<RootView*>::iterator it = root_views.begin();
+ it < root_views.end();
+ ++it) {
+ (*it)->NotifyNativeViewHierarchyChanged(true,
host_->GetWidget()->GetNativeView());
}
}
@@ -53,13 +52,13 @@ void NativeViewHostWin::NativeViewDetaching(bool destroyed) {
if (!destroyed && installed_clip_)
UninstallClip();
installed_clip_ = false;
- // Notify children that parent is removed.
- NativeWidget::NativeWidgets widgets;
- NativeWidget::GetAllNativeWidgets(host_->native_view(), &widgets);
- for (NativeWidget::NativeWidgets::iterator it = widgets.begin();
- it != widgets.end(); ++it) {
- (*it)->GetWidget()->GetRootView()->NotifyNativeViewHierarchyChanged(
- false,
+ // Notify children that parent is removed
+ std::vector<RootView*> root_views;
+ Widget::FindAllRootViews(host_->native_view(), &root_views);
+ for (std::vector<RootView*>::iterator it = root_views.begin();
+ it < root_views.end();
+ ++it) {
+ (*it)->NotifyNativeViewHierarchyChanged(false,
host_->GetWidget()->GetNativeView());
}
}