OLD | NEW |
| (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 "views/widget/native_widget_views.h" | |
8 | |
9 class NativeConstrainedWindowViews : public NativeConstrainedWindow, | |
10 public views::NativeWidgetViews { | |
11 public: | |
12 explicit NativeConstrainedWindowViews( | |
13 NativeConstrainedWindowDelegate* delegate) | |
14 : views::NativeWidgetViews(delegate->AsNativeWidgetDelegate()), | |
15 delegate_(delegate) { | |
16 } | |
17 | |
18 virtual ~NativeConstrainedWindowViews() { | |
19 } | |
20 | |
21 virtual void Activate() OVERRIDE { | |
22 // Views version of ConstrainedWindow is not TYPE_CONTROL and not | |
23 // visible by default. Show when it's activated. | |
24 Show(); | |
25 views::NativeWidgetViews::Activate(); | |
26 } | |
27 | |
28 private: | |
29 // Overridden from NativeConstrainedWindow: | |
30 virtual views::NativeWidget* AsNativeWidget() OVERRIDE { | |
31 return this; | |
32 } | |
33 | |
34 NativeConstrainedWindowDelegate* delegate_; | |
35 | |
36 DISALLOW_COPY_AND_ASSIGN(NativeConstrainedWindowViews); | |
37 }; | |
38 | |
39 //////////////////////////////////////////////////////////////////////////////// | |
40 // NativeConstrainedWindow, public: | |
41 | |
42 // static | |
43 NativeConstrainedWindow* NativeConstrainedWindow::CreateNativeConstrainedWindow( | |
44 NativeConstrainedWindowDelegate* delegate) { | |
45 return new NativeConstrainedWindowViews(delegate); | |
46 } | |
OLD | NEW |