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
3 // found in the LICENSE file.
5 #include "chrome/test/remoting/page_load_notification_observer.h"
7 #include "content/public/browser/navigation_controller.h"
8 #include "content/public/browser/notification_types.h"
9 #include "content/public/browser/web_contents.h"
13 PageLoadNotificationObserver::PageLoadNotificationObserver(const GURL
& target
)
14 : WindowedNotificationObserver(
15 content::NOTIFICATION_LOAD_STOP
,
16 base::Bind(&PageLoadNotificationObserver::IsTargetLoaded
,
17 base::Unretained(this))),
21 PageLoadNotificationObserver::~PageLoadNotificationObserver() {}
23 bool PageLoadNotificationObserver::IsTargetLoaded() {
24 content::NavigationController
* controller
=
25 content::Source
<content::NavigationController
>(source()).ptr();
26 return controller
->GetWebContents()->GetURL() == target_
;
29 } // namespace remoting