Add python coverage module to third_party
[chromium-blink-merge.git] / chrome / test / remoting / page_load_notification_observer.cc
blob4898680bc8332bd83f61c42421268e0033a509c8
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"
11 namespace remoting {
13 PageLoadNotificationObserver::PageLoadNotificationObserver(const GURL& target)
14 : WindowedNotificationObserver(
15 content::NOTIFICATION_LOAD_STOP,
16 base::Bind(&PageLoadNotificationObserver::IsTargetLoaded,
17 base::Unretained(this))),
18 target_(target) {
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