Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: chrome/browser/ui/views/native_constrained_window_win.cc

Issue 12045037: Refactor modality-specific behavior from ConstrainedWindowViews to WebContentsModalDialogManager (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Android link error Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/views/constrained_window_views.h"
6
7 #include "ui/views/widget/native_widget_win.h"
8
9 namespace {
10 bool IsNonClientHitTestCode(UINT hittest) {
11 return hittest != HTCLIENT && hittest != HTNOWHERE && hittest != HTCLOSE;
12 }
13 }
14
15 class NativeConstrainedWindowWin : public NativeConstrainedWindow,
16 public views::NativeWidgetWin {
17 public:
18 explicit NativeConstrainedWindowWin(NativeConstrainedWindowDelegate* delegate)
19 : views::NativeWidgetWin(delegate->AsNativeWidgetDelegate()),
20 delegate_(delegate) {
21 }
22
23 virtual ~NativeConstrainedWindowWin() {
24 }
25
26 private:
27 // Overridden from NativeConstrainedWindow:
28 virtual views::NativeWidget* AsNativeWidget() OVERRIDE {
29 return this;
30 }
31
32 // Overridden from views::NativeWidgetWin:
33 virtual void OnFinalMessage(HWND window) OVERRIDE {
34 delegate_->OnNativeConstrainedWindowDestroyed();
35 NativeWidgetWin::OnFinalMessage(window);
36 }
37 virtual bool PreHandleMSG(UINT message,
38 WPARAM w_param,
39 LPARAM l_param,
40 LRESULT* result) OVERRIDE {
41 if (message == WM_MOUSEACTIVATE &&
42 IsNonClientHitTestCode(static_cast<UINT>(LOWORD(l_param)))) {
43 delegate_->OnNativeConstrainedWindowMouseActivate();
44 }
45 return false;
46 }
47
48 NativeConstrainedWindowDelegate* delegate_;
49
50 DISALLOW_COPY_AND_ASSIGN(NativeConstrainedWindowWin);
51 };
52
53 ////////////////////////////////////////////////////////////////////////////////
54 // NativeConstrainedWindow, public:
55
56 // static
57 NativeConstrainedWindow* NativeConstrainedWindow::CreateNativeConstrainedWindow(
58 NativeConstrainedWindowDelegate* delegate) {
59 return new NativeConstrainedWindowWin(delegate);
60 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/native_constrained_window_aura.cc ('k') | chrome/browser/ui/views/ssl_client_certificate_selector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698