| 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> |
| 11 #include <atlmisc.h> | 11 #include <atlmisc.h> |
| 12 | 12 |
| 13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
| 14 #include "base/system_monitor.h" | 14 #include "base/system_monitor.h" |
| 15 #include "views/focus/focus_manager.h" | 15 #include "views/focus/focus_manager.h" |
| 16 #include "views/layout_manager.h" | 16 #include "views/layout_manager.h" |
| 17 #include "views/widget/widget.h" | 17 #include "views/widget/widget.h" |
| 18 | 18 |
| 19 namespace gfx { | 19 namespace gfx { |
| 20 class Canvas; | 20 class Canvas; |
| 21 class Rect; | 21 class Rect; |
| 22 } | 22 } |
| 23 | 23 |
| 24 namespace views { | 24 namespace views { |
| 25 | 25 |
| 26 class RootView; | 26 class RootView; |
| 27 class TooltipManager; | 27 class TooltipManagerWin; |
| 28 class DefaultThemeProvider; | 28 class DefaultThemeProvider; |
| 29 class Window; | 29 class Window; |
| 30 | 30 |
| 31 bool SetRootViewForHWND(HWND hwnd, RootView* root_view); | 31 bool SetRootViewForHWND(HWND hwnd, RootView* root_view); |
| 32 RootView* GetRootViewForHWND(HWND hwnd); | 32 RootView* GetRootViewForHWND(HWND hwnd); |
| 33 | 33 |
| 34 // A Windows message reflected from other windows. This message is sent | 34 // A Windows message reflected from other windows. This message is sent |
| 35 // with the following arguments: | 35 // with the following arguments: |
| 36 // hWnd - Target window | 36 // hWnd - Target window |
| 37 // uMsg - kReflectedMessage | 37 // uMsg - kReflectedMessage |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 499 // is true. | 499 // is true. |
| 500 virtual bool ReleaseCaptureOnMouseReleased() { return true; } | 500 virtual bool ReleaseCaptureOnMouseReleased() { return true; } |
| 501 | 501 |
| 502 // Creates the RootView to be used within this Widget. Can be overridden to | 502 // Creates the RootView to be used within this Widget. Can be overridden to |
| 503 // create specialized RootView implementations. | 503 // create specialized RootView implementations. |
| 504 virtual RootView* CreateRootView(); | 504 virtual RootView* CreateRootView(); |
| 505 | 505 |
| 506 // Returns true if this WidgetWin is opaque. | 506 // Returns true if this WidgetWin is opaque. |
| 507 bool opaque() const { return opaque_; } | 507 bool opaque() const { return opaque_; } |
| 508 | 508 |
| 509 // The TooltipManager. |
| 510 // WARNING: RootView's destructor calls into the TooltipManager. As such, this |
| 511 // must be destroyed AFTER root_view_. This really only matters during |
| 512 // WM_SESSIONEND, as normally the hwnd is destroyed which tiggers unsetting |
| 513 // the widget in the RootView so that RootView's destructor doesn't call into |
| 514 // the TooltipManager. |
| 515 scoped_ptr<TooltipManagerWin> tooltip_manager_; |
| 516 |
| 509 // The root of the View hierarchy attached to this window. | 517 // The root of the View hierarchy attached to this window. |
| 518 // WARNING: see warning in tooltip_manager_ for ordering dependencies with |
| 519 // this and tooltip_manager_. |
| 510 scoped_ptr<RootView> root_view_; | 520 scoped_ptr<RootView> root_view_; |
| 511 | 521 |
| 512 // Whether or not we have capture the mouse. | 522 // Whether or not we have capture the mouse. |
| 513 bool has_capture_; | 523 bool has_capture_; |
| 514 | 524 |
| 515 // If true, the mouse is currently down. | 525 // If true, the mouse is currently down. |
| 516 bool is_mouse_down_; | 526 bool is_mouse_down_; |
| 517 | 527 |
| 518 scoped_ptr<TooltipManager> tooltip_manager_; | |
| 519 | |
| 520 // Are a subclass of WindowWin? | 528 // Are a subclass of WindowWin? |
| 521 bool is_window_; | 529 bool is_window_; |
| 522 | 530 |
| 523 private: | 531 private: |
| 524 // Implementation of GetWindow. Ascends the parents of |hwnd| returning the | 532 // Implementation of GetWindow. Ascends the parents of |hwnd| returning the |
| 525 // first ancestor that is a Window. | 533 // first ancestor that is a Window. |
| 526 static Window* GetWindowImpl(HWND hwnd); | 534 static Window* GetWindowImpl(HWND hwnd); |
| 527 | 535 |
| 528 // Resize the bitmap used to contain the contents of the layered window. This | 536 // Resize the bitmap used to contain the contents of the layered window. This |
| 529 // recreates the entire bitmap. | 537 // recreates the entire bitmap. |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 | 623 |
| 616 scoped_ptr<DefaultThemeProvider> default_theme_provider_; | 624 scoped_ptr<DefaultThemeProvider> default_theme_provider_; |
| 617 | 625 |
| 618 // Our hwnd. | 626 // Our hwnd. |
| 619 HWND hwnd_; | 627 HWND hwnd_; |
| 620 }; | 628 }; |
| 621 | 629 |
| 622 } // namespace views | 630 } // namespace views |
| 623 | 631 |
| 624 #endif // #ifndef VIEWS_WIDGET_WIDGET_WIN_H_ | 632 #endif // #ifndef VIEWS_WIDGET_WIDGET_WIN_H_ |
| OLD | NEW |