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

Side by Side Diff: chrome/test/chromedriver/web_view_impl.h

Issue 12848005: [chromedriver] Separate stuff of chrome from chromedriver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments and fix compile error on mac. Created 7 years, 9 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
« no previous file with comments | « chrome/test/chromedriver/web_view_delegate.h ('k') | chrome/test/chromedriver/web_view_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2013 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 CHROME_TEST_CHROMEDRIVER_WEB_VIEW_IMPL_H_
6 #define CHROME_TEST_CHROMEDRIVER_WEB_VIEW_IMPL_H_
7
8 #include <list>
9 #include <string>
10
11 #include "base/callback.h"
12 #include "base/compiler_specific.h"
13 #include "base/memory/scoped_ptr.h"
14 #include "chrome/test/chromedriver/web_view.h"
15
16 namespace base {
17 class DictionaryValue;
18 class ListValue;
19 class Value;
20 }
21
22 class DevToolsClient;
23 class DomTracker;
24 class FrameTracker;
25 struct KeyEvent;
26 struct MouseEvent;
27 class NavigationTracker;
28 class Status;
29 class WebViewDelegate;
30
31 class WebViewImpl : public WebView {
32 public:
33 typedef base::Callback<Status()> CloserFunc;
34 // Takes ownership of |client|.
35 WebViewImpl(const std::string& id,
36 DevToolsClient* client,
37 WebViewDelegate* delegate,
38 const CloserFunc& closer_func);
39 virtual ~WebViewImpl();
40
41 // Overridden from WebView:
42 virtual std::string GetId() OVERRIDE;
43 virtual Status ConnectIfNecessary() OVERRIDE;
44 virtual Status Close() OVERRIDE;
45 virtual Status Load(const std::string& url) OVERRIDE;
46 virtual Status Reload() OVERRIDE;
47 virtual Status EvaluateScript(const std::string& frame,
48 const std::string& expression,
49 scoped_ptr<base::Value>* result) OVERRIDE;
50 virtual Status CallFunction(const std::string& frame,
51 const std::string& function,
52 const base::ListValue& args,
53 scoped_ptr<base::Value>* result) OVERRIDE;
54 virtual Status GetFrameByFunction(const std::string& frame,
55 const std::string& function,
56 const base::ListValue& args,
57 std::string* out_frame) OVERRIDE;
58 virtual Status DispatchMouseEvents(
59 const std::list<MouseEvent>& events) OVERRIDE;
60 virtual Status DispatchKeyEvents(const std::list<KeyEvent>& events) OVERRIDE;
61 virtual Status GetCookies(scoped_ptr<base::ListValue>* cookies) OVERRIDE;
62 virtual Status DeleteCookie(const std::string& name,
63 const std::string& url) OVERRIDE;
64 virtual Status WaitForPendingNavigations(
65 const std::string& frame_id) OVERRIDE;
66 virtual Status IsPendingNavigation(
67 const std::string& frame_id, bool* is_pending) OVERRIDE;
68 virtual Status GetMainFrame(std::string* out_frame) OVERRIDE;
69 virtual JavaScriptDialogManager* GetJavaScriptDialogManager() OVERRIDE;
70 virtual Status CaptureScreenshot(std::string* screenshot) OVERRIDE;
71
72 private:
73 std::string id_;
74 scoped_ptr<DomTracker> dom_tracker_;
75 scoped_ptr<FrameTracker> frame_tracker_;
76 scoped_ptr<NavigationTracker> navigation_tracker_;
77 scoped_ptr<JavaScriptDialogManager> dialog_manager_;
78 scoped_ptr<DevToolsClient> client_;
79 WebViewDelegate* delegate_;
80 CloserFunc closer_func_;
81 };
82
83 namespace internal {
84
85 enum EvaluateScriptReturnType {
86 ReturnByValue,
87 ReturnByObject
88 };
89 Status EvaluateScript(DevToolsClient* client,
90 int context_id,
91 const std::string& expression,
92 EvaluateScriptReturnType return_type,
93 scoped_ptr<base::DictionaryValue>* result);
94 Status EvaluateScriptAndGetObject(DevToolsClient* client,
95 int context_id,
96 const std::string& expression,
97 std::string* object_id);
98 Status EvaluateScriptAndGetValue(DevToolsClient* client,
99 int context_id,
100 const std::string& expression,
101 scoped_ptr<base::Value>* result);
102 Status ParseCallFunctionResult(const base::Value& temp_result,
103 scoped_ptr<base::Value>* result);
104 Status GetNodeIdFromFunction(DevToolsClient* client,
105 int context_id,
106 const std::string& function,
107 const base::ListValue& args,
108 int* node_id);
109
110 } // namespace internal
111
112 #endif // CHROME_TEST_CHROMEDRIVER_WEB_VIEW_IMPL_H_
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/web_view_delegate.h ('k') | chrome/test/chromedriver/web_view_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698