| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/browser/appcache/appcache_internals_ui.h" | 5 #include "content/browser/appcache/appcache_internals_ui.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 kRequestGetFileDetails, | 344 kRequestGetFileDetails, |
| 345 base::Bind(&AppCacheInternalsUI::GetFileDetails, AsWeakPtr())); | 345 base::Bind(&AppCacheInternalsUI::GetFileDetails, AsWeakPtr())); |
| 346 | 346 |
| 347 WebUIDataSource* source = | 347 WebUIDataSource* source = |
| 348 WebUIDataSource::Create(kChromeUIAppCacheInternalsHost); | 348 WebUIDataSource::Create(kChromeUIAppCacheInternalsHost); |
| 349 | 349 |
| 350 source->SetJsonPath("strings.js"); | 350 source->SetJsonPath("strings.js"); |
| 351 source->AddResourcePath("appcache_internals.js", IDR_APPCACHE_INTERNALS_JS); | 351 source->AddResourcePath("appcache_internals.js", IDR_APPCACHE_INTERNALS_JS); |
| 352 source->AddResourcePath("appcache_internals.css", IDR_APPCACHE_INTERNALS_CSS); | 352 source->AddResourcePath("appcache_internals.css", IDR_APPCACHE_INTERNALS_CSS); |
| 353 source->SetDefaultResource(IDR_APPCACHE_INTERNALS_HTML); | 353 source->SetDefaultResource(IDR_APPCACHE_INTERNALS_HTML); |
| 354 source->DisableI18nAndUseGzipForAllPaths(); | 354 source->UseGzipForAllPaths(); |
| 355 | 355 |
| 356 WebUIDataSource::Add(browser_context(), source); | 356 WebUIDataSource::Add(browser_context(), source); |
| 357 | 357 |
| 358 BrowserContext::StoragePartitionCallback callback = | 358 BrowserContext::StoragePartitionCallback callback = |
| 359 base::Bind(&AppCacheInternalsUI::CreateProxyForPartition, AsWeakPtr()); | 359 base::Bind(&AppCacheInternalsUI::CreateProxyForPartition, AsWeakPtr()); |
| 360 BrowserContext::ForEachStoragePartition(browser_context(), callback); | 360 BrowserContext::ForEachStoragePartition(browser_context(), callback); |
| 361 } | 361 } |
| 362 | 362 |
| 363 AppCacheInternalsUI::~AppCacheInternalsUI() { | 363 AppCacheInternalsUI::~AppCacheInternalsUI() { |
| 364 for (auto& proxy : appcache_proxies_) | 364 for (auto& proxy : appcache_proxies_) |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 const base::FilePath& partition_path) { | 503 const base::FilePath& partition_path) { |
| 504 for (const scoped_refptr<Proxy>& proxy : appcache_proxies_) { | 504 for (const scoped_refptr<Proxy>& proxy : appcache_proxies_) { |
| 505 if (proxy->partition_path_ == partition_path) | 505 if (proxy->partition_path_ == partition_path) |
| 506 return proxy.get(); | 506 return proxy.get(); |
| 507 } | 507 } |
| 508 NOTREACHED(); | 508 NOTREACHED(); |
| 509 return nullptr; | 509 return nullptr; |
| 510 } | 510 } |
| 511 | 511 |
| 512 } // namespace content | 512 } // namespace content |
| OLD | NEW |