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

Unified Diff: chrome/browser/ui/webui/chromeos/device_log_ui.cc

Issue 919183002: Move chromeos::device_event_log into components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Shut down in PostDestroyThreads. Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/chromeos/device_log_ui.h ('k') | chrome/browser/ui/webui/chromeos/network_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/chromeos/device_log_ui.cc
diff --git a/chrome/browser/ui/webui/chromeos/device_log_ui.cc b/chrome/browser/ui/webui/chromeos/device_log_ui.cc
deleted file mode 100644
index cfd47e37d5e295d6d9a657b54142b1ae4a4fe01f..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/webui/chromeos/device_log_ui.cc
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/ui/webui/chromeos/device_log_ui.h"
-
-#include <string>
-
-#include "base/bind.h"
-#include "base/bind_helpers.h"
-#include "base/values.h"
-#include "chrome/common/url_constants.h"
-#include "chrome/grit/generated_resources.h"
-#include "chromeos/device_event_log.h"
-#include "content/public/browser/web_contents.h"
-#include "content/public/browser/web_ui.h"
-#include "content/public/browser/web_ui_data_source.h"
-#include "content/public/browser/web_ui_message_handler.h"
-#include "grit/browser_resources.h"
-
-namespace chromeos {
-
-namespace {
-
-class DeviceLogMessageHandler : public content::WebUIMessageHandler {
- public:
- DeviceLogMessageHandler() {}
- ~DeviceLogMessageHandler() override {}
-
- // WebUIMessageHandler implementation.
- void RegisterMessages() override {
- web_ui()->RegisterMessageCallback(
- "DeviceLog.getLog",
- base::Bind(&DeviceLogMessageHandler::GetLog,
- base::Unretained(this)));
- }
-
- private:
- void GetLog(const base::ListValue* value) const {
- base::StringValue data(chromeos::device_event_log::GetAsString(
- chromeos::device_event_log::NEWEST_FIRST, "json", "",
- chromeos::device_event_log::LOG_LEVEL_DEBUG, 0));
- web_ui()->CallJavascriptFunction("DeviceLogUI.getLogCallback", data);
- }
-
- DISALLOW_COPY_AND_ASSIGN(DeviceLogMessageHandler);
-};
-
-} // namespace
-
-DeviceLogUI::DeviceLogUI(content::WebUI* web_ui)
- : content::WebUIController(web_ui) {
- web_ui->AddMessageHandler(new DeviceLogMessageHandler());
-
- content::WebUIDataSource* html =
- content::WebUIDataSource::Create(chrome::kChromeUIDeviceLogHost);
-
- html->AddLocalizedString("titleText", IDS_DEVICE_LOG_TITLE);
- html->AddLocalizedString("autoRefreshText", IDS_DEVICE_AUTO_REFRESH);
- html->AddLocalizedString("logRefreshText", IDS_DEVICE_LOG_REFRESH);
-
- html->AddLocalizedString("logLevelShowText", IDS_DEVICE_LOG_LEVEL_SHOW);
- html->AddLocalizedString("logLevelErrorText", IDS_DEVICE_LOG_LEVEL_ERROR);
- html->AddLocalizedString("logLevelUserText", IDS_DEVICE_LOG_LEVEL_USER);
- html->AddLocalizedString("logLevelEventText", IDS_DEVICE_LOG_LEVEL_EVENT);
- html->AddLocalizedString("logLevelDebugText", IDS_DEVICE_LOG_LEVEL_DEBUG);
- html->AddLocalizedString("logLevelFileinfoText", IDS_DEVICE_LOG_FILEINFO);
- html->AddLocalizedString("logLevelTimeDetailText",
- IDS_DEVICE_LOG_TIME_DETAIL);
-
- html->AddLocalizedString("logTypeLoginText", IDS_DEVICE_LOG_TYPE_LOGIN);
- html->AddLocalizedString("logTypeNetworkText", IDS_DEVICE_LOG_TYPE_NETWORK);
- html->AddLocalizedString("logTypePowerText", IDS_DEVICE_LOG_TYPE_POWER);
-
- html->AddLocalizedString("logEntryFormat", IDS_DEVICE_LOG_ENTRY);
- html->SetJsonPath("strings.js");
- html->AddResourcePath("device_log_ui.css", IDR_DEVICE_LOG_UI_CSS);
- html->AddResourcePath("device_log_ui.js", IDR_DEVICE_LOG_UI_JS);
- html->SetDefaultResource(IDR_DEVICE_LOG_UI_HTML);
-
- content::WebUIDataSource::Add(
- web_ui->GetWebContents()->GetBrowserContext(), html);
-}
-
-DeviceLogUI::~DeviceLogUI() {
-}
-
-} // namespace chromeos
« no previous file with comments | « chrome/browser/ui/webui/chromeos/device_log_ui.h ('k') | chrome/browser/ui/webui/chromeos/network_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698