| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/ui/views/constrained_window_views.h" | 5 #include "chrome/browser/ui/views/constrained_window_views.h" |
| 6 | 6 |
| 7 #include "views/window/window_win.h" | 7 #include "views/window/window_win.h" |
| 8 | 8 |
| 9 namespace { | 9 namespace { |
| 10 bool IsNonClientHitTestCode(UINT hittest) { | 10 bool IsNonClientHitTestCode(UINT hittest) { |
| 11 return hittest != HTCLIENT && hittest != HTNOWHERE && hittest != HTCLOSE; | 11 return hittest != HTCLIENT && hittest != HTNOWHERE && hittest != HTCLOSE; |
| 12 } | 12 } |
| 13 } | 13 } |
| 14 | 14 |
| 15 class NativeConstrainedWindowWin : public NativeConstrainedWindow, | 15 class NativeConstrainedWindowWin : public NativeConstrainedWindow, |
| 16 public views::WindowWin { | 16 public views::WindowWin { |
| 17 public: | 17 public: |
| 18 NativeConstrainedWindowWin(NativeConstrainedWindowDelegate* delegate, | 18 NativeConstrainedWindowWin(NativeConstrainedWindowDelegate* delegate, |
| 19 views::WindowDelegate* window_delegate) | 19 views::WindowDelegate* window_delegate) |
| 20 : WindowWin(window_delegate), | 20 : WindowWin(window_delegate), |
| 21 delegate_(delegate) { | 21 delegate_(delegate) { |
| 22 views::Widget::CreateParams params( | |
| 23 views::Widget::CreateParams::TYPE_WINDOW); | |
| 24 params.child = true; | |
| 25 SetCreateParams(params); | |
| 26 } | 22 } |
| 27 | 23 |
| 28 virtual ~NativeConstrainedWindowWin() { | 24 virtual ~NativeConstrainedWindowWin() { |
| 29 } | 25 } |
| 30 | 26 |
| 31 private: | 27 private: |
| 32 // Overridden from NativeConstrainedWindow: | 28 // Overridden from NativeConstrainedWindow: |
| 33 virtual void InitNativeConstrainedWindow(gfx::NativeView parent) OVERRIDE { | 29 virtual void InitNativeConstrainedWindow(gfx::NativeView parent) OVERRIDE { |
| 34 WindowWin::Init(parent, gfx::Rect()); | 30 views::Widget::CreateParams params( |
| 31 views::Widget::CreateParams::TYPE_WINDOW); |
| 32 params.child = true; |
| 33 params.parent = parent; |
| 34 GetWidget()->Init(params); |
| 35 } | 35 } |
| 36 virtual views::NativeWindow* AsNativeWindow() OVERRIDE { | 36 virtual views::NativeWindow* AsNativeWindow() OVERRIDE { |
| 37 return this; | 37 return this; |
| 38 } | 38 } |
| 39 | 39 |
| 40 // Overridden from views::WindowWin: | 40 // Overridden from views::WindowWin: |
| 41 virtual void OnFinalMessage(HWND window) OVERRIDE { | 41 virtual void OnFinalMessage(HWND window) OVERRIDE { |
| 42 delegate_->OnNativeConstrainedWindowDestroyed(); | 42 delegate_->OnNativeConstrainedWindowDestroyed(); |
| 43 WindowWin::OnFinalMessage(window); | 43 WindowWin::OnFinalMessage(window); |
| 44 } | 44 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 62 | 62 |
| 63 //////////////////////////////////////////////////////////////////////////////// | 63 //////////////////////////////////////////////////////////////////////////////// |
| 64 // NativeConstrainedWindow, public: | 64 // NativeConstrainedWindow, public: |
| 65 | 65 |
| 66 // static | 66 // static |
| 67 NativeConstrainedWindow* NativeConstrainedWindow::CreateNativeConstrainedWindow( | 67 NativeConstrainedWindow* NativeConstrainedWindow::CreateNativeConstrainedWindow( |
| 68 NativeConstrainedWindowDelegate* delegate, | 68 NativeConstrainedWindowDelegate* delegate, |
| 69 views::WindowDelegate* window_delegate) { | 69 views::WindowDelegate* window_delegate) { |
| 70 return new NativeConstrainedWindowWin(delegate, window_delegate); | 70 return new NativeConstrainedWindowWin(delegate, window_delegate); |
| 71 } | 71 } |
| OLD | NEW |