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

Side by Side Diff: chrome/test/chromedriver/javascript_dialog_manager.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
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_JAVASCRIPT_DIALOG_MANAGER_H_
6 #define CHROME_TEST_CHROMEDRIVER_JAVASCRIPT_DIALOG_MANAGER_H_
7
8 #include <list>
9 #include <string>
10
11 #include "base/basictypes.h"
12 #include "base/compiler_specific.h"
13 #include "chrome/test/chromedriver/devtools_event_listener.h"
14
15 namespace base {
16 class DictionaryValue;
17 }
18
19 class DevToolsClient;
20 class Status;
21
22 // Tracks the opening and closing of JavaScript dialogs (e.g., alerts).
23 class JavaScriptDialogManager : public DevToolsEventListener {
24 public:
25 explicit JavaScriptDialogManager(DevToolsClient* client);
26 virtual ~JavaScriptDialogManager();
27
28 bool IsDialogOpen();
29
30 Status GetDialogMessage(std::string* message);
31
32 Status HandleDialog(bool accept, const std::string& text);
33
34 // Overridden from DevToolsEventListener:
35 virtual Status OnConnected() OVERRIDE;
36 virtual void OnEvent(const std::string& method,
37 const base::DictionaryValue& params) OVERRIDE;
38
39 private:
40 DevToolsClient* client_;
41
42 // The queue of unhandled dialogs. This may be greater than 1 in rare
43 // cases. E.g., if the page shows an alert but before the manager received
44 // the event, a script was injected via Inspector that triggered an alert.
45 std::list<std::string> unhandled_dialog_queue_;
46
47 DISALLOW_COPY_AND_ASSIGN(JavaScriptDialogManager);
48 };
49
50 #endif // CHROME_TEST_CHROMEDRIVER_JAVASCRIPT_DIALOG_MANAGER_H_
OLDNEW
« no previous file with comments | « chrome/test/chromedriver/frame_tracker_unittest.cc ('k') | chrome/test/chromedriver/javascript_dialog_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698