| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_VIEWS_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_VIEWS_H_ |
| 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_VIEWS_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_VIEWS_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/scoped_ptr.h" | 13 #include "base/scoped_ptr.h" |
| 14 #include "base/time.h" | 14 #include "base/time.h" |
| 15 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 15 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
| 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
| 17 #include "ui/gfx/native_widget_types.h" | 17 #include "ui/gfx/native_widget_types.h" |
| 18 #include "views/controls/native/native_view_host.h" | 18 #include "views/controls/native/native_view_host.h" |
| 19 #include "views/events/event.h" | 19 #include "views/events/event.h" |
| 20 #include "views/view.h" | 20 #include "views/view.h" |
| 21 #include "webkit/glue/webcursor.h" | 21 #include "webkit/glue/webcursor.h" |
| 22 | 22 |
| 23 class IMEContextHandler; |
| 23 class RenderWidgetHost; | 24 class RenderWidgetHost; |
| 24 struct NativeWebKeyboardEvent; | 25 struct NativeWebKeyboardEvent; |
| 25 | 26 |
| 26 // ----------------------------------------------------------------------------- | 27 // ----------------------------------------------------------------------------- |
| 27 // See comments in render_widget_host_view.h about this class and its members. | 28 // See comments in render_widget_host_view.h about this class and its members. |
| 28 // ----------------------------------------------------------------------------- | 29 // ----------------------------------------------------------------------------- |
| 29 class RenderWidgetHostViewViews : public RenderWidgetHostView, | 30 class RenderWidgetHostViewViews : public RenderWidgetHostView, |
| 30 public views::View { | 31 public views::View { |
| 31 public: | 32 public: |
| 32 // Internal class name. | 33 // Internal class name. |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 virtual void OnMouseExited(const views::MouseEvent& event); | 101 virtual void OnMouseExited(const views::MouseEvent& event); |
| 101 virtual bool OnMouseWheel(const views::MouseWheelEvent& e); | 102 virtual bool OnMouseWheel(const views::MouseWheelEvent& e); |
| 102 | 103 |
| 103 // Views keyboard events, overridden from views::View. | 104 // Views keyboard events, overridden from views::View. |
| 104 virtual bool OnKeyPressed(const views::KeyEvent &e); | 105 virtual bool OnKeyPressed(const views::KeyEvent &e); |
| 105 virtual bool OnKeyReleased(const views::KeyEvent &e); | 106 virtual bool OnKeyReleased(const views::KeyEvent &e); |
| 106 | 107 |
| 107 virtual void DidGainFocus(); | 108 virtual void DidGainFocus(); |
| 108 virtual void WillLoseFocus(); | 109 virtual void WillLoseFocus(); |
| 109 | 110 |
| 111 // Forwards a web keyboard event to renderer. |
| 112 void ForwardWebKeyboardEvent(const NativeWebKeyboardEvent& event); |
| 113 |
| 110 // Forwards a keyboard event to renderer. | 114 // Forwards a keyboard event to renderer. |
| 111 void ForwardKeyboardEvent(const NativeWebKeyboardEvent& event); | 115 void ForwardKeyEvent(const views::KeyEvent& event); |
| 112 | 116 |
| 113 // Views touch events, overridden from views::View. | 117 // Views touch events, overridden from views::View. |
| 114 virtual View::TouchStatus OnTouchEvent(const views::TouchEvent& e); | 118 virtual View::TouchStatus OnTouchEvent(const views::TouchEvent& e); |
| 115 | 119 |
| 116 private: | 120 private: |
| 117 friend class RenderWidgetHostViewViewsWidget; | 121 friend class RenderWidgetHostViewViewsWidget; |
| 118 | 122 |
| 119 // Returns whether the widget needs an input grab to work | 123 // Returns whether the widget needs an input grab to work |
| 120 // properly. | 124 // properly. |
| 121 bool NeedsInputGrab(); | 125 bool NeedsInputGrab(); |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 bool visually_deemphasized_; | 173 bool visually_deemphasized_; |
| 170 | 174 |
| 171 // The size that we want the renderer to be. | 175 // The size that we want the renderer to be. |
| 172 gfx::Size requested_size_; | 176 gfx::Size requested_size_; |
| 173 | 177 |
| 174 // The touch-event. Its touch-points are updated as necessary. A new | 178 // The touch-event. Its touch-points are updated as necessary. A new |
| 175 // touch-point is added from an ET_TOUCH_PRESSED event, and a touch-point is | 179 // touch-point is added from an ET_TOUCH_PRESSED event, and a touch-point is |
| 176 // removed from the list on an ET_TOUCH_RELEASED event. | 180 // removed from the list on an ET_TOUCH_RELEASED event. |
| 177 WebKit::WebTouchEvent touch_event_; | 181 WebKit::WebTouchEvent touch_event_; |
| 178 | 182 |
| 183 // Input method context used to translating sequence of key events into other |
| 184 // languages. |
| 185 scoped_ptr<IMEContextHandler> ime_context_; |
| 186 |
| 179 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewViews); | 187 DISALLOW_COPY_AND_ASSIGN(RenderWidgetHostViewViews); |
| 180 }; | 188 }; |
| 181 | 189 |
| 182 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_VIEWS_H_ | 190 #endif // CHROME_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_VIEWS_H_ |
| OLD | NEW |