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

Side by Side Diff: content/shell/shell_browser_context.h

Issue 10535026: Move creation and ownership of DownloadManager from the embedder to content. This matches all the o… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix cros compile Created 8 years, 6 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_SHELL_SHELL_BROWSER_CONTEXT_H_ 5 #ifndef CONTENT_SHELL_SHELL_BROWSER_CONTEXT_H_
6 #define CONTENT_SHELL_SHELL_BROWSER_CONTEXT_H_ 6 #define CONTENT_SHELL_SHELL_BROWSER_CONTEXT_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
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 "content/public/browser/browser_context.h" 13 #include "content/public/browser/browser_context.h"
14 14
15 class DownloadManager;
16
17 namespace content { 15 namespace content {
18 16
19 class DownloadManagerDelegate; 17 class DownloadManagerDelegate;
20 class ResourceContext; 18 class ResourceContext;
21 class ShellBrowserMainParts; 19 class ShellBrowserMainParts;
22 class ShellDownloadManagerDelegate; 20 class ShellDownloadManagerDelegate;
23 21
24 class ShellBrowserContext : public BrowserContext { 22 class ShellBrowserContext : public BrowserContext {
25 public: 23 public:
26 ShellBrowserContext(); 24 ShellBrowserContext();
27 virtual ~ShellBrowserContext(); 25 virtual ~ShellBrowserContext();
28 26
29 // BrowserContext implementation. 27 // BrowserContext implementation.
30 virtual FilePath GetPath() OVERRIDE; 28 virtual FilePath GetPath() OVERRIDE;
31 virtual bool IsOffTheRecord() const OVERRIDE; 29 virtual bool IsOffTheRecord() const OVERRIDE;
32 virtual DownloadManager* GetDownloadManager() OVERRIDE; 30 virtual DownloadManagerDelegate* GetDownloadManagerDelegate() OVERRIDE;
33 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; 31 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE;
34 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( 32 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess(
35 int renderer_child_id) OVERRIDE; 33 int renderer_child_id) OVERRIDE;
36 virtual net::URLRequestContextGetter* GetRequestContextForMedia() OVERRIDE; 34 virtual net::URLRequestContextGetter* GetRequestContextForMedia() OVERRIDE;
37 virtual ResourceContext* GetResourceContext() OVERRIDE; 35 virtual ResourceContext* GetResourceContext() OVERRIDE;
38 virtual GeolocationPermissionContext* 36 virtual GeolocationPermissionContext*
39 GetGeolocationPermissionContext() OVERRIDE; 37 GetGeolocationPermissionContext() OVERRIDE;
40 virtual SpeechRecognitionPreferences* 38 virtual SpeechRecognitionPreferences*
41 GetSpeechRecognitionPreferences() OVERRIDE; 39 GetSpeechRecognitionPreferences() OVERRIDE;
42 virtual bool DidLastSessionExitCleanly() OVERRIDE; 40 virtual bool DidLastSessionExitCleanly() OVERRIDE;
43 virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; 41 virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE;
44 42
45 private: 43 private:
46 // Performs initialization of the ShellBrowserContext while IO is still 44 // Performs initialization of the ShellBrowserContext while IO is still
47 // allowed on the current thread. 45 // allowed on the current thread.
48 void InitWhileIOAllowed(); 46 void InitWhileIOAllowed();
49 47
50 FilePath path_; 48 FilePath path_;
51 scoped_ptr<ResourceContext> resource_context_; 49 scoped_ptr<ResourceContext> resource_context_;
52 scoped_refptr<ShellDownloadManagerDelegate> download_manager_delegate_; 50 scoped_refptr<ShellDownloadManagerDelegate> download_manager_delegate_;
53 scoped_refptr<DownloadManager> download_manager_;
54 scoped_refptr<net::URLRequestContextGetter> url_request_getter_; 51 scoped_refptr<net::URLRequestContextGetter> url_request_getter_;
55 scoped_refptr<GeolocationPermissionContext> geolocation_permission_context_; 52 scoped_refptr<GeolocationPermissionContext> geolocation_permission_context_;
56 scoped_refptr<SpeechRecognitionPreferences> speech_recognition_preferences_; 53 scoped_refptr<SpeechRecognitionPreferences> speech_recognition_preferences_;
57 54
58 DISALLOW_COPY_AND_ASSIGN(ShellBrowserContext); 55 DISALLOW_COPY_AND_ASSIGN(ShellBrowserContext);
59 }; 56 };
60 57
61 } // namespace content 58 } // namespace content
62 59
63 #endif // CONTENT_SHELL_SHELL_BROWSER_CONTEXT_H_ 60 #endif // CONTENT_SHELL_SHELL_BROWSER_CONTEXT_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698