| 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/nacl_ui.h" | 5 #include "chrome/browser/ui/webui/nacl_ui.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <utility> | 11 #include <utility> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/bind.h" | 14 #include "base/bind.h" |
| 15 #include "base/bind_helpers.h" | 15 #include "base/bind_helpers.h" |
| 16 #include "base/command_line.h" | 16 #include "base/command_line.h" |
| 17 #include "base/files/file_util.h" | 17 #include "base/files/file_util.h" |
| 18 #include "base/json/json_file_value_serializer.h" | 18 #include "base/json/json_file_value_serializer.h" |
| 19 #include "base/macros.h" | 19 #include "base/macros.h" |
| 20 #include "base/memory/ptr_util.h" | 20 #include "base/memory/ptr_util.h" |
| 21 #include "base/memory/weak_ptr.h" | 21 #include "base/memory/weak_ptr.h" |
| 22 #include "base/metrics/user_metrics.h" |
| 22 #include "base/path_service.h" | 23 #include "base/path_service.h" |
| 23 #include "base/strings/string16.h" | 24 #include "base/strings/string16.h" |
| 24 #include "base/strings/string_number_conversions.h" | 25 #include "base/strings/string_number_conversions.h" |
| 25 #include "base/strings/utf_string_conversions.h" | 26 #include "base/strings/utf_string_conversions.h" |
| 26 #include "base/task_scheduler/post_task.h" | 27 #include "base/task_scheduler/post_task.h" |
| 27 #include "base/threading/sequenced_worker_pool.h" | 28 #include "base/threading/sequenced_worker_pool.h" |
| 28 #include "base/values.h" | 29 #include "base/values.h" |
| 29 #include "build/build_config.h" | 30 #include "build/build_config.h" |
| 30 #include "chrome/browser/plugins/plugin_prefs.h" | 31 #include "chrome/browser/plugins/plugin_prefs.h" |
| 31 #include "chrome/browser/profiles/profile.h" | 32 #include "chrome/browser/profiles/profile.h" |
| 32 #include "chrome/common/channel_info.h" | 33 #include "chrome/common/channel_info.h" |
| 33 #include "chrome/common/chrome_paths.h" | 34 #include "chrome/common/chrome_paths.h" |
| 34 #include "chrome/common/chrome_switches.h" | 35 #include "chrome/common/chrome_switches.h" |
| 35 #include "chrome/common/url_constants.h" | 36 #include "chrome/common/url_constants.h" |
| 36 #include "chrome/grit/browser_resources.h" | 37 #include "chrome/grit/browser_resources.h" |
| 37 #include "chrome/grit/chromium_strings.h" | 38 #include "chrome/grit/chromium_strings.h" |
| 38 #include "chrome/grit/generated_resources.h" | 39 #include "chrome/grit/generated_resources.h" |
| 39 #include "components/strings/grit/components_strings.h" | 40 #include "components/strings/grit/components_strings.h" |
| 40 #include "components/version_info/version_info.h" | 41 #include "components/version_info/version_info.h" |
| 41 #include "content/public/browser/browser_thread.h" | 42 #include "content/public/browser/browser_thread.h" |
| 42 #include "content/public/browser/plugin_service.h" | 43 #include "content/public/browser/plugin_service.h" |
| 43 #include "content/public/browser/user_metrics.h" | |
| 44 #include "content/public/browser/web_ui.h" | 44 #include "content/public/browser/web_ui.h" |
| 45 #include "content/public/browser/web_ui_data_source.h" | 45 #include "content/public/browser/web_ui_data_source.h" |
| 46 #include "content/public/browser/web_ui_message_handler.h" | 46 #include "content/public/browser/web_ui_message_handler.h" |
| 47 #include "content/public/common/webplugininfo.h" | 47 #include "content/public/common/webplugininfo.h" |
| 48 #include "ui/base/l10n/l10n_util.h" | 48 #include "ui/base/l10n/l10n_util.h" |
| 49 | 49 |
| 50 #if defined(OS_WIN) | 50 #if defined(OS_WIN) |
| 51 #include "base/win/windows_version.h" | 51 #include "base/win/windows_version.h" |
| 52 #endif | 52 #endif |
| 53 | 53 |
| (...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 | 381 |
| 382 } // namespace | 382 } // namespace |
| 383 | 383 |
| 384 /////////////////////////////////////////////////////////////////////////////// | 384 /////////////////////////////////////////////////////////////////////////////// |
| 385 // | 385 // |
| 386 // NaClUI | 386 // NaClUI |
| 387 // | 387 // |
| 388 /////////////////////////////////////////////////////////////////////////////// | 388 /////////////////////////////////////////////////////////////////////////////// |
| 389 | 389 |
| 390 NaClUI::NaClUI(content::WebUI* web_ui) : WebUIController(web_ui) { | 390 NaClUI::NaClUI(content::WebUI* web_ui) : WebUIController(web_ui) { |
| 391 content::RecordAction(UserMetricsAction("ViewAboutNaCl")); | 391 base::RecordAction(UserMetricsAction("ViewAboutNaCl")); |
| 392 | 392 |
| 393 web_ui->AddMessageHandler(base::MakeUnique<NaClDomHandler>()); | 393 web_ui->AddMessageHandler(base::MakeUnique<NaClDomHandler>()); |
| 394 | 394 |
| 395 // Set up the about:nacl source. | 395 // Set up the about:nacl source. |
| 396 Profile* profile = Profile::FromWebUI(web_ui); | 396 Profile* profile = Profile::FromWebUI(web_ui); |
| 397 content::WebUIDataSource::Add(profile, CreateNaClUIHTMLSource()); | 397 content::WebUIDataSource::Add(profile, CreateNaClUIHTMLSource()); |
| 398 } | 398 } |
| OLD | NEW |