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

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

Issue 6823055: Consolidate OnKeyEvent and InputMethod code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Refactor X2Event handling, nix Windows InputMethodDelegate, etc. Created 9 years, 8 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
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_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 #pragma once 7 #pragma once
8 8
9 #include <atlbase.h> 9 #include <atlbase.h>
10 #include <atlapp.h> 10 #include <atlapp.h>
11 #include <atlcrack.h> 11 #include <atlcrack.h>
12 #include <atlmisc.h> 12 #include <atlmisc.h>
13 13
14 #include <string> 14 #include <string>
15 #include <vector> 15 #include <vector>
16 16
17 #include "base/memory/scoped_ptr.h" 17 #include "base/memory/scoped_ptr.h"
18 #include "base/memory/scoped_vector.h" 18 #include "base/memory/scoped_vector.h"
19 #include "base/message_loop.h" 19 #include "base/message_loop.h"
20 #include "base/win/scoped_comptr.h" 20 #include "base/win/scoped_comptr.h"
21 #include "ui/base/win/window_impl.h" 21 #include "ui/base/win/window_impl.h"
22 #include "views/focus/focus_manager.h" 22 #include "views/focus/focus_manager.h"
23 #include "views/ime/input_method_delegate.h"
24 #include "views/layout/layout_manager.h" 23 #include "views/layout/layout_manager.h"
25 #include "views/widget/native_widget.h" 24 #include "views/widget/native_widget.h"
26 #include "views/widget/widget.h" 25 #include "views/widget/widget.h"
27 26
28 namespace ui { 27 namespace ui {
29 class ViewProp; 28 class ViewProp;
30 } 29 }
31 30
32 namespace gfx { 31 namespace gfx {
33 class CanvasSkia; 32 class CanvasSkia;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 // 74 //
76 // This Widget contains a RootView which owns the hierarchy of views within it. 75 // This Widget contains a RootView which owns the hierarchy of views within it.
77 // As long as views are part of this tree, they will be deleted automatically 76 // As long as views are part of this tree, they will be deleted automatically
78 // when the RootView is destroyed. If you remove a view from the tree, you are 77 // when the RootView is destroyed. If you remove a view from the tree, you are
79 // then responsible for cleaning up after it. 78 // then responsible for cleaning up after it.
80 // 79 //
81 /////////////////////////////////////////////////////////////////////////////// 80 ///////////////////////////////////////////////////////////////////////////////
82 class WidgetWin : public ui::WindowImpl, 81 class WidgetWin : public ui::WindowImpl,
83 public Widget, 82 public Widget,
84 public NativeWidget, 83 public NativeWidget,
85 public MessageLoopForUI::Observer, 84 public MessageLoopForUI::Observer {
86 public internal::InputMethodDelegate {
87 public: 85 public:
88 WidgetWin(); 86 WidgetWin();
89 virtual ~WidgetWin(); 87 virtual ~WidgetWin();
90 88
91 // Returns the Widget associated with the specified HWND (if any). 89 // Returns the Widget associated with the specified HWND (if any).
92 static WidgetWin* GetWidget(HWND hwnd); 90 static WidgetWin* GetWidget(HWND hwnd);
93 91
94 // Returns true if we are on Windows Vista or greater and composition is 92 // Returns true if we are on Windows Vista or greater and composition is
95 // enabled. 93 // enabled.
96 static bool IsAeroGlassEnabled(); 94 static bool IsAeroGlassEnabled();
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 // Are a subclass of WindowWin? 412 // Are a subclass of WindowWin?
415 bool is_window_; 413 bool is_window_;
416 414
417 private: 415 private:
418 typedef ScopedVector<ui::ViewProp> ViewProps; 416 typedef ScopedVector<ui::ViewProp> ViewProps;
419 417
420 // Implementation of GetWindow. Ascends the parents of |hwnd| returning the 418 // Implementation of GetWindow. Ascends the parents of |hwnd| returning the
421 // first ancestor that is a Window. 419 // first ancestor that is a Window.
422 static Window* GetWindowImpl(HWND hwnd); 420 static Window* GetWindowImpl(HWND hwnd);
423 421
424 // Returns the RootView that contains the focused view, or NULL if there is no
425 // focused view.
426 RootView* GetFocusedViewRootView();
427
428 // Called after the WM_ACTIVATE message has been processed by the default 422 // Called after the WM_ACTIVATE message has been processed by the default
429 // windows procedure. 423 // windows procedure.
430 static void PostProcessActivateMessage(WidgetWin* widget, 424 static void PostProcessActivateMessage(WidgetWin* widget,
431 int activation_state); 425 int activation_state);
432 426
433 // Synchronously paints the invalid contents of the Widget. 427 // Synchronously paints the invalid contents of the Widget.
434 void RedrawInvalidRect(); 428 void RedrawInvalidRect();
435 429
436 // Synchronously updates the invalid contents of the Widget. Valid for 430 // Synchronously updates the invalid contents of the Widget. Valid for
437 // layered windows only. 431 // layered windows only.
438 void RedrawLayeredWindowContents(); 432 void RedrawLayeredWindowContents();
439 433
440 // Responds to the client area changing size, either at window creation time 434 // Responds to the client area changing size, either at window creation time
441 // or subsequently. 435 // or subsequently.
442 void ClientAreaSizeChanged(); 436 void ClientAreaSizeChanged();
443 437
444 // Overridden from NativeWidget. 438 // Overridden from NativeWidget.
445 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; 439 virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE;
446 440
447 // Overridden from internal::InputMethodDelegate
448 virtual void DispatchKeyEventPostIME(const KeyEvent& key) OVERRIDE;
449
450 // A delegate implementation that handles events received here. 441 // A delegate implementation that handles events received here.
451 internal::NativeWidgetDelegate* delegate_; 442 internal::NativeWidgetDelegate* delegate_;
452 443
453 // The following factory is used for calls to close the WidgetWin 444 // The following factory is used for calls to close the WidgetWin
454 // instance. 445 // instance.
455 ScopedRunnableMethodFactory<WidgetWin> close_widget_factory_; 446 ScopedRunnableMethodFactory<WidgetWin> close_widget_factory_;
456 447
457 // The flags currently being used with TrackMouseEvent to track mouse 448 // The flags currently being used with TrackMouseEvent to track mouse
458 // messages. 0 if there is no active tracking. The value of this member is 449 // messages. 0 if there is no active tracking. The value of this member is
459 // used when tracking is canceled. 450 // used when tracking is canceled.
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
525 516
526 // Indicates if the |input_method_| is an InputMethodWin instance. 517 // Indicates if the |input_method_| is an InputMethodWin instance.
527 bool is_input_method_win_; 518 bool is_input_method_win_;
528 519
529 DISALLOW_COPY_AND_ASSIGN(WidgetWin); 520 DISALLOW_COPY_AND_ASSIGN(WidgetWin);
530 }; 521 };
531 522
532 } // namespace views 523 } // namespace views
533 524
534 #endif // VIEWS_WIDGET_WIDGET_WIN_H_ 525 #endif // VIEWS_WIDGET_WIDGET_WIN_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698