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

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

Issue 6881107: Rework the way Widget::Init works: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/generic_info_view_unittest.cc ('k') | chrome/browser/ui/views/notifications/balloon_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698