Skip to content

Commit

Permalink
Introdcue AshWindowTreeHost and move ash/chrome specific code in WTH …
Browse files Browse the repository at this point in the history
…to ash.

Other notable changes:
* Removed WindowTreeHostFactory as this is no longer necessary.
* Moved RootWindowTransformer to ash/host
* Removed Set/GetInsets which are no longer necessary (a code in SetInsets is now a part of
SetRootWindowTransformer)
* Added TransformerHelper that implements common behavior to transform root window for AshWindowTreeHost
* Added DEPS files
* Updated metro_viewer code to make sure it creates ash::AshRemoteWindowHostTree

A few more simplifications to come:
* Simplify RootWindowTransformer
* Eliminate EnvObserver in AshWindowTreeHostX11

I'll also work on DEPS reorg to make it more explicit under ash/

BUG=355771
TEST=No functional change. ui/aura/window_tree_host_x11_unittests has been moved to ash/host/ash_window_tree_host_x11_unittests

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263192 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
oshima@chromium.org committed Apr 11, 2014
1 parent 728f28f commit f5c9dbc
Show file tree
Hide file tree
Showing 70 changed files with 1,488 additions and 1,120 deletions.
7 changes: 7 additions & 0 deletions ash/DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,11 @@ include_rules = [
"+net",
"+ui",
"+win8",
"-ash/host",
]

specific_include_rules = {
"root_window_controller\.*": [
"+ash/host"
],
}
5 changes: 5 additions & 0 deletions ash/accelerators/DEPS
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
specific_include_rules = {
"accelerator_controller\.cc": [
"+ash/host"
],
}
5 changes: 3 additions & 2 deletions ash/accelerators/accelerator_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "ash/display/display_manager.h"
#include "ash/focus_cycler.h"
#include "ash/gpu_support.h"
#include "ash/host/ash_window_tree_host.h"
#include "ash/ime_control_delegate.h"
#include "ash/magnifier/magnification_controller.h"
#include "ash/magnifier/partial_magnification_controller.h"
Expand Down Expand Up @@ -498,7 +499,7 @@ bool HandleToggleFullscreen(ui::KeyboardCode key_code) {
}

bool HandleToggleRootWindowFullScreen() {
Shell::GetPrimaryRootWindow()->GetHost()->ToggleFullScreen();
Shell::GetPrimaryRootWindowController()->ash_host()->ToggleFullScreen();
return true;
}

Expand Down Expand Up @@ -725,7 +726,7 @@ bool HandlePrintWindowHierarchy() {
for (size_t i = 0; i < controllers.size(); ++i) {
std::ostringstream out;
out << "RootWindow " << i << ":\n";
PrintWindowHierarchy(controllers[i]->root_window(), 0, &out);
PrintWindowHierarchy(controllers[i]->GetRootWindow(), 0, &out);
// Error so logs can be collected from end-users.
LOG(ERROR) << out.str();
}
Expand Down
22 changes: 17 additions & 5 deletions ash/ash.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -184,8 +184,8 @@
'frame/frame_border_hit_test_controller.h',
'frame/default_header_painter.cc',
'frame/default_header_painter.h',
'frame/frame_util.cc',
'frame/frame_util.h',
'frame/frame_util.cc',
'frame/frame_util.h',
'frame/header_painter.h',
'frame/header_painter_util.cc',
'frame/header_painter_util.h',
Expand All @@ -194,9 +194,16 @@
'gpu_support_stub.h',
'high_contrast/high_contrast_controller.cc',
'high_contrast/high_contrast_controller.h',
'host/window_tree_host_factory.cc',
'host/window_tree_host_factory.h',
'host/window_tree_host_factory_win.cc',
'host/ash_remote_window_tree_host_win.cc',
'host/ash_remote_window_tree_host_win.h',
'host/ash_window_tree_host.h',
'host/ash_window_tree_host_ozone.cc',
'host/ash_window_tree_host_win.cc',
'host/ash_window_tree_host_x11.cc',
'host/ash_window_tree_host_x11.h',
'host/root_window_transformer.h',
'host/transformer_helper.cc',
'host/transformer_helper.h',
'ime/candidate_view.cc',
'ime/candidate_view.h',
'ime/candidate_window_view.cc',
Expand Down Expand Up @@ -696,6 +703,10 @@
['exclude', 'accelerators/spoken_feedback_toggler.cc'],
['exclude', 'accelerators/spoken_feedback_toggler.h'],
],
}, { # else: use_x11==1
'dependencies': [
'../build/linux/system.gyp:xfixes',
],
}],
['chromeos==1', {
'dependencies': [
Expand Down Expand Up @@ -912,6 +923,7 @@
'frame/caption_buttons/frame_maximize_button_unittest.cc',
'frame/custom_frame_view_ash_unittest.cc',
'frame/default_header_painter_unittest.cc',
'host/ash_window_tree_host_x11_unittest.cc',
'ime/candidate_window_view_unittest.cc',
'ime/input_method_menu_item_unittest.cc',
'ime/input_method_menu_manager_unittest.cc',
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)->host()->dispatcher()->DispatchCancelModeEvent();
(*i)->GetHost()->dispatcher()->DispatchCancelModeEvent();
}
}

Expand Down
10 changes: 5 additions & 5 deletions ash/desktop_background/desktop_background_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,10 @@ bool DesktopBackgroundController::ReparentBackgroundWidgets(int src_container,
DesktopBackgroundWidgetController* desktop_controller =
root_window_controller->wallpaper_controller();
if (desktop_controller) {
moved |= desktop_controller->Reparent(
root_window_controller->root_window(),
src_container,
dst_container);
moved |=
desktop_controller->Reparent(root_window_controller->GetRootWindow(),
src_container,
dst_container);
}
// During desktop show animations the controller lives in
// AnimatingDesktopController owned by RootWindowController.
Expand All @@ -275,7 +275,7 @@ bool DesktopBackgroundController::ReparentBackgroundWidgets(int src_container,
NULL;
if (animating_controller) {
moved |= animating_controller->Reparent(
root_window_controller->root_window(),
root_window_controller->GetRootWindow(),
src_container,
dst_container);
}
Expand Down
4 changes: 4 additions & 0 deletions ash/display/DEPS
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
include_rules = [
"+ash/host",
]

7 changes: 4 additions & 3 deletions ash/display/cursor_window_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,10 @@ void CursorWindowController::UpdateContainer() {
if (is_cursor_compositing_enabled_) {
SetDisplay(display_);
} else {
aura::WindowTreeHost* mirror_host = Shell::GetInstance()->
display_controller()->mirror_window_controller()->host();
SetContainer(mirror_host ? mirror_host->window() : NULL);
SetContainer(Shell::GetInstance()->
display_controller()->
mirror_window_controller()->
GetWindow());
}
}

Expand Down
Loading

0 comments on commit f5c9dbc

Please sign in to comment.