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 "webkit/appcache/view_appcache_internals_job.h" | 5 #include "webkit/appcache/view_appcache_internals_job.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/format_macros.h" | 8 #include "base/format_macros.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "base/i18n/time_formatting.h" | 10 #include "base/i18n/time_formatting.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 void EndHTML(std::string* out) { | 59 void EndHTML(std::string* out) { |
60 DCHECK(out); | 60 DCHECK(out); |
61 out->append("</body></html>"); | 61 out->append("</body></html>"); |
62 } | 62 } |
63 | 63 |
64 // Appends an input button to |data| with text |title| that sends the command | 64 // Appends an input button to |data| with text |title| that sends the command |
65 // string |command| back to the browser, and then refreshes the page. | 65 // string |command| back to the browser, and then refreshes the page. |
66 void DrawCommandButton(const std::string& title, | 66 void DrawCommandButton(const std::string& title, |
67 const std::string& command, | 67 const std::string& command, |
68 std::string* data) { | 68 std::string* data) { |
69 StringAppendF(data, "<input type=\"button\" value=\"%s\" " | 69 base::StringAppendF(data, "<input type=\"button\" value=\"%s\" " |
70 "onclick=\"RemoveCommand('%s')\" />", | 70 "onclick=\"RemoveCommand('%s')\" />", |
71 title.c_str(), | 71 title.c_str(), |
72 command.c_str()); | 72 command.c_str()); |
73 } | 73 } |
74 | 74 |
75 void AddLiTag(const std::string& element_title, | 75 void AddLiTag(const std::string& element_title, |
76 const std::string& element_data, std::string* out) { | 76 const std::string& element_data, std::string* out) { |
77 DCHECK(out); | 77 DCHECK(out); |
78 out->append("<li>"); | 78 out->append("<li>"); |
79 out->append(element_title); | 79 out->append(element_title); |
80 out->append(element_data); | 80 out->append(element_data); |
81 out->append("</li>"); | 81 out->append("</li>"); |
82 } | 82 } |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
250 data->append(kErrorMessage); | 250 data->append(kErrorMessage); |
251 else if (info_collection_->infos_by_origin.empty()) | 251 else if (info_collection_->infos_by_origin.empty()) |
252 data->append(kEmptyAppCachesMessage); | 252 data->append(kEmptyAppCachesMessage); |
253 else | 253 else |
254 GenerateHTMLAppCacheInfo(data); | 254 GenerateHTMLAppCacheInfo(data); |
255 EndHTML(data); | 255 EndHTML(data); |
256 return true; | 256 return true; |
257 } | 257 } |
258 | 258 |
259 } // namespace appcache | 259 } // namespace appcache |
OLD | NEW |