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

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

Issue 9416070: Move creation and ownership of HostZoomMap to content instead of having every embedder do this. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix mac/cros browsertests Created 8 years, 10 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_browser_context.h ('k') | content/shell/shell_resource_context.h » ('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/shell/shell_browser_context.h" 5 #include "content/shell/shell_browser_context.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/environment.h" 8 #include "base/environment.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/path_service.h" 11 #include "base/path_service.h"
12 #include "base/threading/thread.h" 12 #include "base/threading/thread.h"
13 #include "content/browser/download/download_manager_impl.h" 13 #include "content/browser/download/download_manager_impl.h"
14 #include "content/browser/host_zoom_map_impl.h"
15 #include "content/browser/in_process_webkit/webkit_context.h" 14 #include "content/browser/in_process_webkit/webkit_context.h"
16 #include "content/public/browser/browser_thread.h" 15 #include "content/public/browser/browser_thread.h"
17 #include "content/public/browser/geolocation_permission_context.h" 16 #include "content/public/browser/geolocation_permission_context.h"
18 #include "content/public/browser/speech_input_preferences.h" 17 #include "content/public/browser/speech_input_preferences.h"
19 #include "content/shell/shell_browser_main.h" 18 #include "content/shell/shell_browser_main.h"
20 #include "content/shell/shell_download_manager_delegate.h" 19 #include "content/shell/shell_download_manager_delegate.h"
21 #include "content/shell/shell_resource_context.h" 20 #include "content/shell/shell_resource_context.h"
22 #include "content/shell/shell_url_request_context_getter.h" 21 #include "content/shell/shell_url_request_context_getter.h"
23 22
24 #if defined(OS_WIN) 23 #if defined(OS_WIN)
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 } 155 }
157 156
158 ResourceContext* ShellBrowserContext::GetResourceContext() { 157 ResourceContext* ShellBrowserContext::GetResourceContext() {
159 if (!resource_context_.get()) { 158 if (!resource_context_.get()) {
160 resource_context_.reset(new ShellResourceContext( 159 resource_context_.reset(new ShellResourceContext(
161 static_cast<ShellURLRequestContextGetter*>(GetRequestContext()))); 160 static_cast<ShellURLRequestContextGetter*>(GetRequestContext())));
162 } 161 }
163 return resource_context_.get(); 162 return resource_context_.get();
164 } 163 }
165 164
166 HostZoomMap* ShellBrowserContext::GetHostZoomMap() {
167 if (!host_zoom_map_)
168 host_zoom_map_ = HostZoomMap::Create();
169 return host_zoom_map_.get();
170 }
171
172 GeolocationPermissionContext* 165 GeolocationPermissionContext*
173 ShellBrowserContext::GetGeolocationPermissionContext() { 166 ShellBrowserContext::GetGeolocationPermissionContext() {
174 if (!geolocation_permission_context_) { 167 if (!geolocation_permission_context_) {
175 geolocation_permission_context_ = 168 geolocation_permission_context_ =
176 new ShellGeolocationPermissionContext(); 169 new ShellGeolocationPermissionContext();
177 } 170 }
178 return geolocation_permission_context_; 171 return geolocation_permission_context_;
179 } 172 }
180 173
181 SpeechInputPreferences* ShellBrowserContext::GetSpeechInputPreferences() { 174 SpeechInputPreferences* ShellBrowserContext::GetSpeechInputPreferences() {
182 if (!speech_input_preferences_.get()) 175 if (!speech_input_preferences_.get())
183 speech_input_preferences_ = new ShellSpeechInputPreferences(); 176 speech_input_preferences_ = new ShellSpeechInputPreferences();
184 return speech_input_preferences_.get(); 177 return speech_input_preferences_.get();
185 } 178 }
186 179
187 bool ShellBrowserContext::DidLastSessionExitCleanly() { 180 bool ShellBrowserContext::DidLastSessionExitCleanly() {
188 return true; 181 return true;
189 } 182 }
190 183
191 quota::SpecialStoragePolicy* ShellBrowserContext::GetSpecialStoragePolicy() { 184 quota::SpecialStoragePolicy* ShellBrowserContext::GetSpecialStoragePolicy() {
192 return NULL; 185 return NULL;
193 } 186 }
194 187
195 } // namespace content 188 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/shell_browser_context.h ('k') | content/shell/shell_resource_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698