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

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

Issue 9982011: Mac content shell: Fix new browser window. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 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_application_mac.mm ('k') | content/shell/shell_browser_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_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 "base/memory/singleton.h"
14 #include "content/public/browser/browser_context.h" 13 #include "content/public/browser/browser_context.h"
15 14
16 class DownloadManager; 15 class DownloadManager;
17 16
18 namespace content { 17 namespace content {
19 18
20 class DownloadManagerDelegate; 19 class DownloadManagerDelegate;
21 class ResourceContext; 20 class ResourceContext;
21 class ShellBrowserMainParts;
22 class ShellDownloadManagerDelegate; 22 class ShellDownloadManagerDelegate;
23 23
24 class ShellBrowserContext : public BrowserContext { 24 class ShellBrowserContext : public BrowserContext {
25 public: 25 public:
26 static ShellBrowserContext* GetInstance(); 26 explicit ShellBrowserContext(ShellBrowserMainParts* shell_main_parts);
27 virtual ~ShellBrowserContext();
27 28
28 // BrowserContext implementation. 29 // BrowserContext implementation.
29 virtual FilePath GetPath() OVERRIDE; 30 virtual FilePath GetPath() OVERRIDE;
30 virtual bool IsOffTheRecord() const OVERRIDE; 31 virtual bool IsOffTheRecord() const OVERRIDE;
31 virtual DownloadManager* GetDownloadManager() OVERRIDE; 32 virtual DownloadManager* GetDownloadManager() OVERRIDE;
32 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; 33 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE;
33 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( 34 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess(
34 int renderer_child_id) OVERRIDE; 35 int renderer_child_id) OVERRIDE;
35 virtual net::URLRequestContextGetter* GetRequestContextForMedia() OVERRIDE; 36 virtual net::URLRequestContextGetter* GetRequestContextForMedia() OVERRIDE;
36 virtual ResourceContext* GetResourceContext() OVERRIDE; 37 virtual ResourceContext* GetResourceContext() OVERRIDE;
37 virtual GeolocationPermissionContext* 38 virtual GeolocationPermissionContext*
38 GetGeolocationPermissionContext() OVERRIDE; 39 GetGeolocationPermissionContext() OVERRIDE;
39 virtual SpeechRecognitionPreferences* 40 virtual SpeechRecognitionPreferences*
40 GetSpeechRecognitionPreferences() OVERRIDE; 41 GetSpeechRecognitionPreferences() OVERRIDE;
41 virtual bool DidLastSessionExitCleanly() OVERRIDE; 42 virtual bool DidLastSessionExitCleanly() OVERRIDE;
42 virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; 43 virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE;
43 44
44 private: 45 private:
45 ShellBrowserContext();
46 virtual ~ShellBrowserContext();
47 friend struct DefaultSingletonTraits<ShellBrowserContext>;
48
49 // Performs initialization of the ShellBrowserContext while IO is still 46 // Performs initialization of the ShellBrowserContext while IO is still
50 // allowed on the current thread. 47 // allowed on the current thread.
51 void InitWhileIOAllowed(); 48 void InitWhileIOAllowed();
52 49
53 FilePath path_; 50 FilePath path_;
54 scoped_ptr<ResourceContext> resource_context_; 51 scoped_ptr<ResourceContext> resource_context_;
55 scoped_refptr<ShellDownloadManagerDelegate> download_manager_delegate_; 52 scoped_refptr<ShellDownloadManagerDelegate> download_manager_delegate_;
56 scoped_refptr<DownloadManager> download_manager_; 53 scoped_refptr<DownloadManager> download_manager_;
57 scoped_refptr<net::URLRequestContextGetter> url_request_getter_; 54 scoped_refptr<net::URLRequestContextGetter> url_request_getter_;
58 scoped_refptr<GeolocationPermissionContext> geolocation_permission_context_; 55 scoped_refptr<GeolocationPermissionContext> geolocation_permission_context_;
59 scoped_refptr<SpeechRecognitionPreferences> speech_recognition_preferences_; 56 scoped_refptr<SpeechRecognitionPreferences> speech_recognition_preferences_;
60 57
58 ShellBrowserMainParts* shell_main_parts_;
59
61 DISALLOW_COPY_AND_ASSIGN(ShellBrowserContext); 60 DISALLOW_COPY_AND_ASSIGN(ShellBrowserContext);
62 }; 61 };
63 62
64 } // namespace content 63 } // namespace content
65 64
66 #endif // CONTENT_SHELL_SHELL_BROWSER_CONTEXT_H_ 65 #endif // CONTENT_SHELL_SHELL_BROWSER_CONTEXT_H_
OLDNEW
« no previous file with comments | « content/shell/shell_application_mac.mm ('k') | content/shell/shell_browser_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698