Chromium Code Reviews| 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/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/strings/string_util.h" | 8 #include "base/strings/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/aura_constants.h" | 10 #include "ui/aura/client/aura_constants.h" |
| (...skipping 1130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1141 // NULL as a special value that meant ask the WindowTreeClient where things | 1141 // NULL as a special value that meant ask the WindowTreeClient where things |
| 1142 // should go.) | 1142 // should go.) |
| 1143 // | 1143 // |
| 1144 // This probably isn't strictly correct, but its an invariant that a Window | 1144 // This probably isn't strictly correct, but its an invariant that a Window |
| 1145 // in use will be attached to a RootWindow, so we can't just call | 1145 // in use will be attached to a RootWindow, so we can't just call |
| 1146 // RemoveChild here. The only possible thing that could assign a RootWindow | 1146 // RemoveChild here. The only possible thing that could assign a RootWindow |
| 1147 // in this case is the stacking client of the current RootWindow. This | 1147 // in this case is the stacking client of the current RootWindow. This |
| 1148 // matches our previous behaviour; the global stacking client would almost | 1148 // matches our previous behaviour; the global stacking client would almost |
| 1149 // always reattach the window to the same RootWindow. | 1149 // always reattach the window to the same RootWindow. |
| 1150 aura::Window* root_window = native_view->GetRootWindow(); | 1150 aura::Window* root_window = native_view->GetRootWindow(); |
| 1151 aura::client::ParentWindowWithContext( | 1151 if (root_window) { |
|
sky
2014/09/12 21:27:05
This makes me nervous. See big comment above this.
ananta
2014/09/14 01:30:44
As per discussion, added code to show hide the Web
| |
| 1152 native_view, root_window, root_window->GetBoundsInScreen()); | 1152 aura::client::ParentWindowWithContext( |
| 1153 native_view, root_window, root_window->GetBoundsInScreen()); | |
| 1154 } | |
| 1153 } | 1155 } |
| 1154 | 1156 |
| 1155 // And now, notify them that they have a brand new parent. | 1157 // And now, notify them that they have a brand new parent. |
| 1156 for (Widget::Widgets::iterator it = widgets.begin(); | 1158 for (Widget::Widgets::iterator it = widgets.begin(); |
| 1157 it != widgets.end(); ++it) { | 1159 it != widgets.end(); ++it) { |
| 1158 (*it)->NotifyNativeViewHierarchyChanged(); | 1160 (*it)->NotifyNativeViewHierarchyChanged(); |
| 1159 } | 1161 } |
| 1160 } | 1162 } |
| 1161 | 1163 |
| 1162 // static | 1164 // static |
| 1163 bool NativeWidgetPrivate::IsMouseButtonDown() { | 1165 bool NativeWidgetPrivate::IsMouseButtonDown() { |
| 1164 return aura::Env::GetInstance()->IsMouseButtonDown(); | 1166 return aura::Env::GetInstance()->IsMouseButtonDown(); |
| 1165 } | 1167 } |
| 1166 | 1168 |
| 1167 // static | 1169 // static |
| 1168 gfx::FontList NativeWidgetPrivate::GetWindowTitleFontList() { | 1170 gfx::FontList NativeWidgetPrivate::GetWindowTitleFontList() { |
| 1169 #if defined(OS_WIN) | 1171 #if defined(OS_WIN) |
| 1170 NONCLIENTMETRICS ncm; | 1172 NONCLIENTMETRICS ncm; |
| 1171 base::win::GetNonClientMetrics(&ncm); | 1173 base::win::GetNonClientMetrics(&ncm); |
| 1172 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); | 1174 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); |
| 1173 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); | 1175 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); |
| 1174 return gfx::FontList(gfx::Font(caption_font)); | 1176 return gfx::FontList(gfx::Font(caption_font)); |
| 1175 #else | 1177 #else |
| 1176 return gfx::FontList(); | 1178 return gfx::FontList(); |
| 1177 #endif | 1179 #endif |
| 1178 } | 1180 } |
| 1179 | 1181 |
| 1180 } // namespace internal | 1182 } // namespace internal |
| 1181 } // namespace views | 1183 } // namespace views |
| OLD | NEW |