OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 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_REMOTING_PAGE_LOAD_NOTIFICATION_OBSERVER_H_ | 5 #ifndef CHROME_TEST_REMOTING_PAGE_LOAD_NOTIFICATION_OBSERVER_H_ |
6 #define CHROME_TEST_REMOTING_PAGE_LOAD_NOTIFICATION_OBSERVER_H_ | 6 #define CHROME_TEST_REMOTING_PAGE_LOAD_NOTIFICATION_OBSERVER_H_ |
7 | 7 |
8 #include "content/public/test/test_utils.h" | 8 #include "content/public/test/test_utils.h" |
9 #include "url/gurl.h" | 9 #include "url/gurl.h" |
10 | 10 |
11 namespace remoting { | 11 namespace remoting { |
12 | 12 |
13 // A PageLoadNotificationObserver allows code to wait until a give URL is loaded | 13 // A PageLoadNotificationObserver allows code to wait until a give URL is loaded |
14 // in any tab in any browser window, i.e. NotificationService::AllSources(). | 14 // in any tab in any browser window, i.e. NotificationService::AllSources(). |
15 // This simple pattern is not easy to implement using | 15 // This simple pattern is not easy to implement using |
16 // WindowedNotificationObserver because we need to bind the observer object | 16 // WindowedNotificationObserver because we need to bind the observer object |
17 // in the callback but we also need to provide the callback when constructing | 17 // in the callback but we also need to provide the callback when constructing |
18 // the observer object. | 18 // the observer object. |
19 class PageLoadNotificationObserver | 19 class PageLoadNotificationObserver |
20 : public content::WindowedNotificationObserver { | 20 : public content::WindowedNotificationObserver { |
21 public: | 21 public: |
22 explicit PageLoadNotificationObserver(const GURL& target); | 22 explicit PageLoadNotificationObserver(const GURL& target); |
23 | 23 |
24 ~PageLoadNotificationObserver() override; | 24 ~PageLoadNotificationObserver() override; |
25 | 25 |
26 void set_ignore_url_parameters(bool ignore_url_parameters) { | |
Jamie
2014/12/02 01:30:12
This is needed because the URL is different depend
| |
27 ignore_url_parameters_ = ignore_url_parameters; | |
28 } | |
29 | |
26 private: | 30 private: |
27 bool IsTargetLoaded(); | 31 bool IsTargetLoaded(); |
32 | |
28 GURL target_; | 33 GURL target_; |
34 bool ignore_url_parameters_; | |
35 | |
29 DISALLOW_COPY_AND_ASSIGN(PageLoadNotificationObserver); | 36 DISALLOW_COPY_AND_ASSIGN(PageLoadNotificationObserver); |
30 }; | 37 }; |
31 | 38 |
32 } // namespace remoting | 39 } // namespace remoting |
33 | 40 |
34 #endif // CHROME_TEST_REMOTING_PAGE_LOAD_NOTIFICATION_OBSERVER_H_ | 41 #endif // CHROME_TEST_REMOTING_PAGE_LOAD_NOTIFICATION_OBSERVER_H_ |
OLD | NEW |