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

Unified Diff: content/shell/shell.cc

Issue 10837177: Add a menu item to content_shell to open devtools to make it more discoverable. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix android compile, and add gtk support Created 8 years, 4 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
Index: content/shell/shell.cc
===================================================================
--- content/shell/shell.cc (revision 150609)
+++ content/shell/shell.cc (working copy)
@@ -8,8 +8,10 @@
#include "base/command_line.h"
#include "base/message_loop.h"
#include "base/path_service.h"
+#include "base/string_number_conversions.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
+#include "content/public/browser/devtools_http_handler.h"
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/notification_details.h"
@@ -17,6 +19,9 @@
#include "content/public/browser/notification_types.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
+#include "content/shell/shell_browser_main_parts.h"
+#include "content/shell/shell_content_browser_client.h"
+#include "content/shell/shell_devtools_delegate.h"
#include "content/shell/shell_javascript_dialog_creator.h"
#include "content/shell/shell_messages.h"
#include "content/shell/shell_switches.h"
@@ -151,6 +156,19 @@
PlatformEnableUIControl(STOP_BUTTON, web_contents_->IsLoading());
}
+void Shell::ShowDevTools() {
+ ShellContentBrowserClient* browser_client =
+ static_cast<ShellContentBrowserClient*>(
+ GetContentClient()->browser());
+ ShellDevToolsDelegate* delegate =
+ browser_client->shell_browser_main_parts()->devtools_delegate();
+ GURL url = delegate->devtools_http_handler()->GetFrontendURL(
+ web_contents()->GetRenderViewHost());
+ CreateNewWindow(
+ web_contents()->GetBrowserContext(),
+ url, NULL, MSG_ROUTING_NONE, NULL);
+}
+
gfx::NativeView Shell::GetContentView() {
if (!web_contents_.get())
return NULL;

Powered by Google App Engine
This is Rietveld 408576698