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

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

Issue 2620153002: Fix front-end host creation upon navigation (Closed)
Patch Set: Created 3 years, 11 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 #ifndef CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_HOST_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_HOST_H_
6 #define CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_HOST_H_ 6 #define CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_HOST_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
11 #include "base/strings/string_piece.h" 11 #include "base/strings/string_piece.h"
12 #include "content/common/content_export.h" 12 #include "content/common/content_export.h"
13 13
14 namespace content { 14 namespace content {
15 15
16 class RenderFrameHost; 16 class WebContents;
17 17
18 // This class dispatches messages between DevTools frontend and Delegate 18 // This class dispatches messages between DevTools frontend and Delegate
19 // which is implemented by the embedder. 19 // which is implemented by the embedder.
20 // This allows us to avoid exposing DevTools frontend messages through 20 // This allows us to avoid exposing DevTools frontend messages through
21 // the content public API. 21 // the content public API.
22 class DevToolsFrontendHost { 22 class DevToolsFrontendHost {
23 public: 23 public:
24 using HandleMessageCallback = base::Callback<void(const std::string&)>; 24 using HandleMessageCallback = base::Callback<void(const std::string&)>;
25 25
26 // Creates a new DevToolsFrontendHost for RenderFrameHost where DevTools 26 // Creates a new DevToolsFrontendHost for RenderFrameHost where DevTools
27 // frontend is loaded. 27 // frontend is loaded.
28 CONTENT_EXPORT static DevToolsFrontendHost* Create( 28 CONTENT_EXPORT static DevToolsFrontendHost* Create(
29 RenderFrameHost* frontend_main_frame, 29 WebContents* web_contents,
30 const HandleMessageCallback& handle_message_callback); 30 const HandleMessageCallback& handle_message_callback);
31 31
32 CONTENT_EXPORT virtual ~DevToolsFrontendHost() {} 32 CONTENT_EXPORT virtual ~DevToolsFrontendHost() {}
33 33
34 CONTENT_EXPORT virtual void BadMessageRecieved() {} 34 CONTENT_EXPORT virtual void BadMessageRecieved() {}
35 35
36 // Returns bundled DevTools frontend resource by |path|. Returns empty string 36 // Returns bundled DevTools frontend resource by |path|. Returns empty string
37 // if |path| does not correspond to any frontend resource. 37 // if |path| does not correspond to any frontend resource.
38 CONTENT_EXPORT static base::StringPiece GetFrontendResource( 38 CONTENT_EXPORT static base::StringPiece GetFrontendResource(
39 const std::string& path); 39 const std::string& path);
40 }; 40 };
41 41
42 } // namespace content 42 } // namespace content
43 43
44 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_HOST_H_ 44 #endif // CONTENT_PUBLIC_BROWSER_DEVTOOLS_FRONTEND_HOST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698