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

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

Issue 6823055: Consolidate OnKeyEvent and InputMethod code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Reduce the scope of this change. 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_H_ 5 #ifndef VIEWS_WIDGET_WIDGET_H_
6 #define VIEWS_WIDGET_WIDGET_H_ 6 #define VIEWS_WIDGET_WIDGET_H_
7 #pragma once 7 #pragma once
8 8
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "ui/base/accessibility/accessibility_types.h" 13 #include "ui/base/accessibility/accessibility_types.h"
14 #include "ui/gfx/native_widget_types.h" 14 #include "ui/gfx/native_widget_types.h"
15 #include "views/focus/focus_manager.h" 15 #include "views/focus/focus_manager.h"
16 #include "views/ime/input_method_delegate.h"
16 #include "views/widget/native_widget_delegate.h" 17 #include "views/widget/native_widget_delegate.h"
17 18
18 namespace gfx { 19 namespace gfx {
19 class Canvas; 20 class Canvas;
20 class Path; 21 class Path;
21 class Point; 22 class Point;
22 class Rect; 23 class Rect;
23 } 24 }
24 25
25 namespace ui { 26 namespace ui {
(...skipping 26 matching lines...) Expand all
52 // context specific NativeWidget implementation. 53 // context specific NativeWidget implementation.
53 // 54 //
54 // TODO(beng): Note that this class being non-abstract means that we have a 55 // TODO(beng): Note that this class being non-abstract means that we have a
55 // violation of Google style in that we are using multiple 56 // violation of Google style in that we are using multiple
56 // inheritance. The intention is to split this into a separate 57 // inheritance. The intention is to split this into a separate
57 // object associated with but not equal to a NativeWidget 58 // object associated with but not equal to a NativeWidget
58 // implementation. Multiple inheritance is required for this 59 // implementation. Multiple inheritance is required for this
59 // transitional step. 60 // transitional step.
60 // 61 //
61 class Widget : public internal::NativeWidgetDelegate, 62 class Widget : public internal::NativeWidgetDelegate,
62 public FocusTraversable { 63 public FocusTraversable,
64 public internal::InputMethodDelegate {
63 public: 65 public:
64 struct CreateParams { 66 struct CreateParams {
65 enum Type { 67 enum Type {
66 TYPE_WINDOW, // A Window, like a frame window. 68 TYPE_WINDOW, // A Window, like a frame window.
67 TYPE_CONTROL, // A control, like a button. 69 TYPE_CONTROL, // A control, like a button.
68 TYPE_POPUP, // An undecorated Window, with transient properties. 70 TYPE_POPUP, // An undecorated Window, with transient properties.
69 TYPE_MENU // An undecorated Window, with transient properties 71 TYPE_MENU // An undecorated Window, with transient properties
70 // specialized to menus. 72 // specialized to menus.
71 }; 73 };
72 74
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 // Debugging code to help track 77651. 293 // Debugging code to help track 77651.
292 bool got_native_widget_created() const { return got_native_widget_created_; } 294 bool got_native_widget_created() const { return got_native_widget_created_; }
293 295
294 // Overridden from NativeWidgetDelegate: 296 // Overridden from NativeWidgetDelegate:
295 virtual void OnNativeFocus(gfx::NativeView focused_view) OVERRIDE; 297 virtual void OnNativeFocus(gfx::NativeView focused_view) OVERRIDE;
296 virtual void OnNativeBlur(gfx::NativeView focused_view) OVERRIDE; 298 virtual void OnNativeBlur(gfx::NativeView focused_view) OVERRIDE;
297 virtual void OnNativeWidgetCreated() OVERRIDE; 299 virtual void OnNativeWidgetCreated() OVERRIDE;
298 virtual void OnSizeChanged(const gfx::Size& new_size) OVERRIDE; 300 virtual void OnSizeChanged(const gfx::Size& new_size) OVERRIDE;
299 virtual bool HasFocusManager() const OVERRIDE; 301 virtual bool HasFocusManager() const OVERRIDE;
300 virtual void OnNativeWidgetPaint(gfx::Canvas* canvas) OVERRIDE; 302 virtual void OnNativeWidgetPaint(gfx::Canvas* canvas) OVERRIDE;
303 virtual void OnKeyEvent(const KeyEvent& event) OVERRIDE;
301 virtual bool OnMouseEvent(const MouseEvent& event) OVERRIDE; 304 virtual bool OnMouseEvent(const MouseEvent& event) OVERRIDE;
302 virtual void OnMouseCaptureLost() OVERRIDE; 305 virtual void OnMouseCaptureLost() OVERRIDE;
303 306
304 // Overridden from FocusTraversable: 307 // Overridden from FocusTraversable:
305 virtual FocusSearch* GetFocusSearch() OVERRIDE; 308 virtual FocusSearch* GetFocusSearch() OVERRIDE;
306 virtual FocusTraversable* GetFocusTraversableParent() OVERRIDE; 309 virtual FocusTraversable* GetFocusTraversableParent() OVERRIDE;
307 virtual View* GetFocusTraversableParentView() OVERRIDE; 310 virtual View* GetFocusTraversableParentView() OVERRIDE;
308 311
312 // Overridden from internal::InputMethodDelegate:
313 virtual bool DispatchKeyEventPostIME(const KeyEvent& key) OVERRIDE;
314
309 protected: 315 protected:
310 // Creates the RootView to be used within this Widget. Subclasses may override 316 // Creates the RootView to be used within this Widget. Subclasses may override
311 // to create custom RootViews that do specialized event processing. 317 // to create custom RootViews that do specialized event processing.
312 // TODO(beng): Investigate whether or not this is needed. 318 // TODO(beng): Investigate whether or not this is needed.
313 virtual RootView* CreateRootView(); 319 virtual RootView* CreateRootView();
314 320
315 // Provided to allow the WidgetWin/Gtk implementations to destroy the RootView 321 // Provided to allow the WidgetWin/Gtk implementations to destroy the RootView
316 // _before_ the focus manager/tooltip manager. 322 // _before_ the focus manager/tooltip manager.
317 // TODO(beng): remove once we fold those objects onto this one. 323 // TODO(beng): remove once we fold those objects onto this one.
318 void DestroyRootView(); 324 void DestroyRootView();
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 384
379 // Debugging code to help track 77651. 385 // Debugging code to help track 77651.
380 bool got_native_widget_created_; 386 bool got_native_widget_created_;
381 387
382 DISALLOW_COPY_AND_ASSIGN(Widget); 388 DISALLOW_COPY_AND_ASSIGN(Widget);
383 }; 389 };
384 390
385 } // namespace views 391 } // namespace views
386 392
387 #endif // VIEWS_WIDGET_WIDGET_H_ 393 #endif // VIEWS_WIDGET_WIDGET_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698