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

Side by Side Diff: content/public/test/web_contents_tester.cc

Issue 12334073: Remove WebContents methods that duplicate WebContentsView methods. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 9 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 | « content/public/test/web_contents_tester.h ('k') | content/shell/shell.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 #include "content/public/test/web_contents_tester.h" 5 #include "content/public/test/web_contents_tester.h"
6 6
7 #include "content/test/test_web_contents.h" 7 #include "content/test/test_web_contents.h"
8 8
9 namespace content { 9 namespace content {
10 10
11 namespace { 11 namespace {
12 12
13 // The two subclasses here are instantiated via the deprecated 13 // The two subclasses here are instantiated via the deprecated
14 // CreateWebContentsFor... factories below. 14 // CreateWebContentsFor... factories below.
15 15
16 class TestWebContentsCountFocus : public TestWebContents {
17 public:
18 explicit TestWebContentsCountFocus(BrowserContext* browser_context)
19 : TestWebContents(browser_context), focus_called_(0) {
20 }
21
22 virtual int GetNumberOfFocusCalls() OVERRIDE {
23 return focus_called_;
24 }
25
26 virtual void Focus() OVERRIDE {
27 focus_called_++;
28 }
29
30 private:
31 int focus_called_;
32 };
33
34 class TestWebContentsCountSetFocusToLocationBar : public TestWebContents { 16 class TestWebContentsCountSetFocusToLocationBar : public TestWebContents {
35 public: 17 public:
36 explicit TestWebContentsCountSetFocusToLocationBar( 18 explicit TestWebContentsCountSetFocusToLocationBar(
37 BrowserContext* browser_context) 19 BrowserContext* browser_context)
38 : TestWebContents(browser_context), focus_called_(0) { 20 : TestWebContents(browser_context), focus_called_(0) {
39 } 21 }
40 22
41 virtual void SetFocusToLocationBar(bool select_all) OVERRIDE { 23 virtual void SetFocusToLocationBar(bool select_all) OVERRIDE {
42 ++focus_called_; 24 ++focus_called_;
43 } 25 }
(...skipping 22 matching lines...) Expand all
66 // static 48 // static
67 WebContents* WebContentsTester::CreateTestWebContentsCountSetFocusToLocationBar( 49 WebContents* WebContentsTester::CreateTestWebContentsCountSetFocusToLocationBar(
68 BrowserContext* browser_context, 50 BrowserContext* browser_context,
69 SiteInstance* instance) { 51 SiteInstance* instance) {
70 TestWebContentsCountSetFocusToLocationBar* web_contents = 52 TestWebContentsCountSetFocusToLocationBar* web_contents =
71 new TestWebContentsCountSetFocusToLocationBar(browser_context); 53 new TestWebContentsCountSetFocusToLocationBar(browser_context);
72 web_contents->Init(WebContents::CreateParams(browser_context, instance)); 54 web_contents->Init(WebContents::CreateParams(browser_context, instance));
73 return web_contents; 55 return web_contents;
74 } 56 }
75 57
76 // static
77 WebContents* WebContentsTester::CreateTestWebContentsCountFocus(
78 BrowserContext* browser_context,
79 SiteInstance* instance) {
80 TestWebContentsCountFocus* web_contents =
81 new TestWebContentsCountFocus(browser_context);
82 web_contents->Init(WebContents::CreateParams(browser_context, instance));
83 return web_contents;
84 }
85
86 } // namespace content 58 } // namespace content
OLDNEW
« no previous file with comments | « content/public/test/web_contents_tester.h ('k') | content/shell/shell.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698