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

Side by Side Diff: chrome/browser/ui/webui/chromeos/network_ui.cc

Issue 773703002: Generalize network_event_log -> device_event_log (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/chromeos/network_ui.h" 5 #include "chrome/browser/ui/webui/chromeos/network_ui.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 22 matching lines...) Expand all
33 // WebUIMessageHandler implementation. 33 // WebUIMessageHandler implementation.
34 virtual void RegisterMessages() override { 34 virtual void RegisterMessages() override {
35 web_ui()->RegisterMessageCallback( 35 web_ui()->RegisterMessageCallback(
36 "NetworkUI.getNetworkLog", 36 "NetworkUI.getNetworkLog",
37 base::Bind(&NetworkUIMessageHandler::GetNetworkLog, 37 base::Bind(&NetworkUIMessageHandler::GetNetworkLog,
38 base::Unretained(this))); 38 base::Unretained(this)));
39 } 39 }
40 40
41 private: 41 private:
42 void GetNetworkLog(const base::ListValue* value) const { 42 void GetNetworkLog(const base::ListValue* value) const {
43 base::StringValue data(chromeos::network_event_log::GetAsString( 43 base::StringValue data(chromeos::device_event_log::GetAsString(
44 chromeos::network_event_log::NEWEST_FIRST, 44 chromeos::device_event_log::NEWEST_FIRST,
45 "json", 45 "json",
46 chromeos::network_event_log::LOG_LEVEL_DEBUG, 46 device_event_log::LOG_TYPE_NETWORK,
47 chromeos::device_event_log::LOG_LEVEL_DEBUG,
47 kMaxLogEvents)); 48 kMaxLogEvents));
48 web_ui()->CallJavascriptFunction("NetworkUI.getNetworkLogCallback", data); 49 web_ui()->CallJavascriptFunction("NetworkUI.getNetworkLogCallback", data);
49 } 50 }
50 51
51 DISALLOW_COPY_AND_ASSIGN(NetworkUIMessageHandler); 52 DISALLOW_COPY_AND_ASSIGN(NetworkUIMessageHandler);
52 }; 53 };
53 54
54 } // namespace 55 } // namespace
55 56
56 NetworkUI::NetworkUI(content::WebUI* web_ui) 57 NetworkUI::NetworkUI(content::WebUI* web_ui)
(...skipping 24 matching lines...) Expand all
81 html->SetDefaultResource(IDR_NETWORK_UI_HTML); 82 html->SetDefaultResource(IDR_NETWORK_UI_HTML);
82 83
83 content::WebUIDataSource::Add( 84 content::WebUIDataSource::Add(
84 web_ui->GetWebContents()->GetBrowserContext(), html); 85 web_ui->GetWebContents()->GetBrowserContext(), html);
85 } 86 }
86 87
87 NetworkUI::~NetworkUI() { 88 NetworkUI::~NetworkUI() {
88 } 89 }
89 90
90 } // namespace chromeos 91 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698