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

Side by Side Diff: content/shell/browser/shell_devtools_frontend.cc

Issue 31043002: Make content shell activate and focus dev tools on show. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 2 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
« no previous file with comments | « content/shell/browser/shell_devtools_frontend.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/shell/browser/shell_devtools_frontend.h" 5 #include "content/shell/browser/shell_devtools_frontend.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "content/public/browser/devtools_http_handler.h" 9 #include "content/public/browser/devtools_http_handler.h"
10 #include "content/public/browser/devtools_manager.h" 10 #include "content/public/browser/devtools_manager.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 DevToolsAgentHost::GetOrCreateFor(inspected_contents->GetRenderViewHost()) 56 DevToolsAgentHost::GetOrCreateFor(inspected_contents->GetRenderViewHost())
57 .get()); 57 .get());
58 58
59 ShellDevToolsDelegate* delegate = ShellContentBrowserClient::Get()-> 59 ShellDevToolsDelegate* delegate = ShellContentBrowserClient::Get()->
60 shell_browser_main_parts()->devtools_delegate(); 60 shell_browser_main_parts()->devtools_delegate();
61 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree)) 61 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDumpRenderTree))
62 shell->LoadURL(GetDevToolsPathAsURL()); 62 shell->LoadURL(GetDevToolsPathAsURL());
63 else 63 else
64 shell->LoadURL(delegate->devtools_http_handler()->GetFrontendURL()); 64 shell->LoadURL(delegate->devtools_http_handler()->GetFrontendURL());
65 65
66 devtools_frontend->Activate();
67 devtools_frontend->Focus();
68
66 return devtools_frontend; 69 return devtools_frontend;
67 } 70 }
68 71
72 void ShellDevToolsFrontend::Activate() {
73 frontend_shell_->ActivateContents(web_contents());
74 }
75
69 void ShellDevToolsFrontend::Focus() { 76 void ShellDevToolsFrontend::Focus() {
70 web_contents()->GetView()->Focus(); 77 web_contents()->GetView()->Focus();
71 } 78 }
72 79
73 void ShellDevToolsFrontend::Close() { 80 void ShellDevToolsFrontend::Close() {
74 frontend_shell_->Close(); 81 frontend_shell_->Close();
75 } 82 }
76 83
77 ShellDevToolsFrontend::ShellDevToolsFrontend(Shell* frontend_shell, 84 ShellDevToolsFrontend::ShellDevToolsFrontend(Shell* frontend_shell,
78 DevToolsAgentHost* agent_host) 85 DevToolsAgentHost* agent_host)
(...skipping 19 matching lines...) Expand all
98 void ShellDevToolsFrontend::WebContentsDestroyed(WebContents* web_contents) { 105 void ShellDevToolsFrontend::WebContentsDestroyed(WebContents* web_contents) {
99 DevToolsManager::GetInstance()->ClientHostClosing(frontend_host_.get()); 106 DevToolsManager::GetInstance()->ClientHostClosing(frontend_host_.get());
100 delete this; 107 delete this;
101 } 108 }
102 109
103 void ShellDevToolsFrontend::InspectedContentsClosing() { 110 void ShellDevToolsFrontend::InspectedContentsClosing() {
104 frontend_shell_->Close(); 111 frontend_shell_->Close();
105 } 112 }
106 113
107 } // namespace content 114 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/browser/shell_devtools_frontend.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698