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

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

Issue 11416251: Desktop aura: Continue threading context through views. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix erroneously removed line from NWWin tests. Created 8 years 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/views.gyp ('k') | ui/views/widget/native_widget_aura_unittest.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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 // will be added to the same display as the parent. 124 // will be added to the same display as the parent.
125 gfx::Rect bounds = gfx::Screen::GetScreenFor(parent)-> 125 gfx::Rect bounds = gfx::Screen::GetScreenFor(parent)->
126 GetDisplayNearestWindow(parent).bounds(); 126 GetDisplayNearestWindow(parent).bounds();
127 window_bounds.set_origin(bounds.origin()); 127 window_bounds.set_origin(bounds.origin());
128 } 128 }
129 } 129 }
130 130
131 if (parent) { 131 if (parent) {
132 parent->AddChild(window_); 132 parent->AddChild(window_);
133 } else { 133 } else {
134 // TODO(erg): Once I've threaded context through chrome, uncomment this
135 // check, which currently fails on the NULL == NULL case.
136 //
137 // DCHECK_NE(params.GetParent(), params.context);
138
134 // TODO(erg): Remove this NULL check once we've made everything in views 139 // TODO(erg): Remove this NULL check once we've made everything in views
135 // actually pass us a context. 140 // actually pass us a context.
136 aura::RootWindow* root_window = 141 aura::RootWindow* root_window =
137 params.context ? params.context->GetRootWindow() : NULL; 142 params.context ? params.context->GetRootWindow() : NULL;
138 window_->SetDefaultParentByRootWindow(root_window, window_bounds); 143 window_->SetDefaultParentByRootWindow(root_window, window_bounds);
139 } 144 }
140 145
141 // Wait to set the bounds until we have a parent. That way we can know our 146 // Wait to set the bounds until we have a parent. That way we can know our
142 // true state/bounds (the LayoutManager may enforce a particular 147 // true state/bounds (the LayoutManager may enforce a particular
143 // state/bounds). 148 // state/bounds).
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after
1059 return aura::Env::GetInstance()->is_mouse_button_down(); 1064 return aura::Env::GetInstance()->is_mouse_button_down();
1060 } 1065 }
1061 1066
1062 // static 1067 // static
1063 bool NativeWidgetPrivate::IsTouchDown() { 1068 bool NativeWidgetPrivate::IsTouchDown() {
1064 return aura::Env::GetInstance()->is_touch_down(); 1069 return aura::Env::GetInstance()->is_touch_down();
1065 } 1070 }
1066 1071
1067 } // namespace internal 1072 } // namespace internal
1068 } // namespace views 1073 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/views.gyp ('k') | ui/views/widget/native_widget_aura_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698