Chromium Code Reviews| Index: ui/aura/mus/window_tree_client.cc |
| diff --git a/ui/aura/mus/window_tree_client.cc b/ui/aura/mus/window_tree_client.cc |
| index edc4d5bfbee4a98f7a8eae7dd8fbcdd0bb84f546..5ec34a2b99ae97154ed05c6ccfe31adacc1a3f86 100644 |
| --- a/ui/aura/mus/window_tree_client.cc |
| +++ b/ui/aura/mus/window_tree_client.cc |
| @@ -211,35 +211,6 @@ void WindowTreeClient::ConnectAsWindowManager( |
| SetWindowTree(std::move(window_tree)); |
| } |
| -void WindowTreeClient::SetClientArea( |
| - Window* window, |
| - const gfx::Insets& client_area, |
| - const std::vector<gfx::Rect>& additional_client_areas) { |
| - DCHECK(tree_); |
| - float device_scale_factor = ScaleFactorForDisplay(window); |
| - std::vector<gfx::Rect> additional_client_areas_in_pixel; |
| - for (const gfx::Rect& area : additional_client_areas) { |
| - additional_client_areas_in_pixel.push_back( |
| - gfx::ConvertRectToPixel(device_scale_factor, area)); |
| - } |
| - tree_->SetClientArea( |
| - WindowMus::Get(window)->server_id(), |
| - gfx::ConvertInsetsToPixel(device_scale_factor, client_area), |
| - additional_client_areas_in_pixel); |
| -} |
| - |
| -void WindowTreeClient::SetHitTestMask(Window* window, const gfx::Rect& mask) { |
| - DCHECK(tree_); |
| - tree_->SetHitTestMask( |
| - WindowMus::Get(window)->server_id(), |
| - gfx::ConvertRectToPixel(ScaleFactorForDisplay(window), mask)); |
| -} |
| - |
| -void WindowTreeClient::ClearHitTestMask(Window* window) { |
| - DCHECK(tree_); |
| - tree_->SetHitTestMask(WindowMus::Get(window)->server_id(), base::nullopt); |
| -} |
| - |
| void WindowTreeClient::SetCanFocus(Window* window, bool can_focus) { |
| DCHECK(tree_); |
| DCHECK(window); |
| @@ -1486,6 +1457,35 @@ void WindowTreeClient::OnWindowTreeHostBoundsWillChange( |
| window_tree_host->GetBounds(), bounds); |
| } |
| +void WindowTreeClient::OnWindowTreeHostClientAreaWillChange( |
| + WindowTreeHostMus* window_tree_host, |
| + const gfx::Insets& client_area) { |
| + DCHECK(tree_); |
| + Window* window = window_tree_host->window(); |
| + float device_scale_factor = ScaleFactorForDisplay(window); |
| + std::vector<gfx::Rect> additional_client_areas_in_pixel; |
| + // TODO(erg): Currently, nobody uses |additional_client_area_in_pixels|. |
|
sky
2016/11/22 04:19:09
It's used in two places. See NonClientFrameControl
Elliot Glaysher
2016/11/22 18:57:12
Done.
|
| + tree_->SetClientArea( |
| + WindowMus::Get(window)->server_id(), |
| + gfx::ConvertInsetsToPixel(device_scale_factor, client_area), |
| + additional_client_areas_in_pixel); |
| +} |
| + |
| +void WindowTreeClient::OnWindowTreeHostHitTestMaskWillChange( |
| + WindowTreeHostMus* window_tree_host, |
| + const base::Optional<gfx::Rect>& mask_rect) { |
| + Window* window = window_tree_host->window(); |
| + |
| + base::Optional<gfx::Rect> out_rect = base::nullopt; |
| + if (mask_rect) { |
| + out_rect = gfx::ConvertRectToPixel(ScaleFactorForDisplay(window), |
| + mask_rect.value()); |
| + } |
| + |
| + tree_->SetHitTestMask(WindowMus::Get(window_tree_host->window())->server_id(), |
| + out_rect); |
| +} |
| + |
| std::unique_ptr<WindowPortMus> WindowTreeClient::CreateWindowPortForTopLevel() { |
| std::unique_ptr<WindowPortMus> window_port = |
| base::MakeUnique<WindowPortMus>(this, WindowMusType::TOP_LEVEL); |