blob: 646ea4bbdce65c1b4d0250d796b2b42dda1ddc79 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_FRONTEND_HOST_H_
#define CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_FRONTEND_HOST_H_
#include <string>
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "content/public/browser/devtools_client_host.h"
#include "content/public/browser/web_contents_observer.h"
namespace content {
class DevToolsFrontendHostDelegate;
class WebContentsImpl;
// This class handles messages from DevToolsClient and calls corresponding
// methods on DevToolsFrontendHostDelegate which is implemented by the
// embedder. This allows us to avoid exposing DevTools client messages through
// the content public API.
class DevToolsFrontendHost : public DevToolsClientHost,
public WebContentsObserver {
public:
DevToolsFrontendHost(WebContentsImpl* web_contents,
DevToolsFrontendHostDelegate* delegate);
private:
virtual ~DevToolsFrontendHost();
// DevToolsClientHost implementation.
virtual void DispatchOnInspectorFrontend(const std::string& message) OVERRIDE;
virtual void InspectedContentsClosing() OVERRIDE;
virtual void ReplacedWithAnotherClient() OVERRIDE;
// WebContentsObserver overrides.
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
virtual void RenderProcessGone(base::TerminationStatus status) OVERRIDE;
void OnDispatchOnInspectorBackend(const std::string& message);
void OnActivateWindow();
void OnChangeAttachedWindowHeight(unsigned height);
void OnCloseWindow();
void OnMoveWindow(int x, int y);
void OnRequestSetDockSide(const std::string& side);
void OnOpenInNewTab(const std::string& url);
void OnSave(const std::string& url, const std::string& content, bool save_as);
void OnAppend(const std::string& url, const std::string& content);
void OnRequestFileSystems();
void OnAddFileSystem();
void OnRemoveFileSystem(const std::string& file_system_path);
void OnIndexPath(int request_id, const std::string& file_system_path);
void OnStopIndexing(int request_id);
void OnSearchInPath(int request_id,
const std::string& file_system_path,
const std::string& query);
DevToolsFrontendHostDelegate* delegate_;
DISALLOW_COPY_AND_ASSIGN(DevToolsFrontendHost);
};
} // namespace content
#endif // CONTENT_BROWSER_DEVTOOLS_DEVTOOLS_FRONTEND_HOST_H_
|