| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/string_piece.h" | 10 #include "base/strings/string_piece.h" |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 406 Proxy* proxy = | 406 Proxy* proxy = |
| 407 GetProxyForPartitionPath(base::FilePath::FromUTF8Unsafe(partition_path)); | 407 GetProxyForPartitionPath(base::FilePath::FromUTF8Unsafe(partition_path)); |
| 408 if (proxy) | 408 if (proxy) |
| 409 proxy->RequestFileDetails( | 409 proxy->RequestFileDetails( |
| 410 {manifest_url, ToInt64(group_id_str), ToInt64(response_id_str)}); | 410 {manifest_url, ToInt64(group_id_str), ToInt64(response_id_str)}); |
| 411 } | 411 } |
| 412 | 412 |
| 413 void AppCacheInternalsUI::OnAllAppCacheInfoReady( | 413 void AppCacheInternalsUI::OnAllAppCacheInfoReady( |
| 414 scoped_refptr<AppCacheInfoCollection> collection, | 414 scoped_refptr<AppCacheInfoCollection> collection, |
| 415 const base::FilePath& partition_path) { | 415 const base::FilePath& partition_path) { |
| 416 std::string incognito_path_prefix; |
| 417 if (browser_context()->IsOffTheRecord()) |
| 418 incognito_path_prefix = "Incognito "; |
| 416 web_ui()->CallJavascriptFunction( | 419 web_ui()->CallJavascriptFunction( |
| 417 kFunctionOnAllAppCacheInfoReady, | 420 kFunctionOnAllAppCacheInfoReady, |
| 418 base::StringValue(partition_path.AsUTF8Unsafe()), | 421 base::StringValue(incognito_path_prefix + partition_path.AsUTF8Unsafe()), |
| 419 *GetListValueFromAppCacheInfoCollection(collection.get())); | 422 *GetListValueFromAppCacheInfoCollection(collection.get())); |
| 420 } | 423 } |
| 421 | 424 |
| 422 void AppCacheInternalsUI::OnAppCacheInfoDeleted( | 425 void AppCacheInternalsUI::OnAppCacheInfoDeleted( |
| 423 const base::FilePath& partition_path, | 426 const base::FilePath& partition_path, |
| 424 const std::string& manifest_url, | 427 const std::string& manifest_url, |
| 425 bool deleted) { | 428 bool deleted) { |
| 426 web_ui()->CallJavascriptFunction( | 429 web_ui()->CallJavascriptFunction( |
| 427 kFunctionOnAppCacheInfoDeleted, | 430 kFunctionOnAppCacheInfoDeleted, |
| 428 base::StringValue(partition_path.AsUTF8Unsafe()), | 431 base::StringValue(partition_path.AsUTF8Unsafe()), |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 const base::FilePath& partition_path) { | 499 const base::FilePath& partition_path) { |
| 497 for (const scoped_refptr<Proxy>& proxy : appcache_proxies_) { | 500 for (const scoped_refptr<Proxy>& proxy : appcache_proxies_) { |
| 498 if (proxy->partition_path_ == partition_path) | 501 if (proxy->partition_path_ == partition_path) |
| 499 return proxy.get(); | 502 return proxy.get(); |
| 500 } | 503 } |
| 501 NOTREACHED(); | 504 NOTREACHED(); |
| 502 return nullptr; | 505 return nullptr; |
| 503 } | 506 } |
| 504 | 507 |
| 505 } // namespace content | 508 } // namespace content |
| OLD | NEW |