OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 WEBKIT_TOOLS_TEST_SHELL_TEST_NAVIGATION_CONTROLLER_H_ | 5 #ifndef WEBKIT_TOOLS_TEST_SHELL_TEST_NAVIGATION_CONTROLLER_H_ |
6 #define WEBKIT_TOOLS_TEST_SHELL_TEST_NAVIGATION_CONTROLLER_H_ | 6 #define WEBKIT_TOOLS_TEST_SHELL_TEST_NAVIGATION_CONTROLLER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/memory/linked_ptr.h" | 12 #include "base/memory/linked_ptr.h" |
13 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
14 #include "base/string16.h" | 14 #include "base/string16.h" |
15 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebDataSource.h" |
17 | 17 |
18 class GURL; | 18 class GURL; |
19 class TestShell; | 19 class TestShell; |
20 | 20 |
21 // Associated with browser-initated navigations to hold tracking data. | 21 // Associated with browser-initated navigations to hold tracking data. |
22 class TestShellExtraData : public WebKit::WebDataSource::ExtraData { | 22 class TestShellExtraData : public WebKit::WebDataSource::ExtraData { |
23 public: | 23 public: |
24 TestShellExtraData(int32 pending_page_id) | 24 explicit TestShellExtraData(int32 pending_page_id) |
25 : pending_page_id(pending_page_id), | 25 : pending_page_id(pending_page_id), |
26 request_committed(false) { | 26 request_committed(false) { |
27 } | 27 } |
28 | 28 |
29 // Contains the page_id for this navigation or -1 if there is none yet. | 29 // Contains the page_id for this navigation or -1 if there is none yet. |
30 int32 pending_page_id; | 30 int32 pending_page_id; |
31 | 31 |
32 // True if we have already processed the "DidCommitLoad" event for this | 32 // True if we have already processed the "DidCommitLoad" event for this |
33 // request. Used by session history. | 33 // request. Used by session history. |
34 bool request_committed; | 34 bool request_committed; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 73 |
74 string16 target_frame_; | 74 string16 target_frame_; |
75 | 75 |
76 DISALLOW_COPY_AND_ASSIGN(TestNavigationEntry); | 76 DISALLOW_COPY_AND_ASSIGN(TestNavigationEntry); |
77 }; | 77 }; |
78 | 78 |
79 // Test shell's NavigationController. The goal is to be as close to the Chrome | 79 // Test shell's NavigationController. The goal is to be as close to the Chrome |
80 // version as possible. | 80 // version as possible. |
81 class TestNavigationController { | 81 class TestNavigationController { |
82 public: | 82 public: |
83 TestNavigationController(TestShell* shell); | 83 explicit TestNavigationController(TestShell* shell); |
84 ~TestNavigationController(); | 84 ~TestNavigationController(); |
85 | 85 |
86 void Reset(); | 86 void Reset(); |
87 | 87 |
88 // Causes the controller to reload the current (or pending) entry. | 88 // Causes the controller to reload the current (or pending) entry. |
89 void Reload(); | 89 void Reload(); |
90 | 90 |
91 // Causes the controller to go to the specified offset from current. Does | 91 // Causes the controller to go to the specified offset from current. Does |
92 // nothing if out of bounds. | 92 // nothing if out of bounds. |
93 void GoToOffset(int offset); | 93 void GoToOffset(int offset); |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 // new entry (created by LoadURL). | 175 // new entry (created by LoadURL). |
176 int pending_entry_index_; | 176 int pending_entry_index_; |
177 | 177 |
178 TestShell* shell_; | 178 TestShell* shell_; |
179 int max_page_id_; | 179 int max_page_id_; |
180 | 180 |
181 DISALLOW_COPY_AND_ASSIGN(TestNavigationController); | 181 DISALLOW_COPY_AND_ASSIGN(TestNavigationController); |
182 }; | 182 }; |
183 | 183 |
184 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_NAVIGATION_CONTROLLER_H_ | 184 #endif // WEBKIT_TOOLS_TEST_SHELL_TEST_NAVIGATION_CONTROLLER_H_ |
OLD | NEW |