OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/appcache/chrome_appcache_service.h" | 5 #include "chrome/browser/appcache/chrome_appcache_service.h" |
6 | 6 |
7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "chrome/browser/browser_list.h" | 9 #include "chrome/browser/browser_list.h" |
10 #include "chrome/browser/cookie_prompt_modal_dialog_delegate.h" | 10 #include "chrome/browser/cookie_prompt_modal_dialog_delegate.h" |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 // static | 75 // static |
76 void ChromeAppCacheService::ClearLocalState(const FilePath& profile_path) { | 76 void ChromeAppCacheService::ClearLocalState(const FilePath& profile_path) { |
77 file_util::Delete(profile_path.Append(chrome::kAppCacheDirname), true); | 77 file_util::Delete(profile_path.Append(chrome::kAppCacheDirname), true); |
78 } | 78 } |
79 | 79 |
80 bool ChromeAppCacheService::CanLoadAppCache(const GURL& manifest_url) { | 80 bool ChromeAppCacheService::CanLoadAppCache(const GURL& manifest_url) { |
81 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); | 81 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); |
82 ContentSetting setting = host_contents_settings_map_->GetContentSetting( | 82 ContentSetting setting = host_contents_settings_map_->GetContentSetting( |
83 manifest_url, CONTENT_SETTINGS_TYPE_COOKIES); | 83 manifest_url, CONTENT_SETTINGS_TYPE_COOKIES); |
84 DCHECK(setting != CONTENT_SETTING_DEFAULT); | 84 DCHECK(setting != CONTENT_SETTING_DEFAULT); |
85 return setting == CONTENT_SETTING_ALLOW || | 85 // We don't prompt for read access. |
86 setting == CONTENT_SETTING_ASK; // we don't prompt for read access | 86 return setting != CONTENT_SETTING_BLOCK; |
87 } | 87 } |
88 | 88 |
89 int ChromeAppCacheService::CanCreateAppCache( | 89 int ChromeAppCacheService::CanCreateAppCache( |
90 const GURL& manifest_url, net::CompletionCallback* callback) { | 90 const GURL& manifest_url, net::CompletionCallback* callback) { |
91 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); | 91 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); |
92 ContentSetting setting = host_contents_settings_map_->GetContentSetting( | 92 ContentSetting setting = host_contents_settings_map_->GetContentSetting( |
93 manifest_url, CONTENT_SETTINGS_TYPE_COOKIES); | 93 manifest_url, CONTENT_SETTINGS_TYPE_COOKIES); |
94 DCHECK(setting != CONTENT_SETTING_DEFAULT); | 94 DCHECK(setting != CONTENT_SETTING_DEFAULT); |
95 if (setting == CONTENT_SETTING_ASK) { | 95 if (setting == CONTENT_SETTING_ASK) { |
96 ChromeThread::PostTask( | 96 ChromeThread::PostTask( |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 const tracked_objects::Location& from_here, | 169 const tracked_objects::Location& from_here, |
170 Task* task) { | 170 Task* task) { |
171 return ChromeThread::PostTask(ToChromeThreadID(id), from_here, task); | 171 return ChromeThread::PostTask(ToChromeThreadID(id), from_here, task); |
172 } | 172 } |
173 | 173 |
174 bool AppCacheThread::CurrentlyOn(int id) { | 174 bool AppCacheThread::CurrentlyOn(int id) { |
175 return ChromeThread::CurrentlyOn(ToChromeThreadID(id)); | 175 return ChromeThread::CurrentlyOn(ToChromeThreadID(id)); |
176 } | 176 } |
177 | 177 |
178 } // namespace appcache | 178 } // namespace appcache |
OLD | NEW |