| Index: content/shell/browser/layout_test/secondary_test_window_observer.cc
|
| diff --git a/content/shell/browser/layout_test/notify_done_forwarder.cc b/content/shell/browser/layout_test/secondary_test_window_observer.cc
|
| similarity index 35%
|
| rename from content/shell/browser/layout_test/notify_done_forwarder.cc
|
| rename to content/shell/browser/layout_test/secondary_test_window_observer.cc
|
| index b9213938da28cd98a06617ea698c5e323e782699..b7bb567bb6e9357d443407c23ae56794ca496abe 100644
|
| --- a/content/shell/browser/layout_test/notify_done_forwarder.cc
|
| +++ b/content/shell/browser/layout_test/secondary_test_window_observer.cc
|
| @@ -1,24 +1,26 @@
|
| -// Copyright 2013 The Chromium Authors. All rights reserved.
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "content/shell/browser/layout_test/notify_done_forwarder.h"
|
| +#include "content/shell/browser/layout_test/secondary_test_window_observer.h"
|
|
|
| #include "content/shell/browser/layout_test/blink_test_controller.h"
|
| #include "content/shell/common/shell_messages.h"
|
|
|
| namespace content {
|
|
|
| -DEFINE_WEB_CONTENTS_USER_DATA_KEY(NotifyDoneForwarder);
|
| +DEFINE_WEB_CONTENTS_USER_DATA_KEY(SecondaryTestWindowObserver);
|
|
|
| -NotifyDoneForwarder::NotifyDoneForwarder(WebContents* web_contents)
|
| +SecondaryTestWindowObserver::SecondaryTestWindowObserver(
|
| + WebContents* web_contents)
|
| : WebContentsObserver(web_contents) {}
|
|
|
| -NotifyDoneForwarder::~NotifyDoneForwarder() {}
|
| +SecondaryTestWindowObserver::~SecondaryTestWindowObserver() {}
|
|
|
| -bool NotifyDoneForwarder::OnMessageReceived(const IPC::Message& message) {
|
| +bool SecondaryTestWindowObserver::OnMessageReceived(
|
| + const IPC::Message& message) {
|
| bool handled = true;
|
| - IPC_BEGIN_MESSAGE_MAP(NotifyDoneForwarder, message)
|
| + IPC_BEGIN_MESSAGE_MAP(SecondaryTestWindowObserver, message)
|
| IPC_MESSAGE_HANDLER(ShellViewHostMsg_TestFinishedInSecondaryRenderer,
|
| OnTestFinishedInSecondaryRenderer)
|
| IPC_MESSAGE_UNHANDLED(handled = false)
|
| @@ -26,8 +28,23 @@ bool NotifyDoneForwarder::OnMessageReceived(const IPC::Message& message) {
|
| return handled;
|
| }
|
|
|
| -void NotifyDoneForwarder::OnTestFinishedInSecondaryRenderer() {
|
| +void SecondaryTestWindowObserver::OnTestFinishedInSecondaryRenderer() {
|
| BlinkTestController::Get()->TestFinishedInSecondaryRenderer();
|
| }
|
|
|
| +void SecondaryTestWindowObserver::RenderFrameCreated(
|
| + RenderFrameHost* render_frame_host) {
|
| + DCHECK(!BlinkTestController::Get()->IsMainWindow(
|
| + WebContents::FromRenderFrameHost(render_frame_host)));
|
| + BlinkTestController::Get()->HandleNewRenderFrameHost(render_frame_host);
|
| +}
|
| +
|
| +void SecondaryTestWindowObserver::RenderFrameHostChanged(
|
| + RenderFrameHost* old_host,
|
| + RenderFrameHost* new_host) {
|
| + DCHECK(!BlinkTestController::Get()->IsMainWindow(
|
| + WebContents::FromRenderFrameHost(new_host)));
|
| + BlinkTestController::Get()->HandleNewRenderFrameHost(new_host);
|
| +}
|
| +
|
| } // namespace content
|
|
|