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

Side by Side Diff: ui/views/widget/native_widget_aura.cc

Issue 11962021: Revert 177182 - ViewTest.ChangeNativeViewHierarchyFindRoots failure (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 11 months 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_stacking_client.cc ('k') | ui/views/widget/widget.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 (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/widget/native_widget_aura.h" 5 #include "ui/views/widget/native_widget_aura.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "third_party/skia/include/core/SkRegion.h" 9 #include "third_party/skia/include/core/SkRegion.h"
10 #include "ui/aura/client/activation_client.h" 10 #include "ui/aura/client/activation_client.h"
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 // will be added to the same display as the parent. 129 // will be added to the same display as the parent.
130 gfx::Rect bounds = gfx::Screen::GetScreenFor(parent)-> 130 gfx::Rect bounds = gfx::Screen::GetScreenFor(parent)->
131 GetDisplayNearestWindow(parent).bounds(); 131 GetDisplayNearestWindow(parent).bounds();
132 window_bounds.set_origin(bounds.origin()); 132 window_bounds.set_origin(bounds.origin());
133 } 133 }
134 } 134 }
135 135
136 if (parent) { 136 if (parent) {
137 parent->AddChild(window_); 137 parent->AddChild(window_);
138 } else { 138 } else {
139 window_->SetDefaultParentByRootWindow(context->GetRootWindow(), 139 // TODO(erg): Once I've threaded context through chrome, uncomment this
140 window_bounds); 140 // check, which currently fails on the NULL == NULL case.
141 //
142 // DCHECK_NE(params.GetParent(), params.context);
143
144 // TODO(erg): Remove this NULL check once we've made everything in views
145 // actually pass us a context.
146 aura::RootWindow* root_window = context ? context->GetRootWindow() : NULL;
147 window_->SetDefaultParentByRootWindow(root_window, window_bounds);
141 } 148 }
142 149
143 // Wait to set the bounds until we have a parent. That way we can know our 150 // Wait to set the bounds until we have a parent. That way we can know our
144 // true state/bounds (the LayoutManager may enforce a particular 151 // true state/bounds (the LayoutManager may enforce a particular
145 // state/bounds). 152 // state/bounds).
146 if (IsMaximized()) 153 if (IsMaximized())
147 SetRestoreBounds(window_, window_bounds); 154 SetRestoreBounds(window_, window_bounds);
148 else 155 else
149 SetBounds(window_bounds); 156 SetBounds(window_bounds);
150 window_->set_ignore_events(!params.accept_events); 157 window_->set_ignore_events(!params.accept_events);
(...skipping 899 matching lines...) Expand 10 before | Expand all | Expand 10 after
1050 return aura::Env::GetInstance()->is_mouse_button_down(); 1057 return aura::Env::GetInstance()->is_mouse_button_down();
1051 } 1058 }
1052 1059
1053 // static 1060 // static
1054 bool NativeWidgetPrivate::IsTouchDown() { 1061 bool NativeWidgetPrivate::IsTouchDown() {
1055 return aura::Env::GetInstance()->is_touch_down(); 1062 return aura::Env::GetInstance()->is_touch_down();
1056 } 1063 }
1057 1064
1058 } // namespace internal 1065 } // namespace internal
1059 } // namespace views 1066 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_stacking_client.cc ('k') | ui/views/widget/widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698