Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(492)

Unified Diff: ui/aura/mus/window_tree_client.cc

Issue 2507963002: Implement hit tests/client area. (Closed)
Patch Set: add it back Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/aura/mus/window_tree_client.h ('k') | ui/aura/mus/window_tree_host_mus.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 eff5c9d1abd81ee49dc4eb1ad21a38655a68cea8..36adf4f7840a7337e16f910a69c08f736387d713 100644
--- a/ui/aura/mus/window_tree_client.cc
+++ b/ui/aura/mus/window_tree_client.cc
@@ -232,35 +232,6 @@ client::CaptureClient* WindowTreeClient::GetCaptureClient() {
return delegate_->GetCaptureClient();
}
-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);
@@ -1510,6 +1481,39 @@ void WindowTreeClient::OnWindowTreeHostBoundsWillChange(
window_tree_host->GetBounds(), bounds);
}
+void WindowTreeClient::OnWindowTreeHostClientAreaWillChange(
+ WindowTreeHostMus* window_tree_host,
+ const gfx::Insets& client_area,
+ const std::vector<gfx::Rect>& additional_client_areas) {
+ DCHECK(tree_);
+ Window* window = window_tree_host->window();
+ 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::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);
« no previous file with comments | « ui/aura/mus/window_tree_client.h ('k') | ui/aura/mus/window_tree_host_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698