| 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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 #include "content/public/common/sandbox_linux.h" | 69 #include "content/public/common/sandbox_linux.h" |
| 70 #endif | 70 #endif |
| 71 | 71 |
| 72 #if defined(OS_WIN) | 72 #if defined(OS_WIN) |
| 73 #include "chrome/browser/enumerate_modules_model_win.h" | 73 #include "chrome/browser/enumerate_modules_model_win.h" |
| 74 #endif | 74 #endif |
| 75 | 75 |
| 76 #if defined(OS_CHROMEOS) | 76 #if defined(OS_CHROMEOS) |
| 77 #include "chrome/browser/browser_process_platform_part_chromeos.h" | 77 #include "chrome/browser/browser_process_platform_part_chromeos.h" |
| 78 #include "chrome/browser/chromeos/customization/customization_document.h" | 78 #include "chrome/browser/chromeos/customization/customization_document.h" |
| 79 #include "chrome/browser/chromeos/memory/oom_priority_manager.h" | 79 #include "chrome/browser/memory/oom_priority_manager.h" |
| 80 #endif | 80 #endif |
| 81 | 81 |
| 82 using base::Time; | 82 using base::Time; |
| 83 using base::TimeDelta; | 83 using base::TimeDelta; |
| 84 using content::BrowserThread; | 84 using content::BrowserThread; |
| 85 using content::WebContents; | 85 using content::WebContents; |
| 86 | 86 |
| 87 namespace { | 87 namespace { |
| 88 | 88 |
| 89 const char kCreditsJsPath[] = "credits.js"; | 89 const char kCreditsJsPath[] = "credits.js"; |
| (...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 if (path == kRunCommand) | 509 if (path == kRunCommand) |
| 510 return AboutDiscardsRun(); | 510 return AboutDiscardsRun(); |
| 511 AppendHeader(&output, 0, "About discards"); | 511 AppendHeader(&output, 0, "About discards"); |
| 512 AddContentSecurityPolicy(&output); | 512 AddContentSecurityPolicy(&output); |
| 513 AppendBody(&output); | 513 AppendBody(&output); |
| 514 output.append("<h3>About discards</h3>"); | 514 output.append("<h3>About discards</h3>"); |
| 515 output.append( | 515 output.append( |
| 516 "<p>Tabs sorted from most interesting to least interesting. The least " | 516 "<p>Tabs sorted from most interesting to least interesting. The least " |
| 517 "interesting tab may be discarded if we run out of physical memory.</p>"); | 517 "interesting tab may be discarded if we run out of physical memory.</p>"); |
| 518 | 518 |
| 519 chromeos::OomPriorityManager* oom = | 519 memory::OomPriorityManager* oom = |
| 520 g_browser_process->platform_part()->oom_priority_manager(); | 520 g_browser_process->platform_part()->oom_priority_manager(); |
| 521 std::vector<base::string16> titles = oom->GetTabTitles(); | 521 std::vector<base::string16> titles = oom->GetTabTitles(); |
| 522 if (!titles.empty()) { | 522 if (!titles.empty()) { |
| 523 output.append("<ul>"); | 523 output.append("<ul>"); |
| 524 std::vector<base::string16>::iterator it = titles.begin(); | 524 std::vector<base::string16>::iterator it = titles.begin(); |
| 525 for ( ; it != titles.end(); ++it) { | 525 for ( ; it != titles.end(); ++it) { |
| 526 std::string title = base::UTF16ToUTF8(*it); | 526 std::string title = base::UTF16ToUTF8(*it); |
| 527 title = net::EscapeForHTML(title); | 527 title = net::EscapeForHTML(title); |
| 528 output.append(WrapWithTag("li", title)); | 528 output.append(WrapWithTag("li", title)); |
| 529 } | 529 } |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 988 Profile* profile = Profile::FromWebUI(web_ui); | 988 Profile* profile = Profile::FromWebUI(web_ui); |
| 989 | 989 |
| 990 #if defined(ENABLE_THEMES) | 990 #if defined(ENABLE_THEMES) |
| 991 // Set up the chrome://theme/ source. | 991 // Set up the chrome://theme/ source. |
| 992 ThemeSource* theme = new ThemeSource(profile); | 992 ThemeSource* theme = new ThemeSource(profile); |
| 993 content::URLDataSource::Add(profile, theme); | 993 content::URLDataSource::Add(profile, theme); |
| 994 #endif | 994 #endif |
| 995 | 995 |
| 996 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); | 996 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); |
| 997 } | 997 } |
| OLD | NEW |