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

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

Issue 9845033: Move the MediaObserver getter from ResourceContext to ContentBrowserClient, since we only need to s… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix dcheck Created 8 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/shell/shell_resource_context.cc ('k') | content/test/mock_resource_context.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 #ifndef CONTENT_TEST_MOCK_RESOURCE_CONTEXT_H_ 5 #ifndef CONTENT_TEST_MOCK_RESOURCE_CONTEXT_H_
6 #define CONTENT_TEST_MOCK_RESOURCE_CONTEXT_H_ 6 #define CONTENT_TEST_MOCK_RESOURCE_CONTEXT_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "content/public/browser/resource_context.h" 12 #include "content/public/browser/resource_context.h"
13 13
14 namespace content { 14 namespace content {
15 15
16 class MockResourceContext : public ResourceContext { 16 class MockResourceContext : public ResourceContext {
17 public: 17 public:
18 MockResourceContext(); 18 MockResourceContext();
19 explicit MockResourceContext(net::URLRequestContext* context); 19 explicit MockResourceContext(net::URLRequestContext* context);
20 virtual ~MockResourceContext(); 20 virtual ~MockResourceContext();
21 21
22 void set_request_context(net::URLRequestContext* context) { 22 void set_request_context(net::URLRequestContext* context) {
23 test_request_context_ = context; 23 test_request_context_ = context;
24 } 24 }
25 25
26 void set_media_observer(MediaObserver* observer) {
27 media_observer_ = observer;
28 }
29
30 // ResourceContext implementation: 26 // ResourceContext implementation:
31 virtual net::HostResolver* GetHostResolver() OVERRIDE; 27 virtual net::HostResolver* GetHostResolver() OVERRIDE;
32 virtual net::URLRequestContext* GetRequestContext() OVERRIDE; 28 virtual net::URLRequestContext* GetRequestContext() OVERRIDE;
33 virtual MediaObserver* GetMediaObserver() OVERRIDE;
34 29
35 private: 30 private:
36 scoped_refptr<net::URLRequestContext> test_request_context_; 31 scoped_refptr<net::URLRequestContext> test_request_context_;
37 MediaObserver* media_observer_;
38 32
39 DISALLOW_COPY_AND_ASSIGN(MockResourceContext); 33 DISALLOW_COPY_AND_ASSIGN(MockResourceContext);
40 }; 34 };
41 35
42 } // namespace content 36 } // namespace content
43 37
44 #endif // CONTENT_TEST_MOCK_RESOURCE_CONTEXT_H_ 38 #endif // CONTENT_TEST_MOCK_RESOURCE_CONTEXT_H_
OLDNEW
« no previous file with comments | « content/shell/shell_resource_context.cc ('k') | content/test/mock_resource_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698