| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 522 str += "</b>"; | 522 str += "</b>"; |
| 523 str += net::EscapeForHTML(base::UTF16ToUTF8(it->title)); | 523 str += net::EscapeForHTML(base::UTF16ToUTF8(it->title)); |
| 524 #if defined(OS_CHROMEOS) | 524 #if defined(OS_CHROMEOS) |
| 525 str += base::StringPrintf(" (%d) ", it->oom_score); | 525 str += base::StringPrintf(" (%d) ", it->oom_score); |
| 526 #endif | 526 #endif |
| 527 if (!it->is_discarded) { | 527 if (!it->is_discarded) { |
| 528 str += base::StringPrintf(" <a href='%s%s/%" PRId64 "'>Discard</a>", | 528 str += base::StringPrintf(" <a href='%s%s/%" PRId64 "'>Discard</a>", |
| 529 chrome::kChromeUIDiscardsURL, | 529 chrome::kChromeUIDiscardsURL, |
| 530 kAboutDiscardsRunCommand, it->tab_contents_id); | 530 kAboutDiscardsRunCommand, it->tab_contents_id); |
| 531 } | 531 } |
| 532 str += base::StringPrintf(" (%d discards this session)", |
| 533 it->discard_count); |
| 532 titles.push_back(str); | 534 titles.push_back(str); |
| 533 } | 535 } |
| 534 return titles; | 536 return titles; |
| 535 } | 537 } |
| 536 | 538 |
| 537 std::string AboutDiscards(const std::string& path) { | 539 std::string AboutDiscards(const std::string& path) { |
| 538 std::string output; | 540 std::string output; |
| 539 int64 web_content_id; | 541 int64 web_content_id; |
| 540 memory::OomPriorityManager* oom = g_browser_process->GetOomPriorityManager(); | 542 memory::OomPriorityManager* oom = g_browser_process->GetOomPriorityManager(); |
| 541 | 543 |
| (...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1028 Profile* profile = Profile::FromWebUI(web_ui); | 1030 Profile* profile = Profile::FromWebUI(web_ui); |
| 1029 | 1031 |
| 1030 #if defined(ENABLE_THEMES) | 1032 #if defined(ENABLE_THEMES) |
| 1031 // Set up the chrome://theme/ source. | 1033 // Set up the chrome://theme/ source. |
| 1032 ThemeSource* theme = new ThemeSource(profile); | 1034 ThemeSource* theme = new ThemeSource(profile); |
| 1033 content::URLDataSource::Add(profile, theme); | 1035 content::URLDataSource::Add(profile, theme); |
| 1034 #endif | 1036 #endif |
| 1035 | 1037 |
| 1036 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); | 1038 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); |
| 1037 } | 1039 } |
| OLD | NEW |