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

Unified Diff: chrome/browser/ui/webui/net_internals/net_internals_ui.cc

Issue 10185003: Remove net-internals page for throttling, introduce flag for extension devs instead. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix JavaScript presubmit. Created 8 years, 8 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/resources/net_internals/main.js ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/net_internals/net_internals_ui.cc
diff --git a/chrome/browser/ui/webui/net_internals/net_internals_ui.cc b/chrome/browser/ui/webui/net_internals/net_internals_ui.cc
index a371ec2df7687deab2bded61cba5e4263bcf5c42..e15c8599b06f961dd8ba02c87b2184b392414fea 100644
--- a/chrome/browser/ui/webui/net_internals/net_internals_ui.cc
+++ b/chrome/browser/ui/webui/net_internals/net_internals_ui.cc
@@ -246,8 +246,7 @@ void StoreDebugLogs(const StoreDebugLogsCallback& callback) {
// TODO(eroman): Can we start on the IO thread to begin with?
class NetInternalsMessageHandler
: public WebUIMessageHandler,
- public base::SupportsWeakPtr<NetInternalsMessageHandler>,
- public content::NotificationObserver {
+ public base::SupportsWeakPtr<NetInternalsMessageHandler> {
public:
NetInternalsMessageHandler();
virtual ~NetInternalsMessageHandler();
@@ -260,14 +259,8 @@ class NetInternalsMessageHandler
// message will be ignored.
void SendJavascriptCommand(const std::string& command, Value* arg);
- // content::NotificationObserver implementation.
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
-
// Javascript message handlers.
void OnRendererReady(const ListValue* list);
- void OnEnableHttpThrottling(const ListValue* list);
void OnClearBrowserCache(const ListValue* list);
void OnGetPrerenderInfo(const ListValue* list);
#ifdef OS_CHROMEOS
@@ -339,10 +332,6 @@ class NetInternalsMessageHandler
};
#endif
- // The pref member about whether HTTP throttling is enabled, which needs to
- // be accessed on the UI thread.
- BooleanPrefMember http_throttling_enabled_;
-
// This is the "real" message handler, which lives on the IO thread.
scoped_refptr<IOThreadImpl> proxy_;
@@ -513,9 +502,6 @@ void NetInternalsMessageHandler::RegisterMessages() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
Profile* profile = Profile::FromWebUI(web_ui());
- PrefService* pref_service = profile->GetPrefs();
- http_throttling_enabled_.Init(
- prefs::kHttpThrottlingEnabled, pref_service, this);
proxy_ = new IOThreadImpl(this->AsWeakPtr(), g_browser_process->io_thread(),
profile->GetRequestContext());
@@ -624,10 +610,6 @@ void NetInternalsMessageHandler::RegisterMessages() {
base::Bind(&IOThreadImpl::CallbackHelper,
&IOThreadImpl::OnSetLogLevel, proxy_));
web_ui()->RegisterMessageCallback(
- "enableHttpThrottling",
- base::Bind(&NetInternalsMessageHandler::OnEnableHttpThrottling,
- base::Unretained(this)));
- web_ui()->RegisterMessageCallback(
"clearBrowserCache",
base::Bind(&NetInternalsMessageHandler::OnClearBrowserCache,
base::Unretained(this)));
@@ -675,39 +657,8 @@ void NetInternalsMessageHandler::SendJavascriptCommand(
}
}
-void NetInternalsMessageHandler::Observe(
- int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- DCHECK_EQ(type, chrome::NOTIFICATION_PREF_CHANGED);
-
- std::string* pref_name = content::Details<std::string>(details).ptr();
- if (*pref_name == prefs::kHttpThrottlingEnabled) {
- SendJavascriptCommand(
- "receivedHttpThrottlingEnabledPrefChanged",
- Value::CreateBooleanValue(*http_throttling_enabled_));
- }
-}
-
void NetInternalsMessageHandler::OnRendererReady(const ListValue* list) {
IOThreadImpl::CallbackHelper(&IOThreadImpl::OnRendererReady, proxy_, list);
-
- SendJavascriptCommand(
- "receivedHttpThrottlingEnabledPrefChanged",
- Value::CreateBooleanValue(*http_throttling_enabled_));
-}
-
-void NetInternalsMessageHandler::OnEnableHttpThrottling(const ListValue* list) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
-
- bool enable = false;
- if (!list->GetBoolean(0, &enable)) {
- NOTREACHED();
- return;
- }
-
- http_throttling_enabled_.SetValue(enable);
}
void NetInternalsMessageHandler::OnClearBrowserCache(const ListValue* list) {
« no previous file with comments | « chrome/browser/resources/net_internals/main.js ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698