Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: chrome/browser/ui/webui/about_ui.cc

Issue 1244033005: Enable tab discarding on Mac (behind a flag). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 "<p>The following pages are for debugging purposes only. Because they " 450 "<p>The following pages are for debugging purposes only. Because they "
451 "crash or hang the renderer, they're not linked directly; you can type " 451 "crash or hang the renderer, they're not linked directly; you can type "
452 "them into the address bar if you need them.</p>\n<ul>"; 452 "them into the address bar if you need them.</p>\n<ul>";
453 for (int i = 0; i < chrome::kNumberOfChromeDebugURLs; i++) 453 for (int i = 0; i < chrome::kNumberOfChromeDebugURLs; i++)
454 html += "<li>" + std::string(chrome::kChromeDebugURLs[i]) + "</li>\n"; 454 html += "<li>" + std::string(chrome::kChromeDebugURLs[i]) + "</li>\n";
455 html += "</ul>\n"; 455 html += "</ul>\n";
456 AppendFooter(&html); 456 AppendFooter(&html);
457 return html; 457 return html;
458 } 458 }
459 459
460 #if defined(OS_WIN) || defined(OS_CHROMEOS) 460 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS)
461 461
462 const char kAboutDiscardsRunCommand[] = "run"; 462 const char kAboutDiscardsRunCommand[] = "run";
463 463
464 // Html output helper functions 464 // Html output helper functions
465 465
466 // Helper function to wrap HTML with a tag. 466 // Helper function to wrap HTML with a tag.
467 std::string WrapWithTag(const std::string& tag, const std::string& text) { 467 std::string WrapWithTag(const std::string& tag, const std::string& text) {
468 return "<" + tag + ">" + text + "</" + tag + ">"; 468 return "<" + tag + ">" + text + "</" + tag + ">";
469 } 469 }
470 470 #if defined(OS_CHROMEOS)
471 // Helper function to wrap Html with <td> tag. 471 // Helper function to wrap Html with <td> tag.
472 std::string WrapWithTD(const std::string& text) { 472 std::string WrapWithTD(const std::string& text) {
473 return "<td>" + text + "</td>"; 473 return "<td>" + text + "</td>";
474 } 474 }
475 475
476 // Helper function to wrap Html with <tr> tag. 476 // Helper function to wrap Html with <tr> tag.
477 std::string WrapWithTR(const std::string& text) { 477 std::string WrapWithTR(const std::string& text) {
478 return "<tr>" + text + "</tr>"; 478 return "<tr>" + text + "</tr>";
479 } 479 }
480 480
481 std::string AddStringRow(const std::string& name, const std::string& value) { 481 std::string AddStringRow(const std::string& name, const std::string& value) {
482 std::string row; 482 std::string row;
483 row.append(WrapWithTD(name)); 483 row.append(WrapWithTD(name));
484 row.append(WrapWithTD(value)); 484 row.append(WrapWithTD(value));
485 return WrapWithTR(row); 485 return WrapWithTR(row);
486 } 486 }
487 487 #endif
488 void AddContentSecurityPolicy(std::string* output) { 488 void AddContentSecurityPolicy(std::string* output) {
489 output->append("<meta http-equiv='Content-Security-Policy' " 489 output->append("<meta http-equiv='Content-Security-Policy' "
490 "content='default-src 'none';'>"); 490 "content='default-src 'none';'>");
491 } 491 }
492 492
493 // TODO(stevenjb): L10N AboutDiscards. 493 // TODO(stevenjb): L10N AboutDiscards.
494 494
495 std::string BuildAboutDiscardsRunPage() { 495 std::string BuildAboutDiscardsRunPage() {
496 std::string output; 496 std::string output;
497 AppendHeader(&output, 0, "About discards"); 497 AppendHeader(&output, 0, "About discards");
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
938 int idr = IDR_CREDITS_HTML; 938 int idr = IDR_CREDITS_HTML;
939 if (path == kCreditsJsPath) 939 if (path == kCreditsJsPath)
940 idr = IDR_CREDITS_JS; 940 idr = IDR_CREDITS_JS;
941 #if defined(OS_CHROMEOS) 941 #if defined(OS_CHROMEOS)
942 else if (path == kKeyboardUtilsPath) 942 else if (path == kKeyboardUtilsPath)
943 idr = IDR_KEYBOARD_UTILS_JS; 943 idr = IDR_KEYBOARD_UTILS_JS;
944 #endif 944 #endif
945 945
946 response = ResourceBundle::GetSharedInstance().GetRawDataResource( 946 response = ResourceBundle::GetSharedInstance().GetRawDataResource(
947 idr).as_string(); 947 idr).as_string();
948 #if defined(OS_WIN) || defined(OS_CHROMEOS) 948 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_CHROMEOS)
949 } else if (source_name_ == chrome::kChromeUIDiscardsHost) { 949 } else if (source_name_ == chrome::kChromeUIDiscardsHost) {
950 response = AboutDiscards(path); 950 response = AboutDiscards(path);
951 #endif 951 #endif
952 } else if (source_name_ == chrome::kChromeUIDNSHost) { 952 } else if (source_name_ == chrome::kChromeUIDNSHost) {
953 AboutDnsHandler::Start(profile(), callback); 953 AboutDnsHandler::Start(profile(), callback);
954 return; 954 return;
955 #if defined(OS_LINUX) || defined(OS_OPENBSD) 955 #if defined(OS_LINUX) || defined(OS_OPENBSD)
956 } else if (source_name_ == chrome::kChromeUILinuxProxyConfigHost) { 956 } else if (source_name_ == chrome::kChromeUILinuxProxyConfigHost) {
957 response = AboutLinuxProxyConfig(); 957 response = AboutLinuxProxyConfig();
958 #endif 958 #endif
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
1027 Profile* profile = Profile::FromWebUI(web_ui); 1027 Profile* profile = Profile::FromWebUI(web_ui);
1028 1028
1029 #if defined(ENABLE_THEMES) 1029 #if defined(ENABLE_THEMES)
1030 // Set up the chrome://theme/ source. 1030 // Set up the chrome://theme/ source.
1031 ThemeSource* theme = new ThemeSource(profile); 1031 ThemeSource* theme = new ThemeSource(profile);
1032 content::URLDataSource::Add(profile, theme); 1032 content::URLDataSource::Add(profile, theme);
1033 #endif 1033 #endif
1034 1034
1035 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile)); 1035 content::URLDataSource::Add(profile, new AboutUIHTMLSource(name, profile));
1036 } 1036 }
OLDNEW
« no previous file with comments | « chrome/browser/memory/oom_priority_manager_browsertest.cc ('k') | chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698