| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef VIEWS_WIDGET_WIDGET_WIN_H_ | 5 #ifndef VIEWS_WIDGET_WIDGET_WIN_H_ |
| 6 #define VIEWS_WIDGET_WIDGET_WIN_H_ | 6 #define VIEWS_WIDGET_WIDGET_WIN_H_ |
| 7 | 7 |
| 8 #include <atlbase.h> | 8 #include <atlbase.h> |
| 9 #include <atlapp.h> | 9 #include <atlapp.h> |
| 10 #include <atlcrack.h> | 10 #include <atlcrack.h> |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // | 64 // |
| 65 /////////////////////////////////////////////////////////////////////////////// | 65 /////////////////////////////////////////////////////////////////////////////// |
| 66 class WidgetWin : public Widget, | 66 class WidgetWin : public Widget, |
| 67 public MessageLoopForUI::Observer, | 67 public MessageLoopForUI::Observer, |
| 68 public FocusTraversable, | 68 public FocusTraversable, |
| 69 public AcceleratorTarget { | 69 public AcceleratorTarget { |
| 70 public: | 70 public: |
| 71 WidgetWin(); | 71 WidgetWin(); |
| 72 virtual ~WidgetWin(); | 72 virtual ~WidgetWin(); |
| 73 | 73 |
| 74 // Initialize the Widget with a parent and an initial desired size. | |
| 75 // |contents_view| is the view that will be the single child of RootView | |
| 76 // within this Widget. As contents_view is inserted into RootView's tree, | |
| 77 // RootView assumes ownership of this view and cleaning it up. If you remove | |
| 78 // this view, you are responsible for its destruction. If this value is NULL, | |
| 79 // the caller is responsible for populating the RootView, and sizing its | |
| 80 // contents as the window is sized. | |
| 81 void Init(HWND parent, const gfx::Rect& bounds); | |
| 82 | |
| 83 // Sets the specified view as the contents of this Widget. There can only | |
| 84 // be one contnets view child of this Widget's RootView. This view is sized to | |
| 85 // fit the entire size of the RootView. The RootView takes ownership of this | |
| 86 // View, unless it is set as not being parent-owned. | |
| 87 virtual void SetContentsView(View* view); | |
| 88 | |
| 89 // Sets the window styles. This is ONLY used when the window is created. | 74 // Sets the window styles. This is ONLY used when the window is created. |
| 90 // In other words, if you invoke this after invoking Init, nothing happens. | 75 // In other words, if you invoke this after invoking Init, nothing happens. |
| 91 void set_window_style(DWORD style) { window_style_ = style; } | 76 void set_window_style(DWORD style) { window_style_ = style; } |
| 92 DWORD window_style() const { return window_style_; } | 77 DWORD window_style() const { return window_style_; } |
| 93 | 78 |
| 94 // Sets the extended window styles. See comment about |set_window_style|. | 79 // Sets the extended window styles. See comment about |set_window_style|. |
| 95 void set_window_ex_style(DWORD style) { window_ex_style_ = style; } | 80 void set_window_ex_style(DWORD style) { window_ex_style_ = style; } |
| 96 DWORD window_ex_style() const { return window_ex_style_; }; | 81 DWORD window_ex_style() const { return window_ex_style_; }; |
| 97 | 82 |
| 98 // Sets the class style to use. The default is CS_DBLCLKS. | 83 // Sets the class style to use. The default is CS_DBLCLKS. |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 MSG_WM_SETTINGCHANGE(OnSettingChange) | 189 MSG_WM_SETTINGCHANGE(OnSettingChange) |
| 205 MSG_WM_SIZE(OnSize) | 190 MSG_WM_SIZE(OnSize) |
| 206 MSG_WM_SYSCOMMAND(OnSysCommand) | 191 MSG_WM_SYSCOMMAND(OnSysCommand) |
| 207 MSG_WM_THEMECHANGED(OnThemeChanged) | 192 MSG_WM_THEMECHANGED(OnThemeChanged) |
| 208 MSG_WM_VSCROLL(OnVScroll) | 193 MSG_WM_VSCROLL(OnVScroll) |
| 209 MSG_WM_WINDOWPOSCHANGING(OnWindowPosChanging) | 194 MSG_WM_WINDOWPOSCHANGING(OnWindowPosChanging) |
| 210 MSG_WM_WINDOWPOSCHANGED(OnWindowPosChanged) | 195 MSG_WM_WINDOWPOSCHANGED(OnWindowPosChanged) |
| 211 END_MSG_MAP() | 196 END_MSG_MAP() |
| 212 | 197 |
| 213 // Overridden from Widget: | 198 // Overridden from Widget: |
| 199 virtual void Init(gfx::NativeView parent, const gfx::Rect& bounds); |
| 200 virtual void SetContentsView(View* view); |
| 214 virtual void GetBounds(gfx::Rect* out, bool including_frame) const; | 201 virtual void GetBounds(gfx::Rect* out, bool including_frame) const; |
| 215 virtual void SetBounds(const gfx::Rect& bounds); | 202 virtual void SetBounds(const gfx::Rect& bounds); |
| 216 virtual void SetShape(const gfx::Path& shape); | 203 virtual void SetShape(const gfx::Path& shape); |
| 217 virtual void Close(); | 204 virtual void Close(); |
| 218 virtual void CloseNow(); | 205 virtual void CloseNow(); |
| 219 virtual void Show(); | 206 virtual void Show(); |
| 220 virtual void Hide(); | 207 virtual void Hide(); |
| 221 virtual gfx::NativeView GetNativeView() const; | 208 virtual gfx::NativeView GetNativeView() const; |
| 222 virtual void PaintNow(const gfx::Rect& update_rect); | 209 virtual void PaintNow(const gfx::Rect& update_rect); |
| 223 virtual void SetOpacity(unsigned char opacity); | 210 virtual void SetOpacity(unsigned char opacity); |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 638 | 625 |
| 639 scoped_ptr<DefaultThemeProvider> default_theme_provider_; | 626 scoped_ptr<DefaultThemeProvider> default_theme_provider_; |
| 640 | 627 |
| 641 // Our hwnd. | 628 // Our hwnd. |
| 642 HWND hwnd_; | 629 HWND hwnd_; |
| 643 }; | 630 }; |
| 644 | 631 |
| 645 } // namespace views | 632 } // namespace views |
| 646 | 633 |
| 647 #endif // #ifndef VIEWS_WIDGET_WIDGET_WIN_H_ | 634 #endif // #ifndef VIEWS_WIDGET_WIDGET_WIN_H_ |
| OLD | NEW |