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

Side by Side Diff: content/public/browser/devtools_frontend_host.h

Issue 427143003: [DevTools] Move DevToolsClientHost functionality out of DevToolsFrontendHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_HOST_H_
6 #define CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_HOST_H_
7
8 #include <string>
9
10 #include "content/common/content_export.h"
11 #include "url/gurl.h"
12
13 namespace content {
14
15 class WebContents;
16
17 // This class dispatches messages between DevTools frontend and Delegate
18 // which is implemented by the embedder.
19 // This allows us to avoid exposing DevTools frontend messages through
20 // the content public API.
21 class DevToolsFrontendHost {
22 public:
23 // Delegate actually handles messages from frontend.
24 class Delegate {
25 public:
26 virtual ~Delegate() {}
27
28 // When navigation happens in DevTools frontend WebContents, delegate
29 // decides on whether new page is DevTools frontend.
30 virtual bool ShouldSetupDevToolsFrontendForUrl(const GURL& url) = 0;
31
32 // Message is coming from frontend to the embedder.
33 virtual void HandleMessageFromDevToolsFrontend(
34 const std::string& message) = 0;
35
36 // Message is coming from frontend to the backend.
37 // TODO(dgozman): make this to be one of the possible messages to embedder.
38 virtual void HandleMessageFromDevToolsFrontendToBackend(
39 const std::string& message) = 0;
40 };
41
42 // Creates a new DevToolsFrontendHost for WebContents where DevTools
43 // frontend is loaded.
44 CONTENT_EXPORT static DevToolsFrontendHost* Create(
45 WebContents* frontend_web_contents, Delegate* delegate);
46
47 CONTENT_EXPORT virtual ~DevToolsFrontendHost() {}
48
49 // Dispatches message from embedder/backend to frontend.
50 // TODO(dgozman): remove and make embedder to take care of this.
51 CONTENT_EXPORT virtual void DispatchOnDevToolsFrontend(
52 const std::string& message) = 0;
53 };
54
55 } // namespace content
56
57 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698