| 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 "ui/views/widget/native_widget_win.h" | 7 #include "ui/views/widget/native_widget_win.h" |
| 8 | 8 |
| 9 namespace { | 9 namespace { |
| 10 bool IsNonClientHitTestCode(UINT hittest) { | 10 bool IsNonClientHitTestCode(UINT hittest) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 virtual ~NativeConstrainedWindowWin() { | 23 virtual ~NativeConstrainedWindowWin() { |
| 24 } | 24 } |
| 25 | 25 |
| 26 private: | 26 private: |
| 27 // Overridden from NativeConstrainedWindow: | 27 // Overridden from NativeConstrainedWindow: |
| 28 virtual views::NativeWidget* AsNativeWidget() OVERRIDE { | 28 virtual views::NativeWidget* AsNativeWidget() OVERRIDE { |
| 29 return this; | 29 return this; |
| 30 } | 30 } |
| 31 | 31 |
| 32 // Overridden from views::NativeWidgetWin: | 32 // Overridden from views::NativeWidgetWin: |
| 33 virtual void OnFinalMessage(HWND window) OVERRIDE { | 33 virtual void HandleDestroyed() OVERRIDE { |
| 34 delegate_->OnNativeConstrainedWindowDestroyed(); | 34 delegate_->OnNativeConstrainedWindowDestroyed(); |
| 35 NativeWidgetWin::OnFinalMessage(window); | 35 NativeWidgetWin::HandleDestroyed(); |
| 36 } | 36 } |
| 37 virtual LRESULT OnMouseActivate(UINT message, | 37 virtual void HandleMouseActivate(int hittest_code) OVERRIDE { |
| 38 WPARAM w_param, | 38 if (IsNonClientHitTestCode(hittest_code)) |
| 39 LPARAM l_param) OVERRIDE { | |
| 40 if (IsNonClientHitTestCode(static_cast<UINT>(LOWORD(l_param)))) | |
| 41 delegate_->OnNativeConstrainedWindowMouseActivate(); | 39 delegate_->OnNativeConstrainedWindowMouseActivate(); |
| 42 return NativeWidgetWin::OnMouseActivate(message, w_param, l_param); | |
| 43 } | 40 } |
| 44 | 41 |
| 45 NativeConstrainedWindowDelegate* delegate_; | 42 NativeConstrainedWindowDelegate* delegate_; |
| 46 | 43 |
| 47 DISALLOW_COPY_AND_ASSIGN(NativeConstrainedWindowWin); | 44 DISALLOW_COPY_AND_ASSIGN(NativeConstrainedWindowWin); |
| 48 }; | 45 }; |
| 49 | 46 |
| 50 //////////////////////////////////////////////////////////////////////////////// | 47 //////////////////////////////////////////////////////////////////////////////// |
| 51 // NativeConstrainedWindow, public: | 48 // NativeConstrainedWindow, public: |
| 52 | 49 |
| 53 // static | 50 // static |
| 54 NativeConstrainedWindow* NativeConstrainedWindow::CreateNativeConstrainedWindow( | 51 NativeConstrainedWindow* NativeConstrainedWindow::CreateNativeConstrainedWindow( |
| 55 NativeConstrainedWindowDelegate* delegate) { | 52 NativeConstrainedWindowDelegate* delegate) { |
| 56 return new NativeConstrainedWindowWin(delegate); | 53 return new NativeConstrainedWindowWin(delegate); |
| 57 } | 54 } |
| OLD | NEW |