| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 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 | 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 CHROME_TEST_CHROMEDRIVER_NAVIGATION_TRACKER_H_ | 5 #ifndef CHROME_TEST_CHROMEDRIVER_NAVIGATION_TRACKER_H_ |
| 6 #define CHROME_TEST_CHROMEDRIVER_NAVIGATION_TRACKER_H_ | 6 #define CHROME_TEST_CHROMEDRIVER_NAVIGATION_TRACKER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "chrome/test/chromedriver/devtools_client.h" |
| 13 #include "chrome/test/chromedriver/devtools_event_listener.h" | 14 #include "chrome/test/chromedriver/devtools_event_listener.h" |
| 15 #include "chrome/test/chromedriver/status.h" |
| 14 | 16 |
| 15 namespace base { | 17 namespace base { |
| 16 class DictionaryValue; | 18 class DictionaryValue; |
| 17 } | 19 } |
| 18 | 20 |
| 21 class DevToolsClient; |
| 22 class Status; |
| 23 |
| 19 // Tracks the navigation state of frames. | 24 // Tracks the navigation state of frames. |
| 20 class NavigationTracker : public DevToolsEventListener { | 25 class NavigationTracker : public DevToolsEventListener { |
| 21 public: | 26 public: |
| 22 NavigationTracker(); | 27 NavigationTracker(); |
| 23 virtual ~NavigationTracker(); | 28 virtual ~NavigationTracker(); |
| 24 | 29 |
| 30 Status Init(DevToolsClient* client); |
| 25 bool IsPendingNavigation(const std::string& frame_id); | 31 bool IsPendingNavigation(const std::string& frame_id); |
| 26 | 32 |
| 27 // Overridden from DevToolsEventListener: | 33 // Overridden from DevToolsEventListener: |
| 28 virtual void OnEvent(const std::string& method, | 34 virtual void OnEvent(const std::string& method, |
| 29 const base::DictionaryValue& params) OVERRIDE; | 35 const base::DictionaryValue& params) OVERRIDE; |
| 30 | 36 |
| 31 private: | 37 private: |
| 32 class NavigationState { | 38 class NavigationState { |
| 33 public: | 39 public: |
| 34 NavigationState(); | 40 NavigationState(); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 48 private: | 54 private: |
| 49 Mask state_bitfield_; | 55 Mask state_bitfield_; |
| 50 }; | 56 }; |
| 51 | 57 |
| 52 std::map<std::string, NavigationState> frame_state_; | 58 std::map<std::string, NavigationState> frame_state_; |
| 53 | 59 |
| 54 DISALLOW_COPY_AND_ASSIGN(NavigationTracker); | 60 DISALLOW_COPY_AND_ASSIGN(NavigationTracker); |
| 55 }; | 61 }; |
| 56 | 62 |
| 57 #endif // CHROME_TEST_CHROMEDRIVER_NAVIGATION_TRACKER_H_ | 63 #endif // CHROME_TEST_CHROMEDRIVER_NAVIGATION_TRACKER_H_ |
| OLD | NEW |