Skip to content

Commit

Permalink
Revert 236048 "Rename RootWindowHost* to WindowTreeHost*"
Browse files Browse the repository at this point in the history
> Rename RootWindowHost* to WindowTreeHost*
> 
> TBR=sky@chromium.org
> http://crbug.com/308843
> 
> Review URL: https://codereview.chromium.org/76583003

TBR=ben@chromium.org

Review URL: https://codereview.chromium.org/77203002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236093 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
ben@chromium.org committed Nov 20, 2013
1 parent f0c4809 commit 8520ebd
Show file tree
Hide file tree
Showing 119 changed files with 1,153 additions and 1,153 deletions.
12 changes: 6 additions & 6 deletions ash/accelerators/accelerator_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -615,17 +615,17 @@ TEST_F(AcceleratorControllerTest, MAYBE_ProcessOnce) {
#if defined(OS_WIN)
MSG msg1 = { NULL, WM_KEYDOWN, ui::VKEY_A, 0 };
ui::TranslatedKeyEvent key_event1(msg1, false);
EXPECT_TRUE(dispatcher->AsWindowTreeHostDelegate()->OnHostKeyEvent(
EXPECT_TRUE(dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(
&key_event1));

MSG msg2 = { NULL, WM_CHAR, L'A', 0 };
ui::TranslatedKeyEvent key_event2(msg2, true);
EXPECT_FALSE(dispatcher->AsWindowTreeHostDelegate()->OnHostKeyEvent(
EXPECT_FALSE(dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(
&key_event2));

MSG msg3 = { NULL, WM_KEYUP, ui::VKEY_A, 0 };
ui::TranslatedKeyEvent key_event3(msg3, false);
EXPECT_FALSE(dispatcher->AsWindowTreeHostDelegate()->OnHostKeyEvent(
EXPECT_FALSE(dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(
&key_event3));
#elif defined(USE_X11)
XEvent key_event;
Expand All @@ -634,19 +634,19 @@ TEST_F(AcceleratorControllerTest, MAYBE_ProcessOnce) {
0,
&key_event);
ui::TranslatedKeyEvent key_event1(&key_event, false);
EXPECT_TRUE(dispatcher->AsWindowTreeHostDelegate()->OnHostKeyEvent(
EXPECT_TRUE(dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(
&key_event1));

ui::TranslatedKeyEvent key_event2(&key_event, true);
EXPECT_FALSE(dispatcher->AsWindowTreeHostDelegate()->OnHostKeyEvent(
EXPECT_FALSE(dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(
&key_event2));

ui::InitXKeyEventForTesting(ui::ET_KEY_RELEASED,
ui::VKEY_A,
0,
&key_event);
ui::TranslatedKeyEvent key_event3(&key_event, false);
EXPECT_FALSE(dispatcher->AsWindowTreeHostDelegate()->OnHostKeyEvent(
EXPECT_FALSE(dispatcher->AsRootWindowHostDelegate()->OnHostKeyEvent(
&key_event3));
#endif
EXPECT_EQ(1, target.accelerator_pressed_count());
Expand Down
4 changes: 2 additions & 2 deletions ash/autoclick/autoclick_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@ void AutoclickControllerImpl::DoAutoclick() {
click_location,
mouse_event_flags_ | ui::EF_LEFT_MOUSE_BUTTON);

dispatcher->AsWindowTreeHostDelegate()->OnHostMouseEvent(&press_event);
dispatcher->AsWindowTreeHostDelegate()->OnHostMouseEvent(&release_event);
dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&press_event);
dispatcher->AsRootWindowHostDelegate()->OnHostMouseEvent(&release_event);
}

// static.
Expand Down
2 changes: 1 addition & 1 deletion ash/cancel_mode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ void DispatchCancelMode() {
Shell::GetAllRootWindowControllers());
for (Shell::RootWindowControllerList::const_iterator i = controllers.begin();
i != controllers.end(); ++i) {
(*i)->dispatcher()->AsWindowTreeHostDelegate()->OnHostCancelMode();
(*i)->dispatcher()->AsRootWindowHostDelegate()->OnHostCancelMode();
}
}

Expand Down
4 changes: 2 additions & 2 deletions ash/display/display_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,7 @@ void DisplayController::OnDisplayRemoved(const gfx::Display& display) {
base::MessageLoop::current()->DeleteSoon(FROM_HERE, controller);
}

void DisplayController::OnWindowTreeHostResized(const aura::RootWindow* root) {
void DisplayController::OnRootWindowHostResized(const aura::RootWindow* root) {
internal::DisplayManager* display_manager = GetDisplayManager();
gfx::Display display = GetDisplayNearestWindow(root->window());
if (display_manager->UpdateDisplayBounds(
Expand Down Expand Up @@ -757,7 +757,7 @@ aura::RootWindow* DisplayController::AddRootWindowForDisplay(
const gfx::Rect& bounds_in_native = display_info.bounds_in_native();
aura::RootWindow::CreateParams params(bounds_in_native);
params.host = Shell::GetInstance()->root_window_host_factory()->
CreateWindowTreeHost(bounds_in_native);
CreateRootWindowHost(bounds_in_native);
aura::RootWindow* root_window = new aura::RootWindow(params);
root_window->window()->SetName(
base::StringPrintf("RootWindow-%d", root_window_count++));
Expand Down
2 changes: 1 addition & 1 deletion ash/display/display_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class ASH_EXPORT DisplayController : public gfx::DisplayObserver,
virtual void OnDisplayRemoved(const gfx::Display& display) OVERRIDE;

// RootWindowObserver overrides:
virtual void OnWindowTreeHostResized(const aura::RootWindow* root) OVERRIDE;
virtual void OnRootWindowHostResized(const aura::RootWindow* root) OVERRIDE;

// aura::DisplayManager::Delegate overrides:
virtual void CreateOrUpdateNonDesktopDisplay(
Expand Down
2 changes: 1 addition & 1 deletion ash/display/display_info.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ DisplayInfo DisplayInfo::CreateFromSpecWithID(const std::string& spec,
static int64 synthesized_display_id = 2200000000LL;

#if defined(OS_WIN)
gfx::Rect bounds_in_native(aura::WindowTreeHost::GetNativeScreenSize());
gfx::Rect bounds_in_native(aura::RootWindowHost::GetNativeScreenSize());
#else
gfx::Rect bounds_in_native(kDefaultHostWindowX, kDefaultHostWindowY,
kDefaultHostWindowWidth, kDefaultHostWindowHeight);
Expand Down
4 changes: 2 additions & 2 deletions ash/display/mirror_window_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ void MirrorWindowController::UpdateWindow(const DisplayInfo& display_info) {
const gfx::Rect& bounds_in_native = display_info.bounds_in_native();
aura::RootWindow::CreateParams params(bounds_in_native);
params.host = Shell::GetInstance()->root_window_host_factory()->
CreateWindowTreeHost(bounds_in_native);
CreateRootWindowHost(bounds_in_native);
root_window_.reset(new aura::RootWindow(params));
root_window_->window()->SetName(
base::StringPrintf("MirrorRootWindow-%d", mirror_root_window_count++));
Expand Down Expand Up @@ -318,7 +318,7 @@ void MirrorWindowController::SetMirroredCursorVisibility(bool visible) {
visible ? cursor_window_->Show() : cursor_window_->Hide();
}

void MirrorWindowController::OnWindowTreeHostResized(
void MirrorWindowController::OnRootWindowHostResized(
const aura::RootWindow* root) {
// Do not use |old_size| as it contains RootWindow's (but not host's) size,
// and this parameter wil be removed soon.
Expand Down
2 changes: 1 addition & 1 deletion ash/display/mirror_window_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class ASH_EXPORT MirrorWindowController : public aura::RootWindowObserver {
void SetMirroredCursorVisibility(bool visible);

// aura::RootWindowObserver overrides:
virtual void OnWindowTreeHostResized(const aura::RootWindow* root) OVERRIDE;
virtual void OnRootWindowHostResized(const aura::RootWindow* root) OVERRIDE;

private:
friend class test::MirrorWindowTestApi;
Expand Down
2 changes: 1 addition & 1 deletion ash/display/virtual_keyboard_window_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void VirtualKeyboardWindowController::UpdateWindow(
const gfx::Rect& bounds_in_native = display_info.bounds_in_native();
aura::RootWindow::CreateParams params(bounds_in_native);
params.host = Shell::GetInstance()->root_window_host_factory()->
CreateWindowTreeHost(bounds_in_native);
CreateRootWindowHost(bounds_in_native);
aura::RootWindow* root_window = new aura::RootWindow(params);

root_window->window()->SetName(
Expand Down
2 changes: 1 addition & 1 deletion ash/drag_drop/drag_drop_controller_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ TEST_F(DragDropControllerTest, SyntheticEventsDuringDragDrop) {
gfx::Point mouse_move_location = drag_view->bounds().CenterPoint();
ui::MouseEvent mouse_move(ui::ET_MOUSE_MOVED, mouse_move_location,
mouse_move_location, 0);
Shell::GetPrimaryRootWindow()->GetDispatcher()->AsWindowTreeHostDelegate()->
Shell::GetPrimaryRootWindow()->GetDispatcher()->AsRootWindowHostDelegate()->
OnHostMouseEvent(&mouse_move);
}

Expand Down
14 changes: 7 additions & 7 deletions ash/host/root_window_host_factory.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@

namespace {

class WindowTreeHostFactoryImpl : public ash::WindowTreeHostFactory {
class RootWindowHostFactoryImpl : public ash::RootWindowHostFactory {
public:
WindowTreeHostFactoryImpl() {}
RootWindowHostFactoryImpl() {}

// Overridden from WindowTreeHostFactory:
virtual aura::WindowTreeHost* CreateWindowTreeHost(
// Overridden from RootWindowHostFactory:
virtual aura::RootWindowHost* CreateRootWindowHost(
const gfx::Rect& initial_bounds) OVERRIDE {
return aura::WindowTreeHost::Create(initial_bounds);
return aura::RootWindowHost::Create(initial_bounds);
}
};

Expand All @@ -24,8 +24,8 @@ class WindowTreeHostFactoryImpl : public ash::WindowTreeHostFactory {
namespace ash {

// static
WindowTreeHostFactory* WindowTreeHostFactory::Create() {
return new WindowTreeHostFactoryImpl;
RootWindowHostFactory* RootWindowHostFactory::Create() {
return new RootWindowHostFactoryImpl;
}

} // namespace ash
14 changes: 7 additions & 7 deletions ash/host/root_window_host_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,23 @@
#include "ui/gfx/rect.h"

namespace aura {
class WindowTreeHost;
class RootWindowHost;
}

namespace ash {

class ASH_EXPORT WindowTreeHostFactory {
class ASH_EXPORT RootWindowHostFactory {
public:
virtual ~WindowTreeHostFactory() {}
virtual ~RootWindowHostFactory() {}

static WindowTreeHostFactory* Create();
static RootWindowHostFactory* Create();

// Creates a new aura::WindowTreeHost. The caller owns the returned value.
virtual aura::WindowTreeHost* CreateWindowTreeHost(
// Creates a new aura::RootWindowHost. The caller owns the returned value.
virtual aura::RootWindowHost* CreateRootWindowHost(
const gfx::Rect& initial_bounds) = 0;

protected:
WindowTreeHostFactory() {}
RootWindowHostFactory() {}
};

} // namespace ash
Expand Down
16 changes: 8 additions & 8 deletions ash/host/root_window_host_factory_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@

namespace {

class WindowTreeHostFactoryImpl : public ash::WindowTreeHostFactory {
class RootWindowHostFactoryImpl : public ash::RootWindowHostFactory {
public:
WindowTreeHostFactoryImpl() {}
RootWindowHostFactoryImpl() {}

// Overridden from WindowTreeHostFactory:
virtual aura::WindowTreeHost* CreateWindowTreeHost(
// Overridden from RootWindowHostFactory:
virtual aura::RootWindowHost* CreateRootWindowHost(
const gfx::Rect& initial_bounds) OVERRIDE {
if (base::win::GetVersion() >= base::win::VERSION_WIN8 &&
!CommandLine::ForCurrentProcess()->HasSwitch(
ash::switches::kForceAshToDesktop))
return aura::RemoteWindowTreeHostWin::Create(initial_bounds);
return aura::RemoteRootWindowHostWin::Create(initial_bounds);

return aura::WindowTreeHost::Create(initial_bounds);
return aura::RootWindowHost::Create(initial_bounds);
}
};

Expand All @@ -33,8 +33,8 @@ class WindowTreeHostFactoryImpl : public ash::WindowTreeHostFactory {
namespace ash {

// static
WindowTreeHostFactory* WindowTreeHostFactory::Create() {
return new WindowTreeHostFactoryImpl;
RootWindowHostFactory* RootWindowHostFactory::Create() {
return new RootWindowHostFactoryImpl;
}

} // namespace ash
2 changes: 1 addition & 1 deletion ash/shell.cc
Original file line number Diff line number Diff line change
Expand Up @@ -761,7 +761,7 @@ void Shell::Init() {
focus_cycler_.reset(new internal::FocusCycler());

screen_position_controller_.reset(new internal::ScreenPositionController);
root_window_host_factory_.reset(delegate_->CreateWindowTreeHostFactory());
root_window_host_factory_.reset(delegate_->CreateRootWindowHostFactory());

display_controller_->Start();
display_controller_->InitPrimaryDisplay();
Expand Down
6 changes: 3 additions & 3 deletions ash/shell.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class NestedDispatcherController;
class NewWindowDelegate;
class PartialMagnificationController;
class PowerButtonController;
class WindowTreeHostFactory;
class RootWindowHostFactory;
class ScreenAsh;
class SessionStateDelegate;
class ShelfModel;
Expand Down Expand Up @@ -499,7 +499,7 @@ class ASH_EXPORT Shell
return resolution_notification_controller_.get();
}

WindowTreeHostFactory* root_window_host_factory() {
RootWindowHostFactory* root_window_host_factory() {
return root_window_host_factory_.get();
}

Expand Down Expand Up @@ -636,7 +636,7 @@ class ASH_EXPORT Shell
scoped_ptr<internal::EventClientImpl> event_client_;
scoped_ptr<internal::EventTransformationHandler>
event_transformation_handler_;
scoped_ptr<WindowTreeHostFactory> root_window_host_factory_;
scoped_ptr<RootWindowHostFactory> root_window_host_factory_;

// An event filter that rewrites or drops an event.
scoped_ptr<internal::EventRewriterEventFilter> event_rewriter_filter_;
Expand Down
4 changes: 2 additions & 2 deletions ash/shell/shell_delegate_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ ui::MenuModel* ShellDelegateImpl::CreateContextMenu(aura::Window* root) {
return new ContextMenu(root);
}

WindowTreeHostFactory* ShellDelegateImpl::CreateWindowTreeHostFactory() {
return WindowTreeHostFactory::Create();
RootWindowHostFactory* ShellDelegateImpl::CreateRootWindowHostFactory() {
return RootWindowHostFactory::Create();
}

base::string16 ShellDelegateImpl::GetProductName() const {
Expand Down
2 changes: 1 addition & 1 deletion ash/shell/shell_delegate_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class ShellDelegateImpl : public ash::ShellDelegate {
virtual void RecordUserMetricsAction(UserMetricsAction action) OVERRIDE;
virtual ui::MenuModel* CreateContextMenu(
aura::Window* root_window) OVERRIDE;
virtual WindowTreeHostFactory* CreateWindowTreeHostFactory() OVERRIDE;
virtual RootWindowHostFactory* CreateRootWindowHostFactory() OVERRIDE;
virtual base::string16 GetProductName() const OVERRIDE;

private:
Expand Down
4 changes: 2 additions & 2 deletions ash/shell_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class LauncherDelegate;
struct LauncherItem;
class MediaDelegate;
class NewWindowDelegate;
class WindowTreeHostFactory;
class RootWindowHostFactory;
class SessionStateDelegate;
class ShelfModel;
class SystemTrayDelegate;
Expand Down Expand Up @@ -189,7 +189,7 @@ class ASH_EXPORT ShellDelegate {

// Creates a root window host factory. Shell takes ownership of the returned
// value.
virtual WindowTreeHostFactory* CreateWindowTreeHostFactory() = 0;
virtual RootWindowHostFactory* CreateRootWindowHostFactory() = 0;

// Get the product name.
virtual base::string16 GetProductName() const = 0;
Expand Down
4 changes: 2 additions & 2 deletions ash/test/ash_test_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ void AshTestBase::SetUp() {
CHECK(metro_viewer_host_->LaunchViewerAndWaitForConnection(
win8::test::kDefaultTestAppUserModelId,
L"test_open"));
aura::RemoteWindowTreeHostWin* root_window_host =
aura::RemoteWindowTreeHostWin::Instance();
aura::RemoteRootWindowHostWin* root_window_host =
aura::RemoteRootWindowHostWin::Instance();
CHECK(root_window_host != NULL);
}
#endif
Expand Down
4 changes: 2 additions & 2 deletions ash/test/test_metro_viewer_process_host.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ TestMetroViewerProcessHost::~TestMetroViewerProcessHost() {

void TestMetroViewerProcessHost::OnChannelError() {
closed_unexpectedly_ = true;
aura::RemoteWindowTreeHostWin::Instance()->Disconnected();
aura::RemoteRootWindowHostWin::Instance()->Disconnected();
}

void TestMetroViewerProcessHost::OnSetTargetSurface(
gfx::NativeViewId target_surface) {
DLOG(INFO) << __FUNCTION__ << ", target_surface = " << target_surface;
HWND hwnd = reinterpret_cast<HWND>(target_surface);
aura::RemoteWindowTreeHostWin::Instance()->Connected(this, hwnd);
aura::RemoteRootWindowHostWin::Instance()->Connected(this, hwnd);

backing_surface_.reset(new AcceleratedSurface(hwnd));
}
Expand Down
4 changes: 2 additions & 2 deletions ash/test/test_shell_delegate.cc
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ ui::MenuModel* TestShellDelegate::CreateContextMenu(aura::Window* root) {
return NULL;
}

WindowTreeHostFactory* TestShellDelegate::CreateWindowTreeHostFactory() {
return WindowTreeHostFactory::Create();
RootWindowHostFactory* TestShellDelegate::CreateRootWindowHostFactory() {
return RootWindowHostFactory::Create();
}

base::string16 TestShellDelegate::GetProductName() const {
Expand Down
2 changes: 1 addition & 1 deletion ash/test/test_shell_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class TestShellDelegate : public ShellDelegate {
virtual aura::client::UserActionClient* CreateUserActionClient() OVERRIDE;
virtual void RecordUserMetricsAction(UserMetricsAction action) OVERRIDE;
virtual ui::MenuModel* CreateContextMenu(aura::Window* root) OVERRIDE;
virtual WindowTreeHostFactory* CreateWindowTreeHostFactory() OVERRIDE;
virtual RootWindowHostFactory* CreateRootWindowHostFactory() OVERRIDE;
virtual base::string16 GetProductName() const OVERRIDE;

int num_exit_requests() const { return num_exit_requests_; }
Expand Down
4 changes: 2 additions & 2 deletions ash/wm/caption_buttons/frame_maximize_button_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -550,15 +550,15 @@ TEST_F(FrameMaximizeButtonTest, MaximizeTap) {
button_pos,
kTouchId,
ui::EventTimeForNow());
dispatcher->AsWindowTreeHostDelegate()->OnHostTouchEvent(&press);
dispatcher->AsRootWindowHostDelegate()->OnHostTouchEvent(&press);

button_pos.Offset(9, 8);
ui::TouchEvent release(
ui::ET_TOUCH_RELEASED,
button_pos,
kTouchId,
press.time_stamp() + base::TimeDelta::FromMilliseconds(50));
dispatcher->AsWindowTreeHostDelegate()->OnHostTouchEvent(&release);
dispatcher->AsRootWindowHostDelegate()->OnHostTouchEvent(&release);

ui::GestureConfiguration::set_default_radius(touch_default_radius);
}
Expand Down
2 changes: 1 addition & 1 deletion ash/wm/lock_state_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ void LockStateController::SetLockScreenDisplayedCallback(
lock_screen_displayed_callback_ = callback;
}

void LockStateController::OnWindowTreeHostCloseRequested(
void LockStateController::OnRootWindowHostCloseRequested(
const aura::RootWindow*) {
Shell::GetInstance()->delegate()->Exit();
}
Expand Down
Loading

0 comments on commit 8520ebd

Please sign in to comment.