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

Side by Side Diff: content/test/test_render_view_host.h

Issue 173803002: Redesigns the text input focus handling. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed review comments from sky. Created 6 years, 7 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) 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 CONTENT_TEST_TEST_RENDER_VIEW_HOST_H_ 5 #ifndef CONTENT_TEST_TEST_RENDER_VIEW_HOST_H_
6 #define CONTENT_TEST_TEST_RENDER_VIEW_HOST_H_ 6 #define CONTENT_TEST_TEST_RENDER_VIEW_HOST_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/basictypes.h" 11 #include "base/basictypes.h"
12 #include "base/gtest_prod_util.h" 12 #include "base/gtest_prod_util.h"
13 #include "build/build_config.h" 13 #include "build/build_config.h"
14 #include "content/browser/renderer_host/render_view_host_impl.h" 14 #include "content/browser/renderer_host/render_view_host_impl.h"
15 #include "content/browser/renderer_host/render_widget_host_view_base.h" 15 #include "content/browser/renderer_host/render_widget_host_view_base.h"
16 #include "content/public/common/page_transition_types.h" 16 #include "content/public/common/page_transition_types.h"
17 #include "content/public/test/test_renderer_host.h" 17 #include "content/public/test/test_renderer_host.h"
18 #include "content/test/test_render_frame_host.h" 18 #include "content/test/test_render_frame_host.h"
19 #include "ui/base/ime/dummy_text_input_client.h"
19 #include "ui/base/layout.h" 20 #include "ui/base/layout.h"
20 #include "ui/gfx/vector2d_f.h" 21 #include "ui/gfx/vector2d_f.h"
21 22
22 // This file provides a testing framework for mocking out the RenderProcessHost 23 // This file provides a testing framework for mocking out the RenderProcessHost
23 // layer. It allows you to test RenderViewHost, WebContentsImpl, 24 // layer. It allows you to test RenderViewHost, WebContentsImpl,
24 // NavigationController, and other layers above that without running an actual 25 // NavigationController, and other layers above that without running an actual
25 // renderer process. 26 // renderer process.
26 // 27 //
27 // To use, derive your test base class from RenderViewHostImplTestHarness. 28 // To use, derive your test base class from RenderViewHostImplTestHarness.
28 29
(...skipping 26 matching lines...) Expand all
55 virtual ~TestRenderWidgetHostView(); 56 virtual ~TestRenderWidgetHostView();
56 57
57 // RenderWidgetHostView implementation. 58 // RenderWidgetHostView implementation.
58 virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE {} 59 virtual void InitAsChild(gfx::NativeView parent_view) OVERRIDE {}
59 virtual RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE; 60 virtual RenderWidgetHost* GetRenderWidgetHost() const OVERRIDE;
60 virtual void SetSize(const gfx::Size& size) OVERRIDE {} 61 virtual void SetSize(const gfx::Size& size) OVERRIDE {}
61 virtual void SetBounds(const gfx::Rect& rect) OVERRIDE {} 62 virtual void SetBounds(const gfx::Rect& rect) OVERRIDE {}
62 virtual gfx::NativeView GetNativeView() const OVERRIDE; 63 virtual gfx::NativeView GetNativeView() const OVERRIDE;
63 virtual gfx::NativeViewId GetNativeViewId() const OVERRIDE; 64 virtual gfx::NativeViewId GetNativeViewId() const OVERRIDE;
64 virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE; 65 virtual gfx::NativeViewAccessible GetNativeViewAccessible() OVERRIDE;
66 virtual ui::TextInputClient* GetTextInputClient() OVERRIDE;
65 virtual bool HasFocus() const OVERRIDE; 67 virtual bool HasFocus() const OVERRIDE;
66 virtual bool IsSurfaceAvailableForCopy() const OVERRIDE; 68 virtual bool IsSurfaceAvailableForCopy() const OVERRIDE;
67 virtual void Show() OVERRIDE; 69 virtual void Show() OVERRIDE;
68 virtual void Hide() OVERRIDE; 70 virtual void Hide() OVERRIDE;
69 virtual bool IsShowing() OVERRIDE; 71 virtual bool IsShowing() OVERRIDE;
70 virtual gfx::Rect GetViewBounds() const OVERRIDE; 72 virtual gfx::Rect GetViewBounds() const OVERRIDE;
71 #if defined(OS_MACOSX) 73 #if defined(OS_MACOSX)
72 virtual void SetActive(bool active) OVERRIDE; 74 virtual void SetActive(bool active) OVERRIDE;
73 virtual void SetTakesFocusOnlyOnMouseDown(bool flag) OVERRIDE {} 75 virtual void SetTakesFocusOnlyOnMouseDown(bool flag) OVERRIDE {}
74 virtual void SetWindowVisibility(bool visible) OVERRIDE {} 76 virtual void SetWindowVisibility(bool visible) OVERRIDE {}
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 163
162 bool is_showing() const { return is_showing_; } 164 bool is_showing() const { return is_showing_; }
163 bool did_swap_compositor_frame() const { return did_swap_compositor_frame_; } 165 bool did_swap_compositor_frame() const { return did_swap_compositor_frame_; }
164 166
165 protected: 167 protected:
166 RenderWidgetHostImpl* rwh_; 168 RenderWidgetHostImpl* rwh_;
167 169
168 private: 170 private:
169 bool is_showing_; 171 bool is_showing_;
170 bool did_swap_compositor_frame_; 172 bool did_swap_compositor_frame_;
173 ui::DummyTextInputClient text_input_client_;
171 }; 174 };
172 175
173 #if defined(COMPILER_MSVC) 176 #if defined(COMPILER_MSVC)
174 // See comment for same warning on RenderViewHostImpl. 177 // See comment for same warning on RenderViewHostImpl.
175 #pragma warning(push) 178 #pragma warning(push)
176 #pragma warning(disable: 4250) 179 #pragma warning(disable: 4250)
177 #endif 180 #endif
178 181
179 // TestRenderViewHost ---------------------------------------------------------- 182 // TestRenderViewHost ----------------------------------------------------------
180 183
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
374 private: 377 private:
375 typedef scoped_ptr<ui::test::ScopedSetSupportedScaleFactors> 378 typedef scoped_ptr<ui::test::ScopedSetSupportedScaleFactors>
376 ScopedSetSupportedScaleFactors; 379 ScopedSetSupportedScaleFactors;
377 ScopedSetSupportedScaleFactors scoped_set_supported_scale_factors_; 380 ScopedSetSupportedScaleFactors scoped_set_supported_scale_factors_;
378 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImplTestHarness); 381 DISALLOW_COPY_AND_ASSIGN(RenderViewHostImplTestHarness);
379 }; 382 };
380 383
381 } // namespace content 384 } // namespace content
382 385
383 #endif // CONTENT_TEST_TEST_RENDER_VIEW_HOST_H_ 386 #endif // CONTENT_TEST_TEST_RENDER_VIEW_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698