OLD | NEW |
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_delegate.h" | 5 #include "content/shell/browser/shell_devtools_delegate.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 Target::Target(WebContents* web_contents) { | 106 Target::Target(WebContents* web_contents) { |
107 agent_host_ = | 107 agent_host_ = |
108 DevToolsAgentHost::GetOrCreateFor(web_contents->GetRenderViewHost()); | 108 DevToolsAgentHost::GetOrCreateFor(web_contents->GetRenderViewHost()); |
109 id_ = agent_host_->GetId(); | 109 id_ = agent_host_->GetId(); |
110 title_ = base::UTF16ToUTF8(web_contents->GetTitle()); | 110 title_ = base::UTF16ToUTF8(web_contents->GetTitle()); |
111 url_ = web_contents->GetURL(); | 111 url_ = web_contents->GetURL(); |
112 content::NavigationController& controller = web_contents->GetController(); | 112 content::NavigationController& controller = web_contents->GetController(); |
113 content::NavigationEntry* entry = controller.GetActiveEntry(); | 113 content::NavigationEntry* entry = controller.GetActiveEntry(); |
114 if (entry != NULL && entry->GetURL().is_valid()) | 114 if (entry != NULL && entry->GetURL().is_valid()) |
115 favicon_url_ = entry->GetFavicon().url; | 115 favicon_url_ = entry->GetFavicon().url; |
116 last_activity_time_ = web_contents->GetLastSelectedTime(); | 116 last_activity_time_ = web_contents->GetLastActiveTime(); |
117 } | 117 } |
118 | 118 |
119 bool Target::Activate() const { | 119 bool Target::Activate() const { |
120 RenderViewHost* rvh = agent_host_->GetRenderViewHost(); | 120 RenderViewHost* rvh = agent_host_->GetRenderViewHost(); |
121 if (!rvh) | 121 if (!rvh) |
122 return false; | 122 return false; |
123 WebContents* web_contents = WebContents::FromRenderViewHost(rvh); | 123 WebContents* web_contents = WebContents::FromRenderViewHost(rvh); |
124 if (!web_contents) | 124 if (!web_contents) |
125 return false; | 125 return false; |
126 web_contents->GetDelegate()->ActivateContents(web_contents); | 126 web_contents->GetDelegate()->ActivateContents(web_contents); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 } | 207 } |
208 | 208 |
209 scoped_ptr<net::StreamListenSocket> | 209 scoped_ptr<net::StreamListenSocket> |
210 ShellDevToolsDelegate::CreateSocketForTethering( | 210 ShellDevToolsDelegate::CreateSocketForTethering( |
211 net::StreamListenSocket::Delegate* delegate, | 211 net::StreamListenSocket::Delegate* delegate, |
212 std::string* name) { | 212 std::string* name) { |
213 return scoped_ptr<net::StreamListenSocket>(); | 213 return scoped_ptr<net::StreamListenSocket>(); |
214 } | 214 } |
215 | 215 |
216 } // namespace content | 216 } // namespace content |
OLD | NEW |