| 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 16 matching lines...) Expand all Loading... |
| 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 OnFinalMessage(HWND window) OVERRIDE { |
| 34 delegate_->OnNativeConstrainedWindowDestroyed(); | 34 delegate_->OnNativeConstrainedWindowDestroyed(); |
| 35 NativeWidgetWin::OnFinalMessage(window); | 35 NativeWidgetWin::OnFinalMessage(window); |
| 36 } | 36 } |
| 37 virtual LRESULT OnMouseActivate(UINT message, | 37 virtual bool PreHandleMSG(UINT message, |
| 38 WPARAM w_param, | 38 WPARAM w_param, |
| 39 LPARAM l_param) OVERRIDE { | 39 LPARAM l_param, |
| 40 if (IsNonClientHitTestCode(static_cast<UINT>(LOWORD(l_param)))) | 40 LRESULT* result) OVERRIDE { |
| 41 if (message == WM_MOUSEACTIVATE && |
| 42 IsNonClientHitTestCode(static_cast<UINT>(LOWORD(l_param)))) { |
| 41 delegate_->OnNativeConstrainedWindowMouseActivate(); | 43 delegate_->OnNativeConstrainedWindowMouseActivate(); |
| 42 return NativeWidgetWin::OnMouseActivate(message, w_param, l_param); | 44 } |
| 45 return false; |
| 43 } | 46 } |
| 44 | 47 |
| 45 NativeConstrainedWindowDelegate* delegate_; | 48 NativeConstrainedWindowDelegate* delegate_; |
| 46 | 49 |
| 47 DISALLOW_COPY_AND_ASSIGN(NativeConstrainedWindowWin); | 50 DISALLOW_COPY_AND_ASSIGN(NativeConstrainedWindowWin); |
| 48 }; | 51 }; |
| 49 | 52 |
| 50 //////////////////////////////////////////////////////////////////////////////// | 53 //////////////////////////////////////////////////////////////////////////////// |
| 51 // NativeConstrainedWindow, public: | 54 // NativeConstrainedWindow, public: |
| 52 | 55 |
| 53 // static | 56 // static |
| 54 NativeConstrainedWindow* NativeConstrainedWindow::CreateNativeConstrainedWindow( | 57 NativeConstrainedWindow* NativeConstrainedWindow::CreateNativeConstrainedWindow( |
| 55 NativeConstrainedWindowDelegate* delegate) { | 58 NativeConstrainedWindowDelegate* delegate) { |
| 56 return new NativeConstrainedWindowWin(delegate); | 59 return new NativeConstrainedWindowWin(delegate); |
| 57 } | 60 } |
| OLD | NEW |