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

Unified Diff: chrome/browser/ui/views/apps/chrome_native_app_window_views_mac.mm

Issue 1146873002: [MacViews] Enable dragging a window by its caption/draggable areas. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync and rebase Created 5 years, 7 months 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
Index: chrome/browser/ui/views/apps/chrome_native_app_window_views_mac.mm
diff --git a/chrome/browser/ui/views/apps/chrome_native_app_window_views_mac.mm b/chrome/browser/ui/views/apps/chrome_native_app_window_views_mac.mm
index d99a1c910dda9fd8f1e3c323e7cbad612ca73b7c..61e9657bc866338e7cfc0bf45c5620978df9974c 100644
--- a/chrome/browser/ui/views/apps/chrome_native_app_window_views_mac.mm
+++ b/chrome/browser/ui/views/apps/chrome_native_app_window_views_mac.mm
@@ -4,9 +4,16 @@
#import "chrome/browser/ui/views/apps/chrome_native_app_window_views_mac.h"
+#import <Cocoa/Cocoa.h>
+
+#import "base/mac/scoped_nsobject.h"
#include "chrome/browser/apps/app_shim/extension_app_shim_handler_mac.h"
-#include "chrome/browser/ui/views/apps/app_window_native_widget_mac.h"
-#include "chrome/browser/ui/views/apps/native_app_window_frame_view_mac.h"
+#import "chrome/browser/ui/views/apps/app_window_native_widget_mac.h"
+#import "chrome/browser/ui/views/apps/native_app_window_frame_view_mac.h"
+
+@interface NSView (WebContentsView)
+- (void)setMouseDownCanMoveWindow:(BOOL)can_move;
+@end
ChromeNativeAppWindowViewsMac::ChromeNativeAppWindowViewsMac()
: is_hidden_with_app_(false) {
@@ -28,12 +35,12 @@ void ChromeNativeAppWindowViewsMac::OnBeforeWidgetInit(
views::NonClientFrameView*
ChromeNativeAppWindowViewsMac::CreateStandardDesktopAppFrame() {
- return new NativeAppWindowFrameViewMac(widget());
+ return new NativeAppWindowFrameViewMac(widget(), this);
}
views::NonClientFrameView*
ChromeNativeAppWindowViewsMac::CreateNonStandardAppFrame() {
- return new NativeAppWindowFrameViewMac(widget());
+ return new NativeAppWindowFrameViewMac(widget(), this);
}
void ChromeNativeAppWindowViewsMac::Show() {
@@ -59,6 +66,14 @@ void ChromeNativeAppWindowViewsMac::FlashFrame(bool flash) {
: apps::APP_SHIM_ATTENTION_CANCEL);
}
+void ChromeNativeAppWindowViewsMac::UpdateDraggableRegions(
+ const std::vector<extensions::DraggableRegion>& regions) {
+ ChromeNativeAppWindowViews::UpdateDraggableRegions(regions);
+
+ NSView* web_contents_view = app_window()->web_contents()->GetNativeView();
+ [web_contents_view setMouseDownCanMoveWindow:YES];
+}
+
void ChromeNativeAppWindowViewsMac::ShowWithApp() {
is_hidden_with_app_ = false;
if (!app_window()->is_hidden())

Powered by Google App Engine
This is Rietveld 408576698