summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/BUILD.gn1
-rw-r--r--chrome/browser/DEPS1
-rw-r--r--chrome/browser/browser_resources.grd6
-rw-r--r--chrome/browser/chrome_browser_main.cc5
-rw-r--r--chrome/browser/chromeos/net/network_portal_detector_impl.cc2
-rw-r--r--chrome/browser/chromeos/system_logs/device_event_log_source.cc18
-rw-r--r--chrome/browser/resources/device_log_ui/OWNERS (renamed from chrome/browser/resources/chromeos/device_log_ui/OWNERS)0
-rw-r--r--chrome/browser/resources/device_log_ui/device_log_ui.css (renamed from chrome/browser/resources/chromeos/device_log_ui/device_log_ui.css)0
-rw-r--r--chrome/browser/resources/device_log_ui/device_log_ui.html (renamed from chrome/browser/resources/chromeos/device_log_ui/device_log_ui.html)0
-rw-r--r--chrome/browser/resources/device_log_ui/device_log_ui.js (renamed from chrome/browser/resources/chromeos/device_log_ui/device_log_ui.js)0
-rw-r--r--chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc6
-rw-r--r--chrome/browser/ui/webui/chromeos/network_ui.cc2
-rw-r--r--chrome/browser/ui/webui/device_log_ui.cc (renamed from chrome/browser/ui/webui/chromeos/device_log_ui.cc)18
-rw-r--r--chrome/browser/ui/webui/device_log_ui.h (renamed from chrome/browser/ui/webui/chromeos/device_log_ui.h)6
14 files changed, 34 insertions, 31 deletions
diff --git a/chrome/browser/BUILD.gn b/chrome/browser/BUILD.gn
index 6619495..1f084a9 100644
--- a/chrome/browser/BUILD.gn
+++ b/chrome/browser/BUILD.gn
@@ -88,6 +88,7 @@ static_library("browser") {
"//components/content_settings/core/common",
"//components/crx_file",
"//components/data_reduction_proxy/core/browser",
+ "//components/device_event_log",
"//components/domain_reliability",
"//components/enhanced_bookmarks",
"//components/favicon_base",
diff --git a/chrome/browser/DEPS b/chrome/browser/DEPS
index 2f13d99..511fed1 100644
--- a/chrome/browser/DEPS
+++ b/chrome/browser/DEPS
@@ -30,6 +30,7 @@ include_rules = [
"+components/crx_file",
"+components/data_reduction_proxy",
"+components/network_hints",
+ "+components/device_event_log",
"+components/dom_distiller",
"+components/domain_reliability",
"+components/enhanced_bookmarks",
diff --git a/chrome/browser/browser_resources.grd b/chrome/browser/browser_resources.grd
index 37f25b8..7cc4156 100644
--- a/chrome/browser/browser_resources.grd
+++ b/chrome/browser/browser_resources.grd
@@ -380,10 +380,10 @@
<include name="IDR_IDENTITY_INTERNALS_CSS" file="resources\identity_internals.css" type="BINDATA" />
<include name="IDR_IDENTITY_INTERNALS_JS" file="resources\identity_internals.js" type="BINDATA" />
</if>
+ <include name="IDR_DEVICE_LOG_UI_HTML" file="resources\device_log_ui\device_log_ui.html" type="BINDATA" />
+ <include name="IDR_DEVICE_LOG_UI_JS" file="resources\device_log_ui\device_log_ui.js" type="BINDATA" />
+ <include name="IDR_DEVICE_LOG_UI_CSS" file="resources\device_log_ui\device_log_ui.css" type="BINDATA" />
<if expr="chromeos">
- <include name="IDR_DEVICE_LOG_UI_HTML" file="resources\chromeos\device_log_ui\device_log_ui.html" type="BINDATA" />
- <include name="IDR_DEVICE_LOG_UI_JS" file="resources\chromeos\device_log_ui\device_log_ui.js" type="BINDATA" />
- <include name="IDR_DEVICE_LOG_UI_CSS" file="resources\chromeos\device_log_ui\device_log_ui.css" type="BINDATA" />
<include name="IDR_NETWORK_UI_HTML" file="resources\chromeos\network_ui\network_ui.html" type="BINDATA" />
<include name="IDR_NETWORK_UI_JS" file="resources\chromeos\network_ui\network_ui.js" type="BINDATA" />
<include name="IDR_NETWORK_UI_CSS" file="resources\chromeos\network_ui\network_ui.css" type="BINDATA" />
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index bcba855..cfd3b10 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -105,6 +105,7 @@
#include "chrome/grit/generated_resources.h"
#include "chrome/installer/util/google_update_settings.h"
#include "components/component_updater/component_updater_service.h"
+#include "components/device_event_log/device_event_log.h"
#include "components/google/core/browser/google_util.h"
#include "components/language_usage_metrics/language_usage_metrics.h"
#include "components/metrics/metrics_service.h"
@@ -756,6 +757,9 @@ void ChromeBrowserMainParts::ToolkitInitialized() {
void ChromeBrowserMainParts::PreMainMessageLoopStart() {
TRACE_EVENT0("startup", "ChromeBrowserMainParts::PreMainMessageLoopStart");
+
+ device_event_log::Initialize(0 /* default max entries */);
+
for (size_t i = 0; i < chrome_extra_parts_.size(); ++i)
chrome_extra_parts_[i]->PreMainMessageLoopStart();
}
@@ -1705,6 +1709,7 @@ void ChromeBrowserMainParts::PostDestroyThreads() {
browser_shutdown::ShutdownPostThreadsStop(restart_last_session_);
master_prefs_.reset();
process_singleton_.reset();
+ device_event_log::Shutdown();
// We need to do this check as late as possible, but due to modularity, this
// may be the last point in Chrome. This would be more effective if done at
diff --git a/chrome/browser/chromeos/net/network_portal_detector_impl.cc b/chrome/browser/chromeos/net/network_portal_detector_impl.cc
index c83cc0d..e7845fb 100644
--- a/chrome/browser/chromeos/net/network_portal_detector_impl.cc
+++ b/chrome/browser/chromeos/net/network_portal_detector_impl.cc
@@ -15,10 +15,10 @@
#include "chrome/browser/chrome_notification_types.h"
#include "chromeos/dbus/dbus_thread_manager.h"
#include "chromeos/dbus/shill_profile_client.h"
-#include "chromeos/device_event_log.h"
#include "chromeos/login/login_state.h"
#include "chromeos/network/network_state.h"
#include "chromeos/network/network_state_handler.h"
+#include "components/device_event_log/device_event_log.h"
#include "content/public/browser/notification_service.h"
#include "content/public/common/content_switches.h"
#include "net/http/http_status_code.h"
diff --git a/chrome/browser/chromeos/system_logs/device_event_log_source.cc b/chrome/browser/chromeos/system_logs/device_event_log_source.cc
index 552a583..0fb8a01 100644
--- a/chrome/browser/chromeos/system_logs/device_event_log_source.cc
+++ b/chrome/browser/chromeos/system_logs/device_event_log_source.cc
@@ -5,7 +5,7 @@
#include "chrome/browser/chromeos/system_logs/device_event_log_source.h"
#include "base/message_loop/message_loop.h"
-#include "chromeos/device_event_log.h"
+#include "components/device_event_log/device_event_log.h"
#include "content/public/browser/browser_thread.h"
namespace system_logs {
@@ -25,16 +25,12 @@ void DeviceEventLogSource::Fetch(const SysLogsSourceCallback& callback) {
scoped_ptr<SystemLogsResponse> response(new SystemLogsResponse);
const int kMaxDeviceEventsForAboutSystem = 400;
- (*response)[kNetworkEventLogEntry] = chromeos::device_event_log::GetAsString(
- chromeos::device_event_log::OLDEST_FIRST, "time,file,level",
- "network",
- chromeos::device_event_log::kDefaultLogLevel,
- kMaxDeviceEventsForAboutSystem);
- (*response)[kDeviceEventLogEntry] = chromeos::device_event_log::GetAsString(
- chromeos::device_event_log::OLDEST_FIRST, "time,file,type,level",
- "non-network",
- chromeos::device_event_log::LOG_LEVEL_DEBUG,
- kMaxDeviceEventsForAboutSystem);
+ (*response)[kNetworkEventLogEntry] = device_event_log::GetAsString(
+ device_event_log::OLDEST_FIRST, "time,file,level", "network",
+ device_event_log::kDefaultLogLevel, kMaxDeviceEventsForAboutSystem);
+ (*response)[kDeviceEventLogEntry] = device_event_log::GetAsString(
+ device_event_log::OLDEST_FIRST, "time,file,type,level", "non-network",
+ device_event_log::LOG_LEVEL_DEBUG, kMaxDeviceEventsForAboutSystem);
callback.Run(response.get());
}
diff --git a/chrome/browser/resources/chromeos/device_log_ui/OWNERS b/chrome/browser/resources/device_log_ui/OWNERS
index aa215c7..aa215c7 100644
--- a/chrome/browser/resources/chromeos/device_log_ui/OWNERS
+++ b/chrome/browser/resources/device_log_ui/OWNERS
diff --git a/chrome/browser/resources/chromeos/device_log_ui/device_log_ui.css b/chrome/browser/resources/device_log_ui/device_log_ui.css
index 3a8ea55..3a8ea55 100644
--- a/chrome/browser/resources/chromeos/device_log_ui/device_log_ui.css
+++ b/chrome/browser/resources/device_log_ui/device_log_ui.css
diff --git a/chrome/browser/resources/chromeos/device_log_ui/device_log_ui.html b/chrome/browser/resources/device_log_ui/device_log_ui.html
index 6d46248..6d46248 100644
--- a/chrome/browser/resources/chromeos/device_log_ui/device_log_ui.html
+++ b/chrome/browser/resources/device_log_ui/device_log_ui.html
diff --git a/chrome/browser/resources/chromeos/device_log_ui/device_log_ui.js b/chrome/browser/resources/device_log_ui/device_log_ui.js
index a562ed7..a562ed7 100644
--- a/chrome/browser/resources/chromeos/device_log_ui/device_log_ui.js
+++ b/chrome/browser/resources/device_log_ui/device_log_ui.js
diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
index 35a9b45..0bbbcce 100644
--- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
+++ b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc
@@ -24,6 +24,7 @@
#include "chrome/browser/ui/webui/constrained_web_dialog_ui.h"
#include "chrome/browser/ui/webui/copresence_ui.h"
#include "chrome/browser/ui/webui/crashes_ui.h"
+#include "chrome/browser/ui/webui/device_log_ui.h"
#include "chrome/browser/ui/webui/domain_reliability_internals_ui.h"
#include "chrome/browser/ui/webui/downloads_ui.h"
#include "chrome/browser/ui/webui/flags_ui.h"
@@ -111,7 +112,6 @@
#include "chrome/browser/ui/webui/chromeos/certificate_manager_dialog_ui.h"
#include "chrome/browser/ui/webui/chromeos/choose_mobile_network_ui.h"
#include "chrome/browser/ui/webui/chromeos/cryptohome_ui.h"
-#include "chrome/browser/ui/webui/chromeos/device_log_ui.h"
#include "chrome/browser/ui/webui/chromeos/drive_internals_ui.h"
#include "chrome/browser/ui/webui/chromeos/first_run/first_run_ui.h"
#include "chrome/browser/ui/webui/chromeos/imageburner/imageburner_ui.h"
@@ -297,6 +297,8 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
return &NewWebUI<ConstrainedWebDialogUI>;
if (url.host() == chrome::kChromeUICrashesHost)
return &NewWebUI<CrashesUI>;
+ if (url.host() == chrome::kChromeUIDeviceLogHost)
+ return &NewWebUI<chromeos::DeviceLogUI>;
if (url.host() == chrome::kChromeUIDomainReliabilityInternalsHost)
return &NewWebUI<DomainReliabilityInternalsUI>;
if (url.host() == chrome::kChromeUIFlagsHost)
@@ -412,8 +414,6 @@ WebUIFactoryFunction GetWebUIFactoryFunction(WebUI* web_ui,
return &NewWebUI<chromeos::ChooseMobileNetworkUI>;
if (url.host() == chrome::kChromeUICryptohomeHost)
return &NewWebUI<chromeos::CryptohomeUI>;
- if (url.host() == chrome::kChromeUIDeviceLogHost)
- return &NewWebUI<chromeos::DeviceLogUI>;
if (url.host() == chrome::kChromeUIDriveInternalsHost)
return &NewWebUI<chromeos::DriveInternalsUI>;
if (url.host() == chrome::kChromeUIImageBurnerHost)
diff --git a/chrome/browser/ui/webui/chromeos/network_ui.cc b/chrome/browser/ui/webui/chromeos/network_ui.cc
index 66df036..cadfb75 100644
--- a/chrome/browser/ui/webui/chromeos/network_ui.cc
+++ b/chrome/browser/ui/webui/chromeos/network_ui.cc
@@ -11,11 +11,11 @@
#include "chrome/browser/extensions/tab_helper.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/generated_resources.h"
-#include "chromeos/device_event_log.h"
#include "chromeos/network/device_state.h"
#include "chromeos/network/network_configuration_handler.h"
#include "chromeos/network/network_state.h"
#include "chromeos/network/network_state_handler.h"
+#include "components/device_event_log/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"
diff --git a/chrome/browser/ui/webui/chromeos/device_log_ui.cc b/chrome/browser/ui/webui/device_log_ui.cc
index cfd47e3..6231da6 100644
--- a/chrome/browser/ui/webui/chromeos/device_log_ui.cc
+++ b/chrome/browser/ui/webui/device_log_ui.cc
@@ -2,7 +2,7 @@
// 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 "chrome/browser/ui/webui/device_log_ui.h"
#include <string>
@@ -10,8 +10,9 @@
#include "base/bind_helpers.h"
#include "base/values.h"
#include "chrome/common/url_constants.h"
+#include "chrome/grit/chromium_strings.h"
#include "chrome/grit/generated_resources.h"
-#include "chromeos/device_event_log.h"
+#include "components/device_event_log/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"
@@ -31,15 +32,14 @@ class DeviceLogMessageHandler : public content::WebUIMessageHandler {
void RegisterMessages() override {
web_ui()->RegisterMessageCallback(
"DeviceLog.getLog",
- base::Bind(&DeviceLogMessageHandler::GetLog,
- base::Unretained(this)));
+ 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));
+ base::StringValue data(device_event_log::GetAsString(
+ device_event_log::NEWEST_FIRST, "json", "",
+ device_event_log::LOG_LEVEL_DEBUG, 0));
web_ui()->CallJavascriptFunction("DeviceLogUI.getLogCallback", data);
}
@@ -78,8 +78,8 @@ DeviceLogUI::DeviceLogUI(content::WebUI* web_ui)
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);
+ content::WebUIDataSource::Add(web_ui->GetWebContents()->GetBrowserContext(),
+ html);
}
DeviceLogUI::~DeviceLogUI() {
diff --git a/chrome/browser/ui/webui/chromeos/device_log_ui.h b/chrome/browser/ui/webui/device_log_ui.h
index 343985b..e08a33d 100644
--- a/chrome/browser/ui/webui/chromeos/device_log_ui.h
+++ b/chrome/browser/ui/webui/device_log_ui.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_UI_WEBUI_CHROMEOS_DEVICE_LOG_UI_H_
-#define CHROME_BROWSER_UI_WEBUI_CHROMEOS_DEVICE_LOG_UI_H_
+#ifndef CHROME_BROWSER_UI_WEBUI_DEVICE_LOG_UI_H_
+#define CHROME_BROWSER_UI_WEBUI_DEVICE_LOG_UI_H_
#include "content/public/browser/web_ui_controller.h"
@@ -20,4 +20,4 @@ class DeviceLogUI : public content::WebUIController {
} // namespace chromeos
-#endif // CHROME_BROWSER_UI_WEBUI_CHROMEOS_DEVICE_LOG_UI_H_
+#endif // CHROME_BROWSER_UI_WEBUI_DEVICE_LOG_UI_H_