Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: views/widget/native_widget_win.h

Issue 7129022: Move last of event handlers down to NativeWidgetWin/Gtk. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « views/widget/native_widget_views.cc ('k') | views/widget/native_widget_win.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 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_NATIVE_WIDGET_WIN_H_ 5 #ifndef VIEWS_WIDGET_NATIVE_WIDGET_WIN_H_
6 #define VIEWS_WIDGET_NATIVE_WIDGET_WIN_H_ 6 #define VIEWS_WIDGET_NATIVE_WIDGET_WIN_H_
7 #pragma once 7 #pragma once
8 8
9 #include <atlbase.h> 9 #include <atlbase.h>
10 #include <atlapp.h> 10 #include <atlapp.h>
(...skipping 12 matching lines...) Expand all
23 #include "views/ime/input_method_delegate.h" 23 #include "views/ime/input_method_delegate.h"
24 #include "views/layout/layout_manager.h" 24 #include "views/layout/layout_manager.h"
25 #include "views/widget/native_widget.h" 25 #include "views/widget/native_widget.h"
26 26
27 namespace ui { 27 namespace ui {
28 class ViewProp; 28 class ViewProp;
29 } 29 }
30 30
31 namespace gfx { 31 namespace gfx {
32 class CanvasSkia; 32 class CanvasSkia;
33 class Font;
33 class Rect; 34 class Rect;
34 } 35 }
35 36
36 namespace views { 37 namespace views {
37 38
38 class DropTargetWin; 39 class DropTargetWin;
39 class RootView; 40 class RootView;
40 class TooltipManagerWin; 41 class TooltipManagerWin;
41 class Window; 42 class Window;
42 43
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 public MessageLoopForUI::Observer, 82 public MessageLoopForUI::Observer,
82 public internal::InputMethodDelegate { 83 public internal::InputMethodDelegate {
83 public: 84 public:
84 explicit NativeWidgetWin(internal::NativeWidgetDelegate* delegate); 85 explicit NativeWidgetWin(internal::NativeWidgetDelegate* delegate);
85 virtual ~NativeWidgetWin(); 86 virtual ~NativeWidgetWin();
86 87
87 // Returns true if we are on Windows Vista or greater and composition is 88 // Returns true if we are on Windows Vista or greater and composition is
88 // enabled. 89 // enabled.
89 static bool IsAeroGlassEnabled(); 90 static bool IsAeroGlassEnabled();
90 91
92 // Returns the system set window title font.
93 static gfx::Font GetWindowTitleFont();
94
91 // Show the window with the specified show command. 95 // Show the window with the specified show command.
92 void Show(int show_state); 96 void Show(int show_state);
93 97
94 // Disable Layered Window updates by setting to false. 98 // Disable Layered Window updates by setting to false.
95 void set_can_update_layered_window(bool can_update_layered_window) { 99 void set_can_update_layered_window(bool can_update_layered_window) {
96 can_update_layered_window_ = can_update_layered_window; 100 can_update_layered_window_ = can_update_layered_window;
97 } 101 }
98 102
99 // Obtain the view event with the given MSAA child id. Used in 103 // Obtain the view event with the given MSAA child id. Used in
100 // NativeViewAccessibilityWin::get_accChild to support requests for 104 // NativeViewAccessibilityWin::get_accChild to support requests for
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 virtual void ReplaceInputMethod(InputMethod* input_method) OVERRIDE; 209 virtual void ReplaceInputMethod(InputMethod* input_method) OVERRIDE;
206 virtual void CenterWindow(const gfx::Size& size) OVERRIDE; 210 virtual void CenterWindow(const gfx::Size& size) OVERRIDE;
207 virtual void GetWindowBoundsAndMaximizedState(gfx::Rect* bounds, 211 virtual void GetWindowBoundsAndMaximizedState(gfx::Rect* bounds,
208 bool* maximized) const OVERRIDE; 212 bool* maximized) const OVERRIDE;
209 virtual void SetWindowTitle(const std::wstring& title) OVERRIDE; 213 virtual void SetWindowTitle(const std::wstring& title) OVERRIDE;
210 virtual void SetWindowIcons(const SkBitmap& window_icon, 214 virtual void SetWindowIcons(const SkBitmap& window_icon,
211 const SkBitmap& app_icon) OVERRIDE; 215 const SkBitmap& app_icon) OVERRIDE;
212 virtual void SetAccessibleName(const std::wstring& name) OVERRIDE; 216 virtual void SetAccessibleName(const std::wstring& name) OVERRIDE;
213 virtual void SetAccessibleRole(ui::AccessibilityTypes::Role role) OVERRIDE; 217 virtual void SetAccessibleRole(ui::AccessibilityTypes::Role role) OVERRIDE;
214 virtual void SetAccessibleState(ui::AccessibilityTypes::State state) OVERRIDE; 218 virtual void SetAccessibleState(ui::AccessibilityTypes::State state) OVERRIDE;
219 virtual void BecomeModal() OVERRIDE;
215 virtual gfx::Rect GetWindowScreenBounds() const OVERRIDE; 220 virtual gfx::Rect GetWindowScreenBounds() const OVERRIDE;
216 virtual gfx::Rect GetClientAreaScreenBounds() const OVERRIDE; 221 virtual gfx::Rect GetClientAreaScreenBounds() const OVERRIDE;
217 virtual gfx::Rect GetRestoredBounds() const OVERRIDE; 222 virtual gfx::Rect GetRestoredBounds() const OVERRIDE;
218 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE; 223 virtual void SetBounds(const gfx::Rect& bounds) OVERRIDE;
219 virtual void SetSize(const gfx::Size& size) OVERRIDE; 224 virtual void SetSize(const gfx::Size& size) OVERRIDE;
220 virtual void SetBoundsConstrained(const gfx::Rect& bounds, 225 virtual void SetBoundsConstrained(const gfx::Rect& bounds,
221 Widget* other_widget) OVERRIDE; 226 Widget* other_widget) OVERRIDE;
222 virtual void MoveAbove(gfx::NativeView native_view) OVERRIDE; 227 virtual void MoveAbove(gfx::NativeView native_view) OVERRIDE;
223 virtual void SetShape(gfx::NativeRegion shape) OVERRIDE; 228 virtual void SetShape(gfx::NativeRegion shape) OVERRIDE;
224 virtual void Close() OVERRIDE; 229 virtual void Close() OVERRIDE;
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 // Resets the window region for the current widget bounds if necessary. 511 // Resets the window region for the current widget bounds if necessary.
507 // If |force| is true, the window region is reset to NULL even for native 512 // If |force| is true, the window region is reset to NULL even for native
508 // frame windows. 513 // frame windows.
509 void ResetWindowRegion(bool force); 514 void ResetWindowRegion(bool force);
510 515
511 // Calls the default WM_NCACTIVATE handler with the specified activation 516 // Calls the default WM_NCACTIVATE handler with the specified activation
512 // value, safely wrapping the call in a ScopedRedrawLock to prevent frame 517 // value, safely wrapping the call in a ScopedRedrawLock to prevent frame
513 // flicker. 518 // flicker.
514 LRESULT CallDefaultNCActivateHandler(BOOL active); 519 LRESULT CallDefaultNCActivateHandler(BOOL active);
515 520
521 // Stops ignoring SetWindowPos() requests (see below).
522 void StopIgnoringPosChanges() { ignore_window_pos_changes_ = false; }
523
524 void RestoreEnabledIfNecessary();
525
516 // Overridden from NativeWidget. 526 // Overridden from NativeWidget.
517 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; 527 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE;
518 528
519 // Overridden from internal::InputMethodDelegate 529 // Overridden from internal::InputMethodDelegate
520 virtual void DispatchKeyEventPostIME(const KeyEvent& key) OVERRIDE; 530 virtual void DispatchKeyEventPostIME(const KeyEvent& key) OVERRIDE;
521 531
522 // A delegate implementation that handles events received here. 532 // A delegate implementation that handles events received here.
523 // See class documentation for Widget in widget.h for a note about ownership. 533 // See class documentation for Widget in widget.h for a note about ownership.
524 internal::NativeWidgetDelegate* delegate_; 534 internal::NativeWidgetDelegate* delegate_;
525 535
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 // The window styles before we modified them for the drag frame appearance. 628 // The window styles before we modified them for the drag frame appearance.
619 DWORD drag_frame_saved_window_style_; 629 DWORD drag_frame_saved_window_style_;
620 DWORD drag_frame_saved_window_ex_style_; 630 DWORD drag_frame_saved_window_ex_style_;
621 631
622 // True if updates to this window are currently locked. 632 // True if updates to this window are currently locked.
623 bool lock_updates_; 633 bool lock_updates_;
624 634
625 // The window styles of the window before updates were locked. 635 // The window styles of the window before updates were locked.
626 DWORD saved_window_style_; 636 DWORD saved_window_style_;
627 637
638 // When true, this flag makes us discard incoming SetWindowPos() requests that
639 // only change our position/size. (We still allow changes to Z-order,
640 // activation, etc.)
641 bool ignore_window_pos_changes_;
642
643 // The following factory is used to ignore SetWindowPos() calls for short time
644 // periods.
645 ScopedRunnableMethodFactory<NativeWidgetWin> ignore_pos_changes_factory_;
646
647 // The last-seen monitor containing us, and its rect and work area. These are
648 // used to catch updates to the rect and work area and react accordingly.
649 HMONITOR last_monitor_;
650 gfx::Rect last_monitor_rect_, last_work_area_;
651
652 // Set to true when the user presses the right mouse button on the caption
653 // area. We need this so we can correctly show the context menu on mouse-up.
654 bool is_right_mouse_pressed_on_caption_;
655
656 // Whether all ancestors have been enabled. This is only used if is_modal_ is
657 // true.
658 bool restored_enabled_;
659
628 DISALLOW_COPY_AND_ASSIGN(NativeWidgetWin); 660 DISALLOW_COPY_AND_ASSIGN(NativeWidgetWin);
629 }; 661 };
630 662
631 } // namespace views 663 } // namespace views
632 664
633 #endif // VIEWS_WIDGET_NATIVE_WIDGET_WIN_H_ 665 #endif // VIEWS_WIDGET_NATIVE_WIDGET_WIN_H_
OLDNEW
« no previous file with comments | « views/widget/native_widget_views.cc ('k') | views/widget/native_widget_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698