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

Side by Side Diff: chrome/browser/ui/webui/net_internals_ui.cc

Issue 9003014: Replace WebUI::tab_contents() with web_contents() and switch all users to use web_contents.h inst... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/ui/webui/net_internals_ui.h" 5 #include "chrome/browser/ui/webui/net_internals_ui.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <list> 8 #include <list>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 #ifdef OS_CHROMEOS 67 #ifdef OS_CHROMEOS
68 #include "chrome/browser/chromeos/cros/cros_library.h" 68 #include "chrome/browser/chromeos/cros/cros_library.h"
69 #include "chrome/browser/chromeos/cros/network_library.h" 69 #include "chrome/browser/chromeos/cros/network_library.h"
70 #include "chrome/browser/chromeos/system/syslogs_provider.h" 70 #include "chrome/browser/chromeos/system/syslogs_provider.h"
71 #endif 71 #endif
72 #ifdef OS_WIN 72 #ifdef OS_WIN
73 #include "chrome/browser/net/service_providers_win.h" 73 #include "chrome/browser/net/service_providers_win.h"
74 #endif 74 #endif
75 75
76 using content::BrowserThread; 76 using content::BrowserThread;
77 using content::WebContents;
77 78
78 namespace { 79 namespace {
79 80
80 // Delay between when an event occurs and when it is passed to the Javascript 81 // Delay between when an event occurs and when it is passed to the Javascript
81 // page. All events that occur during this period are grouped together and 82 // page. All events that occur during this period are grouped together and
82 // sent to the page at once, which reduces context switching and CPU usage. 83 // sent to the page at once, which reduces context switching and CPU usage.
83 const int kNetLogEventDelayMilliseconds = 100; 84 const int kNetLogEventDelayMilliseconds = 100;
84 85
85 // about:net-internals will not even attempt to load a log dump when it 86 // about:net-internals will not even attempt to load a log dump when it
86 // encounters a new version. This should be incremented when significant 87 // encounters a new version. This should be incremented when significant
(...skipping 1532 matching lines...) Expand 10 before | Expand all | Expand 10 after
1619 const int64 kUnixEpochMs = 11644473600000LL; 1620 const int64 kUnixEpochMs = 11644473600000LL;
1620 int64 tick_to_unix_time_ms = tick_to_time_ms - kUnixEpochMs; 1621 int64 tick_to_unix_time_ms = tick_to_time_ms - kUnixEpochMs;
1621 1622
1622 // Pass it as a string, since it may be too large to fit in an integer. 1623 // Pass it as a string, since it may be too large to fit in an integer.
1623 constants_dict->SetString("timeTickOffset", 1624 constants_dict->SetString("timeTickOffset",
1624 base::Int64ToString(tick_to_unix_time_ms)); 1625 base::Int64ToString(tick_to_unix_time_ms));
1625 } 1626 }
1626 return constants_dict; 1627 return constants_dict;
1627 } 1628 }
1628 1629
1629 NetInternalsUI::NetInternalsUI(TabContents* contents) : ChromeWebUI(contents) { 1630 NetInternalsUI::NetInternalsUI(WebContents* contents) : ChromeWebUI(contents) {
1630 AddMessageHandler(new NetInternalsMessageHandler()); 1631 AddMessageHandler(new NetInternalsMessageHandler());
1631 1632
1632 // Set up the chrome://net-internals/ source. 1633 // Set up the chrome://net-internals/ source.
1633 GetProfile()->GetChromeURLDataManager()->AddDataSource( 1634 GetProfile()->GetChromeURLDataManager()->AddDataSource(
1634 CreateNetInternalsHTMLSource()); 1635 CreateNetInternalsHTMLSource());
1635 } 1636 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/net_internals_ui.h ('k') | chrome/browser/ui/webui/ntp/app_launcher_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698