OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser_about_handler.h" | 5 #include "chrome/browser/browser_about_handler.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 // Individual about handlers --------------------------------------------------- | 401 // Individual about handlers --------------------------------------------------- |
402 | 402 |
403 void AppendHeader(std::string* output, int refresh, | 403 void AppendHeader(std::string* output, int refresh, |
404 const std::string& unescaped_title) { | 404 const std::string& unescaped_title) { |
405 output->append("<!DOCTYPE HTML>\n<html>\n<head>\n"); | 405 output->append("<!DOCTYPE HTML>\n<html>\n<head>\n"); |
406 if (!unescaped_title.empty()) { | 406 if (!unescaped_title.empty()) { |
407 output->append("<title>"); | 407 output->append("<title>"); |
408 output->append(EscapeForHTML(unescaped_title)); | 408 output->append(EscapeForHTML(unescaped_title)); |
409 output->append("</title>\n"); | 409 output->append("</title>\n"); |
410 } | 410 } |
411 output->append( | 411 output->append("<meta charset=\"utf-8\">\n"); |
412 "<meta charset=\"utf-8\">\n<meta http-equiv=\"X-WebKit-CSP\" " | 412 output->append(ResourceBundle::GetSharedInstance().GetRawDataResource( |
413 "content=\"object-src 'none'; " | 413 IDR_CONTENT_SECURITY_POLICY_HTML).as_string()); |
414 "script-src chrome-extension://mndnfokpggljbaajbnioimlmbfngpief " | |
415 " 'self' 'unsafe-eval'\">\n"); | |
416 if (refresh > 0) { | 414 if (refresh > 0) { |
417 output->append("<meta http-equiv=\"refresh\" content=\""); | 415 output->append("<meta http-equiv=\"refresh\" content=\""); |
418 output->append(base::IntToString(refresh)); | 416 output->append(base::IntToString(refresh)); |
419 output->append("\"/>\n"); | 417 output->append("\"/>\n"); |
420 } | 418 } |
421 } | 419 } |
422 | 420 |
423 void AppendBody(std::string *output) { | 421 void AppendBody(std::string *output) { |
424 output->append("</head>\n<body>\n"); | 422 output->append("</head>\n<body>\n"); |
425 } | 423 } |
(...skipping 1096 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1522 return false; | 1520 return false; |
1523 } | 1521 } |
1524 | 1522 |
1525 std::vector<std::string> ChromePaths() { | 1523 std::vector<std::string> ChromePaths() { |
1526 std::vector<std::string> paths; | 1524 std::vector<std::string> paths; |
1527 paths.reserve(arraysize(kChromePaths)); | 1525 paths.reserve(arraysize(kChromePaths)); |
1528 for (size_t i = 0; i < arraysize(kChromePaths); i++) | 1526 for (size_t i = 0; i < arraysize(kChromePaths); i++) |
1529 paths.push_back(kChromePaths[i]); | 1527 paths.push_back(kChromePaths[i]); |
1530 return paths; | 1528 return paths; |
1531 } | 1529 } |
OLD | NEW |