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

Side by Side Diff: ui/views/win/hwnd_message_handler.h

Issue 10892014: Make HWNDMessageHandler subclass WindowImpl. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 3 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 | « ui/views/win/fullscreen_handler.cc ('k') | ui/views/win/hwnd_message_handler.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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 UI_VIEWS_WIN_HWND_MESSAGE_HANDLER_H_ 5 #ifndef UI_VIEWS_WIN_HWND_MESSAGE_HANDLER_H_
6 #define UI_VIEWS_WIN_HWND_MESSAGE_HANDLER_H_ 6 #define UI_VIEWS_WIN_HWND_MESSAGE_HANDLER_H_
7 7
8 #include <atlbase.h> 8 #include <atlbase.h>
9 #include <atlapp.h> 9 #include <atlapp.h>
10 #include <atlmisc.h> 10 #include <atlmisc.h>
11 #include <windows.h> 11 #include <windows.h>
12 12
13 #include <set> 13 #include <set>
14 14
15 #include "base/basictypes.h" 15 #include "base/basictypes.h"
16 #include "base/compiler_specific.h" 16 #include "base/compiler_specific.h"
17 #include "base/memory/scoped_ptr.h" 17 #include "base/memory/scoped_ptr.h"
18 #include "base/memory/weak_ptr.h" 18 #include "base/memory/weak_ptr.h"
19 #include "base/message_loop.h"
19 #include "base/string16.h" 20 #include "base/string16.h"
20 #include "ui/base/accessibility/accessibility_types.h" 21 #include "ui/base/accessibility/accessibility_types.h"
21 #include "ui/base/ui_base_types.h" 22 #include "ui/base/ui_base_types.h"
22 #include "ui/gfx/rect.h" 23 #include "ui/gfx/rect.h"
23 #include "ui/views/ime/input_method_delegate.h" 24 #include "ui/views/ime/input_method_delegate.h"
24 #include "ui/views/views_export.h" 25 #include "ui/views/views_export.h"
25 26
26 namespace gfx { 27 namespace gfx {
27 class Canvas; 28 class Canvas;
28 class ImageSkia; 29 class ImageSkia;
29 class Insets; 30 class Insets;
30 } 31 }
31 32
32 namespace views { 33 namespace views {
33 34
34 class FullscreenHandler; 35 class FullscreenHandler;
35 class HWNDMessageHandlerDelegate; 36 class HWNDMessageHandlerDelegate;
36 class InputMethod; 37 class InputMethod;
37 38
38 VIEWS_EXPORT bool IsAeroGlassEnabled(); 39 VIEWS_EXPORT bool IsAeroGlassEnabled();
39 40
40 // An object that handles messages for a HWND that implements the views 41 // An object that handles messages for a HWND that implements the views
41 // "Custom Frame" look. The purpose of this class is to isolate the windows- 42 // "Custom Frame" look. The purpose of this class is to isolate the windows-
42 // specific message handling from the code that wraps it. It is intended to be 43 // specific message handling from the code that wraps it. It is intended to be
43 // used by both a views::NativeWidget and an aura::RootWindowHost 44 // used by both a views::NativeWidget and an aura::RootWindowHost
44 // implementation. 45 // implementation.
45 // TODO(beng): This object should eventually *become* the WindowImpl. 46 // TODO(beng): This object should eventually *become* the WindowImpl.
46 class VIEWS_EXPORT HWNDMessageHandler : public internal::InputMethodDelegate { 47 class VIEWS_EXPORT HWNDMessageHandler : public internal::InputMethodDelegate,
48 public MessageLoopForUI::Observer {
47 public: 49 public:
48 explicit HWNDMessageHandler(HWNDMessageHandlerDelegate* delegate); 50 explicit HWNDMessageHandler(HWNDMessageHandlerDelegate* delegate);
49 ~HWNDMessageHandler(); 51 ~HWNDMessageHandler();
50 52
51 void Init(const gfx::Rect& bounds); 53 void Init(const gfx::Rect& bounds);
52 void InitModalType(ui::ModalType modal_type); 54 void InitModalType(ui::ModalType modal_type);
53 55
54 void Close(); 56 void Close();
55 void CloseNow(); 57 void CloseNow();
56 58
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 void set_can_update_layered_window(bool can_update_layered_window) { 130 void set_can_update_layered_window(bool can_update_layered_window) {
129 can_update_layered_window_ = can_update_layered_window; 131 can_update_layered_window_ = can_update_layered_window;
130 } 132 }
131 void SchedulePaintInRect(const gfx::Rect& rect); 133 void SchedulePaintInRect(const gfx::Rect& rect);
132 void SetOpacity(BYTE opacity); 134 void SetOpacity(BYTE opacity);
133 135
134 void SetWindowIcons(const gfx::ImageSkia& window_icon, 136 void SetWindowIcons(const gfx::ImageSkia& window_icon,
135 const gfx::ImageSkia& app_icon); 137 const gfx::ImageSkia& app_icon);
136 138
137 // Message Handlers. 139 // Message Handlers.
140 // This list is in _ALPHABETICAL_ order!
138 void OnActivate(UINT action, BOOL minimized, HWND window); 141 void OnActivate(UINT action, BOOL minimized, HWND window);
139 // TODO(beng): Once this object becomes the WindowImpl, these methods can 142 // TODO(beng): Once this object becomes the WindowImpl, these methods can
140 // be made private. 143 // be made private.
141 void OnActivateApp(BOOL active, DWORD thread_id); 144 void OnActivateApp(BOOL active, DWORD thread_id);
142 // TODO(beng): return BOOL is temporary until this object becomes a 145 // TODO(beng): return BOOL is temporary until this object becomes a
143 // WindowImpl. 146 // WindowImpl.
144 BOOL OnAppCommand(HWND window, short command, WORD device, int keystate); 147 BOOL OnAppCommand(HWND window, short command, WORD device, int keystate);
145 void OnCancelMode(); 148 void OnCancelMode();
146 void OnCaptureChanged(HWND window); 149 void OnCaptureChanged(HWND window);
147 void OnClose(); 150 void OnClose();
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
213 // TODO(beng): remove once this is the WindowImpl. 216 // TODO(beng): remove once this is the WindowImpl.
214 friend class NativeWidgetWin; 217 friend class NativeWidgetWin;
215 218
216 // Overridden from internal::InputMethodDelegate: 219 // Overridden from internal::InputMethodDelegate:
217 virtual void DispatchKeyEventPostIME(const ui::KeyEvent& key) OVERRIDE; 220 virtual void DispatchKeyEventPostIME(const ui::KeyEvent& key) OVERRIDE;
218 221
219 // Overridden from WindowImpl: 222 // Overridden from WindowImpl:
220 virtual HICON GetDefaultWindowIcon() const; 223 virtual HICON GetDefaultWindowIcon() const;
221 virtual LRESULT OnWndProc(UINT message, WPARAM w_param, LPARAM l_param); 224 virtual LRESULT OnWndProc(UINT message, WPARAM w_param, LPARAM l_param);
222 225
226 // Overridden from MessageLoopForUI::Observer:
227 virtual base::EventStatus WillProcessEvent(
228 const base::NativeEvent& event) OVERRIDE;
229 virtual void DidProcessEvent(const base::NativeEvent& event) OVERRIDE;
230
223 // Can be called after the delegate has had the opportunity to set focus and 231 // Can be called after the delegate has had the opportunity to set focus and
224 // did not do so. 232 // did not do so.
225 void SetInitialFocus(); 233 void SetInitialFocus();
226 234
227 // Called after the WM_ACTIVATE message has been processed by the default 235 // Called after the WM_ACTIVATE message has been processed by the default
228 // windows procedure. 236 // windows procedure.
229 void PostProcessActivateMessage(int activation_state); 237 void PostProcessActivateMessage(int activation_state);
230 238
231 // Enables disabled owner windows that may have been disabled due to this 239 // Enables disabled owner windows that may have been disabled due to this
232 // window's modality. 240 // window's modality.
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 // True if we are allowed to update the layered window from the DIB backing 383 // True if we are allowed to update the layered window from the DIB backing
376 // store if necessary. 384 // store if necessary.
377 bool can_update_layered_window_; 385 bool can_update_layered_window_;
378 386
379 DISALLOW_COPY_AND_ASSIGN(HWNDMessageHandler); 387 DISALLOW_COPY_AND_ASSIGN(HWNDMessageHandler);
380 }; 388 };
381 389
382 } // namespace views 390 } // namespace views
383 391
384 #endif // UI_VIEWS_WIN_HWND_MESSAGE_HANDLER_H_ 392 #endif // UI_VIEWS_WIN_HWND_MESSAGE_HANDLER_H_
OLDNEW
« no previous file with comments | « ui/views/win/fullscreen_handler.cc ('k') | ui/views/win/hwnd_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698