| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "views/widget/widget_win.h" | 5 #include "views/widget/widget_win.h" |
| 6 | 6 |
| 7 #include "app/gfx/canvas.h" | 7 #include "app/gfx/canvas.h" |
| 8 #include "app/gfx/native_theme_win.h" | 8 #include "app/gfx/native_theme_win.h" |
| 9 #include "app/gfx/path.h" | 9 #include "app/gfx/path.h" |
| 10 #include "app/l10n_util_win.h" | 10 #include "app/l10n_util_win.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 use_layered_buffer_ = (use_layered_buffer_ && | 123 use_layered_buffer_ = (use_layered_buffer_ && |
| 124 !!(window_ex_style() & WS_EX_LAYERED)); | 124 !!(window_ex_style() & WS_EX_LAYERED)); |
| 125 | 125 |
| 126 default_theme_provider_.reset(new DefaultThemeProvider()); | 126 default_theme_provider_.reset(new DefaultThemeProvider()); |
| 127 | 127 |
| 128 SetWindowSupportsRerouteMouseWheel(hwnd()); | 128 SetWindowSupportsRerouteMouseWheel(hwnd()); |
| 129 | 129 |
| 130 drop_target_ = new DropTargetWin(root_view_.get()); | 130 drop_target_ = new DropTargetWin(root_view_.get()); |
| 131 | 131 |
| 132 if ((window_style() & WS_CHILD) == 0 || | 132 if ((window_style() & WS_CHILD) == 0 || |
| 133 WidgetWin::GetRootWidget(parent) == NULL) { | 133 (WidgetWin::GetRootWidget(parent) == NULL && |
| 134 parent != GetDesktopWindow())) { |
| 134 // Top-level widgets and child widgets who do not have a top-level widget | 135 // Top-level widgets and child widgets who do not have a top-level widget |
| 135 // ancestor get a FocusManager. | 136 // ancestor get a FocusManager. Child widgets parented to the desktop do not |
| 137 // get a FocusManager because parenting to the desktop is the technique used |
| 138 // to intentionally exclude a widget from the FocusManager hierarchy. |
| 136 focus_manager_.reset(new FocusManager(this)); | 139 focus_manager_.reset(new FocusManager(this)); |
| 137 } | 140 } |
| 138 | 141 |
| 139 // Sets the RootView as a property, so the automation can introspect windows. | 142 // Sets the RootView as a property, so the automation can introspect windows. |
| 140 SetRootViewForHWND(hwnd(), root_view_.get()); | 143 SetRootViewForHWND(hwnd(), root_view_.get()); |
| 141 | 144 |
| 142 MessageLoopForUI::current()->AddObserver(this); | 145 MessageLoopForUI::current()->AddObserver(this); |
| 143 | 146 |
| 144 // Windows special DWM window frame requires a special tooltip manager so | 147 // Windows special DWM window frame requires a special tooltip manager so |
| 145 // that window controls in Chrome windows don't flicker when you move your | 148 // that window controls in Chrome windows don't flicker when you move your |
| (...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1322 } | 1325 } |
| 1323 return NULL; | 1326 return NULL; |
| 1324 } | 1327 } |
| 1325 | 1328 |
| 1326 // static | 1329 // static |
| 1327 Widget* Widget::GetWidgetFromNativeWindow(gfx::NativeWindow native_window) { | 1330 Widget* Widget::GetWidgetFromNativeWindow(gfx::NativeWindow native_window) { |
| 1328 return Widget::GetWidgetFromNativeView(native_window); | 1331 return Widget::GetWidgetFromNativeView(native_window); |
| 1329 } | 1332 } |
| 1330 | 1333 |
| 1331 } // namespace views | 1334 } // namespace views |
| OLD | NEW |