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

Side by Side Diff: chromecast/shell/browser/devtools/cast_dev_tools_delegate.cc

Issue 560323005: [DevTools] Move target-related methods from DevToolsHttpHandlerDelegate to DevToolsManagerDelegate. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "chromecast/shell/browser/devtools/cast_dev_tools_delegate.h" 5 #include "chromecast/shell/browser/devtools/cast_dev_tools_delegate.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "content/public/browser/devtools_agent_host.h" 10 #include "content/public/browser/devtools_agent_host.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 content::NavigationController& controller = web_contents->GetController(); 85 content::NavigationController& controller = web_contents->GetController();
86 content::NavigationEntry* entry = controller.GetActiveEntry(); 86 content::NavigationEntry* entry = controller.GetActiveEntry();
87 if (entry != NULL && entry->GetURL().is_valid()) 87 if (entry != NULL && entry->GetURL().is_valid())
88 favicon_url_ = entry->GetFavicon().url; 88 favicon_url_ = entry->GetFavicon().url;
89 last_activity_time_ = web_contents->GetLastActiveTime(); 89 last_activity_time_ = web_contents->GetLastActiveTime();
90 } 90 }
91 } 91 }
92 92
93 } // namespace 93 } // namespace
94 94
95 // CastDevToolsDelegate -----------------------------------------------------
96
95 CastDevToolsDelegate::CastDevToolsDelegate() { 97 CastDevToolsDelegate::CastDevToolsDelegate() {
96 } 98 }
97 99
98 CastDevToolsDelegate::~CastDevToolsDelegate() { 100 CastDevToolsDelegate::~CastDevToolsDelegate() {
99 } 101 }
100 102
101 std::string CastDevToolsDelegate::GetDiscoveryPageHTML() { 103 std::string CastDevToolsDelegate::GetDiscoveryPageHTML() {
102 return ResourceBundle::GetSharedInstance().GetRawDataResource( 104 return ResourceBundle::GetSharedInstance().GetRawDataResource(
103 IDR_CAST_SHELL_DEVTOOLS_DISCOVERY_PAGE).as_string(); 105 IDR_CAST_SHELL_DEVTOOLS_DISCOVERY_PAGE).as_string();
104 } 106 }
105 107
106 bool CastDevToolsDelegate::BundlesFrontendResources() { 108 bool CastDevToolsDelegate::BundlesFrontendResources() {
107 return true; 109 return true;
108 } 110 }
109 111
110 base::FilePath CastDevToolsDelegate::GetDebugFrontendDir() { 112 base::FilePath CastDevToolsDelegate::GetDebugFrontendDir() {
111 return base::FilePath(); 113 return base::FilePath();
112 } 114 }
113 115
114 std::string CastDevToolsDelegate::GetPageThumbnailData(const GURL& url) { 116 scoped_ptr<net::StreamListenSocket>
117 CastDevToolsDelegate::CreateSocketForTethering(
118 net::StreamListenSocket::Delegate* delegate,
119 std::string* name) {
120 return scoped_ptr<net::StreamListenSocket>();
121 }
122
123 // CastDevToolsManagerDelegate -----------------------------------------------
124
125 CastDevToolsManagerDelegate::CastDevToolsManagerDelegate() {
126 }
127
128 CastDevToolsManagerDelegate::~CastDevToolsManagerDelegate() {
129 }
130
131 base::DictionaryValue* CastDevToolsManagerDelegate::HandleCommand(
132 content::DevToolsAgentHost* agent_host,
133 base::DictionaryValue* command) {
134 return NULL;
135 }
136
137 std::string CastDevToolsManagerDelegate::GetPageThumbnailData(
138 const GURL& url) {
115 return ""; 139 return "";
116 } 140 }
117 141
118 scoped_ptr<content::DevToolsTarget> CastDevToolsDelegate::CreateNewTarget( 142 scoped_ptr<content::DevToolsTarget>
119 const GURL& url) { 143 CastDevToolsManagerDelegate::CreateNewTarget(const GURL& url) {
120 return scoped_ptr<content::DevToolsTarget>(); 144 return scoped_ptr<content::DevToolsTarget>();
121 } 145 }
122 146
123 void CastDevToolsDelegate::EnumerateTargets(TargetCallback callback) { 147 void CastDevToolsManagerDelegate::EnumerateTargets(TargetCallback callback) {
124 TargetList targets; 148 TargetList targets;
125 content::DevToolsAgentHost::List agents = 149 content::DevToolsAgentHost::List agents =
126 content::DevToolsAgentHost::GetOrCreateAll(); 150 content::DevToolsAgentHost::GetOrCreateAll();
127 for (content::DevToolsAgentHost::List::iterator it = agents.begin(); 151 for (content::DevToolsAgentHost::List::iterator it = agents.begin();
128 it != agents.end(); ++it) { 152 it != agents.end(); ++it) {
129 targets.push_back(new Target(*it)); 153 targets.push_back(new Target(*it));
130 } 154 }
131 callback.Run(targets); 155 callback.Run(targets);
132 } 156 }
133 157
134 scoped_ptr<net::StreamListenSocket>
135 CastDevToolsDelegate::CreateSocketForTethering(
136 net::StreamListenSocket::Delegate* delegate,
137 std::string* name) {
138 return scoped_ptr<net::StreamListenSocket>();
139 }
140
141 } // namespace shell 158 } // namespace shell
142 } // namespace chromecast 159 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/shell/browser/devtools/cast_dev_tools_delegate.h ('k') | content/browser/devtools/devtools_http_handler_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698