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

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

Issue 9965064: Mac content shell: File > New makes a 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"
13 #include "content/public/browser/browser_context.h" 14 #include "content/public/browser/browser_context.h"
14 15
15 class DownloadManager; 16 class DownloadManager;
16 17
17 namespace content { 18 namespace content {
18 19
19 class DownloadManagerDelegate; 20 class DownloadManagerDelegate;
20 class ResourceContext; 21 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 explicit ShellBrowserContext(ShellBrowserMainParts* shell_main_parts); 26 static ShellBrowserContext* GetInstance();
27 virtual ~ShellBrowserContext();
28 27
29 // BrowserContext implementation. 28 // BrowserContext implementation.
30 virtual FilePath GetPath() OVERRIDE; 29 virtual FilePath GetPath() OVERRIDE;
31 virtual bool IsOffTheRecord() const OVERRIDE; 30 virtual bool IsOffTheRecord() const OVERRIDE;
32 virtual DownloadManager* GetDownloadManager() OVERRIDE; 31 virtual DownloadManager* GetDownloadManager() OVERRIDE;
33 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE; 32 virtual net::URLRequestContextGetter* GetRequestContext() OVERRIDE;
34 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess( 33 virtual net::URLRequestContextGetter* GetRequestContextForRenderProcess(
35 int renderer_child_id) OVERRIDE; 34 int renderer_child_id) OVERRIDE;
36 virtual net::URLRequestContextGetter* GetRequestContextForMedia() OVERRIDE; 35 virtual net::URLRequestContextGetter* GetRequestContextForMedia() OVERRIDE;
37 virtual ResourceContext* GetResourceContext() OVERRIDE; 36 virtual ResourceContext* GetResourceContext() OVERRIDE;
38 virtual GeolocationPermissionContext* 37 virtual GeolocationPermissionContext*
39 GetGeolocationPermissionContext() OVERRIDE; 38 GetGeolocationPermissionContext() OVERRIDE;
40 virtual SpeechRecognitionPreferences* 39 virtual SpeechRecognitionPreferences*
41 GetSpeechRecognitionPreferences() OVERRIDE; 40 GetSpeechRecognitionPreferences() OVERRIDE;
42 virtual bool DidLastSessionExitCleanly() OVERRIDE; 41 virtual bool DidLastSessionExitCleanly() OVERRIDE;
43 virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE; 42 virtual quota::SpecialStoragePolicy* GetSpecialStoragePolicy() OVERRIDE;
44 43
45 private: 44 private:
45 ShellBrowserContext();
46 virtual ~ShellBrowserContext();
47 friend struct DefaultSingletonTraits<ShellBrowserContext>;
48
46 // Performs initialization of the ShellBrowserContext while IO is still 49 // Performs initialization of the ShellBrowserContext while IO is still
47 // allowed on the current thread. 50 // allowed on the current thread.
48 void InitWhileIOAllowed(); 51 void InitWhileIOAllowed();
49 52
50 FilePath path_; 53 FilePath path_;
51 scoped_ptr<ResourceContext> resource_context_; 54 scoped_ptr<ResourceContext> resource_context_;
52 scoped_refptr<ShellDownloadManagerDelegate> download_manager_delegate_; 55 scoped_refptr<ShellDownloadManagerDelegate> download_manager_delegate_;
53 scoped_refptr<DownloadManager> download_manager_; 56 scoped_refptr<DownloadManager> download_manager_;
54 scoped_refptr<net::URLRequestContextGetter> url_request_getter_; 57 scoped_refptr<net::URLRequestContextGetter> url_request_getter_;
55 scoped_refptr<GeolocationPermissionContext> geolocation_permission_context_; 58 scoped_refptr<GeolocationPermissionContext> geolocation_permission_context_;
56 scoped_refptr<SpeechRecognitionPreferences> speech_recognition_preferences_; 59 scoped_refptr<SpeechRecognitionPreferences> speech_recognition_preferences_;
57 60
58 ShellBrowserMainParts* shell_main_parts_;
59
60 DISALLOW_COPY_AND_ASSIGN(ShellBrowserContext); 61 DISALLOW_COPY_AND_ASSIGN(ShellBrowserContext);
61 }; 62 };
62 63
63 } // namespace content 64 } // namespace content
64 65
65 #endif // CONTENT_SHELL_SHELL_BROWSER_CONTEXT_H_ 66 #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