| OLD | NEW |
| 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 "chrome/browser/ui/webui/about_ui.h" | 5 #include "chrome/browser/ui/webui/about_ui.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 memory::TabStatsList stats = tab_manager->GetTabStats(); | 515 memory::TabStatsList stats = tab_manager->GetTabStats(); |
| 516 std::vector<std::string> titles; | 516 std::vector<std::string> titles; |
| 517 titles.reserve(stats.size()); | 517 titles.reserve(stats.size()); |
| 518 for (memory::TabStatsList::iterator it = stats.begin(); it != stats.end(); | 518 for (memory::TabStatsList::iterator it = stats.begin(); it != stats.end(); |
| 519 ++it) { | 519 ++it) { |
| 520 std::string str; | 520 std::string str; |
| 521 str.reserve(4096); | 521 str.reserve(4096); |
| 522 str += "<b>"; | 522 str += "<b>"; |
| 523 str += it->is_app ? "[App] " : ""; | 523 str += it->is_app ? "[App] " : ""; |
| 524 str += it->is_internal_page ? "[Internal] " : ""; | 524 str += it->is_internal_page ? "[Internal] " : ""; |
| 525 str += it->is_playing_audio ? "[Audio] " : ""; | 525 str += it->is_media ? "[Media] " : ""; |
| 526 str += it->is_pinned ? "[Pinned] " : ""; | 526 str += it->is_pinned ? "[Pinned] " : ""; |
| 527 str += it->is_discarded ? "[Discarded] " : ""; | 527 str += it->is_discarded ? "[Discarded] " : ""; |
| 528 str += "</b>"; | 528 str += "</b>"; |
| 529 str += net::EscapeForHTML(base::UTF16ToUTF8(it->title)); | 529 str += net::EscapeForHTML(base::UTF16ToUTF8(it->title)); |
| 530 #if defined(OS_CHROMEOS) | 530 #if defined(OS_CHROMEOS) |
| 531 str += base::StringPrintf(" (%d) ", it->oom_score); | 531 str += base::StringPrintf(" (%d) ", it->oom_score); |
| 532 #endif | 532 #endif |
| 533 if (!it->is_discarded) { | 533 if (!it->is_discarded) { |
| 534 str += base::StringPrintf(" <a href='%s%s/%" PRId64 "'>Discard</a>", | 534 str += base::StringPrintf(" <a href='%s%s/%" PRId64 "'>Discard</a>", |
| 535 chrome::kChromeUIDiscardsURL, | 535 chrome::kChromeUIDiscardsURL, |
| (...skipping 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1036 Profile* profile = Profile::FromWebUI(web_ui); | 1036 Profile* profile = Profile::FromWebUI(web_ui); |
| 1037 | 1037 |
| 1038 #if defined(ENABLE_THEMES) | 1038 #if defined(ENABLE_THEMES) |
| 1039 // Set up the chrome://theme/ source. | 1039 // Set up the chrome://theme/ source. |
| 1040 ThemeSource* theme = new ThemeSource(profile); | 1040 ThemeSource* theme = new ThemeSource(profile); |
| 1041 content::URLDataSource::Add(profile, theme); | 1041 content::URLDataSource::Add(profile, theme); |
| 1042 #endif | 1042 #endif |
| 1043 | 1043 |
| 1044 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); | 1044 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); |
| 1045 } | 1045 } |
| OLD | NEW |