| 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 CHROME_VIEWS_WIDGET_WIDGET_WIN_H_ | 5 #ifndef CHROME_VIEWS_WIDGET_WIDGET_WIN_H_ |
| 6 #define CHROME_VIEWS_WIDGET_WIDGET_WIN_H_ | 6 #define CHROME_VIEWS_WIDGET_WIDGET_WIN_H_ |
| 7 | 7 |
| 8 #include <atlbase.h> | 8 #include <atlbase.h> |
| 9 #include <atlcrack.h> | 9 #include <atlcrack.h> |
| 10 | 10 |
| 11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
| 12 #include "base/system_monitor.h" | 12 #include "base/system_monitor.h" |
| 13 #include "chrome/views/focus/focus_manager.h" | 13 #include "chrome/views/focus/focus_manager.h" |
| 14 #include "chrome/views/layout_manager.h" | 14 #include "chrome/views/layout_manager.h" |
| 15 #include "chrome/views/widget/widget.h" | 15 #include "chrome/views/widget/widget.h" |
| 16 | 16 |
| 17 class ChromeCanvas; | 17 class ChromeCanvas; |
| 18 | 18 |
| 19 namespace gfx { | 19 namespace gfx { |
| 20 class Rect; | 20 class Rect; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace views { | 23 namespace views { |
| 24 | 24 |
| 25 class RootView; | 25 class RootView; |
| 26 class TooltipManager; | 26 class TooltipManager; |
| 27 class Window; |
| 27 | 28 |
| 28 bool SetRootViewForHWND(HWND hwnd, RootView* root_view); | 29 bool SetRootViewForHWND(HWND hwnd, RootView* root_view); |
| 29 RootView* GetRootViewForHWND(HWND hwnd); | 30 RootView* GetRootViewForHWND(HWND hwnd); |
| 30 | 31 |
| 31 // A Windows message reflected from other windows. This message is sent | 32 // A Windows message reflected from other windows. This message is sent |
| 32 // with the following arguments: | 33 // with the following arguments: |
| 33 // hWnd - Target window | 34 // hWnd - Target window |
| 34 // uMsg - kReflectedMessage | 35 // uMsg - kReflectedMessage |
| 35 // wParam - Should be 0 | 36 // wParam - Should be 0 |
| 36 // lParam - Pointer to MSG struct containing the original message. | 37 // lParam - Pointer to MSG struct containing the original message. |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 MSG_WM_SIZE(OnSize) | 225 MSG_WM_SIZE(OnSize) |
| 225 MSG_WM_SYSCOMMAND(OnSysCommand) | 226 MSG_WM_SYSCOMMAND(OnSysCommand) |
| 226 MSG_WM_THEMECHANGED(OnThemeChanged) | 227 MSG_WM_THEMECHANGED(OnThemeChanged) |
| 227 MSG_WM_VSCROLL(OnVScroll) | 228 MSG_WM_VSCROLL(OnVScroll) |
| 228 MSG_WM_WINDOWPOSCHANGING(OnWindowPosChanging) | 229 MSG_WM_WINDOWPOSCHANGING(OnWindowPosChanging) |
| 229 MSG_WM_WINDOWPOSCHANGED(OnWindowPosChanged) | 230 MSG_WM_WINDOWPOSCHANGED(OnWindowPosChanged) |
| 230 END_MSG_MAP() | 231 END_MSG_MAP() |
| 231 | 232 |
| 232 // Overridden from Widget: | 233 // Overridden from Widget: |
| 233 virtual void GetBounds(gfx::Rect* out, bool including_frame) const; | 234 virtual void GetBounds(gfx::Rect* out, bool including_frame) const; |
| 234 virtual void MoveToFront(bool should_activate); | |
| 235 virtual gfx::NativeView GetNativeView() const; | 235 virtual gfx::NativeView GetNativeView() const; |
| 236 virtual void PaintNow(const gfx::Rect& update_rect); | 236 virtual void PaintNow(const gfx::Rect& update_rect); |
| 237 virtual RootView* GetRootView(); | 237 virtual RootView* GetRootView(); |
| 238 virtual bool IsVisible() const; | 238 virtual bool IsVisible() const; |
| 239 virtual bool IsActive() const; | 239 virtual bool IsActive() const; |
| 240 virtual TooltipManager* GetTooltipManager(); | 240 virtual TooltipManager* GetTooltipManager(); |
| 241 virtual Window* GetWindow(); |
| 242 virtual const Window* GetWindow() const; |
| 241 | 243 |
| 242 // Overridden from MessageLoop::Observer: | 244 // Overridden from MessageLoop::Observer: |
| 243 void WillProcessMessage(const MSG& msg); | 245 void WillProcessMessage(const MSG& msg); |
| 244 virtual void DidProcessMessage(const MSG& msg); | 246 virtual void DidProcessMessage(const MSG& msg); |
| 245 | 247 |
| 246 // Overridden from FocusTraversable: | 248 // Overridden from FocusTraversable: |
| 247 virtual View* FindNextFocusableView(View* starting_view, | 249 virtual View* FindNextFocusableView(View* starting_view, |
| 248 bool reverse, | 250 bool reverse, |
| 249 Direction direction, | 251 Direction direction, |
| 250 bool dont_loop, | 252 bool dont_loop, |
| (...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 FrameAction current_action_; | 524 FrameAction current_action_; |
| 523 | 525 |
| 524 // Whether or not we have capture the mouse. | 526 // Whether or not we have capture the mouse. |
| 525 bool has_capture_; | 527 bool has_capture_; |
| 526 | 528 |
| 527 // If true, the mouse is currently down. | 529 // If true, the mouse is currently down. |
| 528 bool is_mouse_down_; | 530 bool is_mouse_down_; |
| 529 | 531 |
| 530 scoped_ptr<TooltipManager> tooltip_manager_; | 532 scoped_ptr<TooltipManager> tooltip_manager_; |
| 531 | 533 |
| 534 // Are a subclass of WindowWin? |
| 535 bool is_window_; |
| 536 |
| 532 private: | 537 private: |
| 538 // Implementation of GetWindow. Ascends the parents of |hwnd| returning the |
| 539 // first ancestor that is a Window. |
| 540 static Window* GetWindowImpl(HWND hwnd); |
| 541 |
| 533 // Resize the bitmap used to contain the contents of the layered window. This | 542 // Resize the bitmap used to contain the contents of the layered window. This |
| 534 // recreates the entire bitmap. | 543 // recreates the entire bitmap. |
| 535 void SizeContents(const CRect& window_rect); | 544 void SizeContents(const CRect& window_rect); |
| 536 | 545 |
| 537 // Paint into a DIB and then update the layered window with its contents. | 546 // Paint into a DIB and then update the layered window with its contents. |
| 538 void PaintLayeredWindow(); | 547 void PaintLayeredWindow(); |
| 539 | 548 |
| 540 // In layered mode, update the layered window. |dib_dc| represents a handle | 549 // In layered mode, update the layered window. |dib_dc| represents a handle |
| 541 // to a device context that contains the contents of the window. | 550 // to a device context that contains the contents of the window. |
| 542 void UpdateWindowFromContents(HDC dib_dc); | 551 void UpdateWindowFromContents(HDC dib_dc); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 618 // Instance of accessibility information and handling for MSAA root | 627 // Instance of accessibility information and handling for MSAA root |
| 619 CComPtr<IAccessible> accessibility_root_; | 628 CComPtr<IAccessible> accessibility_root_; |
| 620 | 629 |
| 621 // Our hwnd. | 630 // Our hwnd. |
| 622 HWND hwnd_; | 631 HWND hwnd_; |
| 623 }; | 632 }; |
| 624 | 633 |
| 625 } // namespace views | 634 } // namespace views |
| 626 | 635 |
| 627 #endif // #ifndef CHROME_VIEWS_WIDGET_WIDGET_WIN_H_ | 636 #endif // #ifndef CHROME_VIEWS_WIDGET_WIDGET_WIN_H_ |
| OLD | NEW |