Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 380 virtual void OnSysCommand(UINT notification_code, CPoint click); | 380 virtual void OnSysCommand(UINT notification_code, CPoint click); |
| 381 virtual void OnThemeChanged(); | 381 virtual void OnThemeChanged(); |
| 382 virtual void OnVScroll(int scroll_type, short position, HWND scrollbar); | 382 virtual void OnVScroll(int scroll_type, short position, HWND scrollbar); |
| 383 virtual void OnWindowPosChanging(WINDOWPOS* window_pos); | 383 virtual void OnWindowPosChanging(WINDOWPOS* window_pos); |
| 384 virtual void OnWindowPosChanged(WINDOWPOS* window_pos); | 384 virtual void OnWindowPosChanged(WINDOWPOS* window_pos); |
| 385 | 385 |
| 386 // deletes this window as it is destroyed, override to provide different | 386 // deletes this window as it is destroyed, override to provide different |
| 387 // behavior. | 387 // behavior. |
| 388 virtual void OnFinalMessage(HWND window); | 388 virtual void OnFinalMessage(HWND window); |
| 389 | 389 |
| 390 // Returns true if the RootView should be sized to the window rect instead of | 390 // Returns the size that the RootView should be set to in |LayoutRootView|. |
|
Peter Kasting
2009/10/23 05:09:31
Nit: LayoutRootView() rather than |LayoutRootView|
| |
| 391 // the client rect when the widget is resized. This is true if the widget's | 391 virtual gfx::Size GetRootViewSize() const; |
| 392 // WM_NCCALCSIZE handler returns a client rect that differs from the window | |
| 393 // rect but the painted content of the window should still fill the entire | |
| 394 // visible window. | |
| 395 virtual bool SizeRootViewToWindowRect() const { return false; } | |
| 396 | 392 |
| 397 // Start tracking all mouse events so that this window gets sent mouse leave | 393 // Start tracking all mouse events so that this window gets sent mouse leave |
| 398 // messages too. | 394 // messages too. |
| 399 void TrackMouseEvents(DWORD mouse_tracking_flags); | 395 void TrackMouseEvents(DWORD mouse_tracking_flags); |
| 400 | 396 |
| 401 // Actually handle mouse events. These functions are called by subclasses who | 397 // Actually handle mouse events. These functions are called by subclasses who |
| 402 // override the message handlers above to do the actual real work of handling | 398 // override the message handlers above to do the actual real work of handling |
| 403 // the event in the View system. | 399 // the event in the View system. |
| 404 bool ProcessMousePressed(const CPoint& point, | 400 bool ProcessMousePressed(const CPoint& point, |
| 405 UINT flags, | 401 UINT flags, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 452 // Are a subclass of WindowWin? | 448 // Are a subclass of WindowWin? |
| 453 bool is_window_; | 449 bool is_window_; |
| 454 | 450 |
| 455 private: | 451 private: |
| 456 // Implementation of GetWindow. Ascends the parents of |hwnd| returning the | 452 // Implementation of GetWindow. Ascends the parents of |hwnd| returning the |
| 457 // first ancestor that is a Window. | 453 // first ancestor that is a Window. |
| 458 static Window* GetWindowImpl(HWND hwnd); | 454 static Window* GetWindowImpl(HWND hwnd); |
| 459 | 455 |
| 460 // Resize the bitmap used to contain the contents of the layered window. This | 456 // Resize the bitmap used to contain the contents of the layered window. This |
| 461 // recreates the entire bitmap. | 457 // recreates the entire bitmap. |
| 462 void SizeContents(const CRect& window_rect); | 458 void SizeContents(const gfx::Size& window_size); |
| 463 | 459 |
| 464 // Paint into a DIB and then update the layered window with its contents. | 460 // Paint into a DIB and then update the layered window with its contents. |
| 465 void PaintLayeredWindow(); | 461 void PaintLayeredWindow(); |
| 466 | 462 |
| 467 // In layered mode, update the layered window. |dib_dc| represents a handle | 463 // In layered mode, update the layered window. |dib_dc| represents a handle |
| 468 // to a device context that contains the contents of the window. | 464 // to a device context that contains the contents of the window. |
| 469 void UpdateWindowFromContents(HDC dib_dc); | 465 void UpdateWindowFromContents(HDC dib_dc); |
| 470 | 466 |
| 471 // Invoked from WM_DESTROY. Does appropriate cleanup and invokes OnDestroy | 467 // Invoked from WM_DESTROY. Does appropriate cleanup and invokes OnDestroy |
| 472 // so that subclasses can do any cleanup they need to. | 468 // so that subclasses can do any cleanup they need to. |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 538 | 534 |
| 539 // Instance of accessibility information and handling for MSAA root | 535 // Instance of accessibility information and handling for MSAA root |
| 540 ScopedComPtr<IAccessible> accessibility_root_; | 536 ScopedComPtr<IAccessible> accessibility_root_; |
| 541 | 537 |
| 542 scoped_ptr<DefaultThemeProvider> default_theme_provider_; | 538 scoped_ptr<DefaultThemeProvider> default_theme_provider_; |
| 543 }; | 539 }; |
| 544 | 540 |
| 545 } // namespace views | 541 } // namespace views |
| 546 | 542 |
| 547 #endif // VIEWS_WIDGET_WIDGET_WIN_H_ | 543 #endif // VIEWS_WIDGET_WIDGET_WIN_H_ |
| OLD | NEW |