Index: chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash.cc |
diff --git a/chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash.cc b/chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash.cc |
index 718bbe92d49cb191aff3b2ca46c6d7ab47be8597..97a16cf253535cb2766d0aab785c0f034c8790cb 100644 |
--- a/chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash.cc |
+++ b/chrome/browser/ui/views/apps/chrome_native_app_window_views_aura_ash.cc |
@@ -28,6 +28,14 @@ |
#include "ui/views/controls/menu/menu_runner.h" |
#include "ui/views/widget/widget.h" |
+#if defined(MOJO_SHELL_CLIENT) |
+#include "components/mus/public/cpp/property_type_converters.h" |
+#include "components/mus/public/cpp/window.h" |
+#include "components/mus/public/interfaces/window_manager.mojom.h" |
+#include "ui/aura/mus/mus_util.h" |
+#include "ui/gfx/skia_util.h" |
+#endif |
+ |
using extensions::AppWindow; |
namespace { |
@@ -140,6 +148,11 @@ void ChromeNativeAppWindowViewsAuraAsh::OnBeforeWidgetInit( |
ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), |
James Cook
2016/06/14 23:44:56
aside: This is going to need to get fixed someday
msw
2016/06/15 17:06:40
Acknowledged.
|
ash::kShellWindowId_ImeWindowParentContainer); |
} |
+#if defined(MOJO_SHELL_CLIENT) |
+ init_params->mus_properties |
+ [mus::mojom::WindowManager::kRemoveStandardFrame_Property] = |
+ mojo::ConvertTo<std::vector<uint8_t>>(init_params->remove_standard_frame); |
+#endif |
} |
void ChromeNativeAppWindowViewsAuraAsh::OnBeforePanelWidgetInit( |
@@ -312,3 +325,27 @@ void ChromeNativeAppWindowViewsAuraAsh::SetFullscreen(int fullscreen_types) { |
ash::Shell::GetInstance()->UpdateShelfVisibility(); |
} |
} |
+ |
+void ChromeNativeAppWindowViewsAuraAsh::UpdateDraggableRegions( |
+ const std::vector<extensions::DraggableRegion>& regions) { |
+ ChromeNativeAppWindowViewsAura::UpdateDraggableRegions(regions); |
+ |
+#if defined(MOJO_SHELL_CLIENT) |
+ // Set the NativeAppWindow's draggable region on the mus window. |
+ if (widget() && GetMusWindow(widget()->GetNativeWindow())) { |
+ // Supply client area insets that encompass all draggable regions. |
+ gfx::Insets insets(GetDraggableRegion()->getBounds().bottom(), 0, 0, 0); |
James Cook
2016/06/14 23:44:56
Can GetDraggableRegion return null? I think it can
msw
2016/06/15 17:06:41
Done.
|
+ |
+ // Invert the draggable regions to determine the additional client areas. |
+ SkRegion inverted_region; |
+ inverted_region.setRect(GetDraggableRegion()->getBounds()); |
James Cook
2016/06/14 23:44:56
optional: Cache GetDraggableRegion result, since y
msw
2016/06/15 17:06:41
Done.
|
+ inverted_region.op(*GetDraggableRegion(), SkRegion::kDifference_Op); |
+ std::vector<gfx::Rect> additional_client_regions; |
+ for (SkRegion::Iterator i(inverted_region); !i.done(); i.next()) |
+ additional_client_regions.push_back(gfx::SkIRectToRect(i.rect())); |
+ |
+ GetMusWindow(widget()->GetNativeWindow()) |
+ ->SetClientArea(insets, std::move(additional_client_regions)); |
+ } |
+#endif |
+} |