Index: chrome/browser/ui/webui/instant_ui.cc |
diff --git a/chrome/browser/ui/webui/instant_ui.cc b/chrome/browser/ui/webui/instant_ui.cc |
index 8a609208f199761219eec47c7d803c8548635a45..7008a227ae12da4003dc8692fafaeb047e5f5834 100644 |
--- a/chrome/browser/ui/webui/instant_ui.cc |
+++ b/chrome/browser/ui/webui/instant_ui.cc |
@@ -58,6 +58,7 @@ class InstantUIMessageHandler |
void GetPreferenceValue(const base::ListValue* args); |
void SetPreferenceValue(const base::ListValue* args); |
void GetDebugInfo(const base::ListValue* value); |
+ void ClearDebugInfo(const base::ListValue* value); |
DISALLOW_COPY_AND_ASSIGN(InstantUIMessageHandler); |
}; |
@@ -79,6 +80,10 @@ void InstantUIMessageHandler::RegisterMessages() { |
"getDebugInfo", |
base::Bind(&InstantUIMessageHandler::GetDebugInfo, |
base::Unretained(this))); |
+ web_ui()->RegisterMessageCallback( |
+ "clearDebugInfo", |
+ base::Bind(&InstantUIMessageHandler::ClearDebugInfo, |
+ base::Unretained(this))); |
} |
void InstantUIMessageHandler::GetPreferenceValue(const base::ListValue* args) { |
@@ -136,6 +141,19 @@ void InstantUIMessageHandler::GetDebugInfo(const base::ListValue* args) { |
#endif |
} |
+void InstantUIMessageHandler::ClearDebugInfo(const base::ListValue* args) { |
+#if !defined(OS_ANDROID) |
+ if (!web_ui()->GetWebContents()) |
+ return; |
+ Browser* browser = chrome::FindBrowserWithWebContents( |
+ web_ui()->GetWebContents()); |
+ if (!browser || !browser->instant_controller()) |
+ return; |
+ |
+ browser->instant_controller()->instant()->ClearDebugEvents(); |
+#endif |
+} |
+ |
} // namespace |
//////////////////////////////////////////////////////////////////////////////// |