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

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

Issue 8986007: Move WebUIMessageHandler to its own file in the public directory and put it in the content namesp... (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 25 matching lines...) Expand all
36 #include "chrome/browser/profiles/profile.h" 36 #include "chrome/browser/profiles/profile.h"
37 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" 37 #include "chrome/browser/ui/webui/chrome_url_data_manager.h"
38 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" 38 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h"
39 #include "chrome/common/chrome_notification_types.h" 39 #include "chrome/common/chrome_notification_types.h"
40 #include "chrome/common/chrome_paths.h" 40 #include "chrome/common/chrome_paths.h"
41 #include "chrome/common/chrome_version_info.h" 41 #include "chrome/common/chrome_version_info.h"
42 #include "chrome/common/pref_names.h" 42 #include "chrome/common/pref_names.h"
43 #include "chrome/common/url_constants.h" 43 #include "chrome/common/url_constants.h"
44 #include "content/public/browser/browser_thread.h" 44 #include "content/public/browser/browser_thread.h"
45 #include "content/public/browser/notification_details.h" 45 #include "content/public/browser/notification_details.h"
46 #include "content/public/browser/web_ui_message_handler.h"
46 #include "grit/generated_resources.h" 47 #include "grit/generated_resources.h"
47 #include "grit/net_internals_resources.h" 48 #include "grit/net_internals_resources.h"
48 #include "net/base/escape.h" 49 #include "net/base/escape.h"
49 #include "net/base/host_cache.h" 50 #include "net/base/host_cache.h"
50 #include "net/base/host_resolver.h" 51 #include "net/base/host_resolver.h"
51 #include "net/base/net_errors.h" 52 #include "net/base/net_errors.h"
52 #include "net/base/net_util.h" 53 #include "net/base/net_util.h"
53 #include "net/base/sys_addrinfo.h" 54 #include "net/base/sys_addrinfo.h"
54 #include "net/base/x509_cert_types.h" 55 #include "net/base/x509_cert_types.h"
55 #include "net/disk_cache/disk_cache.h" 56 #include "net/disk_cache/disk_cache.h"
(...skipping 12 matching lines...) Expand all
68 #include "chrome/browser/chromeos/cros/cros_library.h" 69 #include "chrome/browser/chromeos/cros/cros_library.h"
69 #include "chrome/browser/chromeos/cros/network_library.h" 70 #include "chrome/browser/chromeos/cros/network_library.h"
70 #include "chrome/browser/chromeos/system/syslogs_provider.h" 71 #include "chrome/browser/chromeos/system/syslogs_provider.h"
71 #endif 72 #endif
72 #ifdef OS_WIN 73 #ifdef OS_WIN
73 #include "chrome/browser/net/service_providers_win.h" 74 #include "chrome/browser/net/service_providers_win.h"
74 #endif 75 #endif
75 76
76 using content::BrowserThread; 77 using content::BrowserThread;
77 using content::WebContents; 78 using content::WebContents;
79 using content::WebUIMessageHandler;
78 80
79 namespace { 81 namespace {
80 82
81 // Delay between when an event occurs and when it is passed to the Javascript 83 // Delay between when an event occurs and when it is passed to the Javascript
82 // page. All events that occur during this period are grouped together and 84 // page. All events that occur during this period are grouped together and
83 // sent to the page at once, which reduces context switching and CPU usage. 85 // sent to the page at once, which reduces context switching and CPU usage.
84 const int kNetLogEventDelayMilliseconds = 100; 86 const int kNetLogEventDelayMilliseconds = 100;
85 87
86 // about:net-internals will not even attempt to load a log dump when it 88 // about:net-internals will not even attempt to load a log dump when it
87 // encounters a new version. This should be incremented when significant 89 // encounters a new version. This should be incremented when significant
(...skipping 1539 matching lines...) Expand 10 before | Expand all | Expand 10 after
1627 return constants_dict; 1629 return constants_dict;
1628 } 1630 }
1629 1631
1630 NetInternalsUI::NetInternalsUI(WebContents* contents) : ChromeWebUI(contents) { 1632 NetInternalsUI::NetInternalsUI(WebContents* contents) : ChromeWebUI(contents) {
1631 AddMessageHandler(new NetInternalsMessageHandler()); 1633 AddMessageHandler(new NetInternalsMessageHandler());
1632 1634
1633 // Set up the chrome://net-internals/ source. 1635 // Set up the chrome://net-internals/ source.
1634 GetProfile()->GetChromeURLDataManager()->AddDataSource( 1636 GetProfile()->GetChromeURLDataManager()->AddDataSource(
1635 CreateNetInternalsHTMLSource()); 1637 CreateNetInternalsHTMLSource());
1636 } 1638 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/metrics_handler.cc ('k') | chrome/browser/ui/webui/net_internals_ui_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698