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

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: Change to single repost and [NSWindow setMovableByWindowBackground]. 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 3118db8f5b27562e1a0f3f6e48196bb5c9596b35..63acaf060aa1048cbf29d3d692e12d666b90640d 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() {
@@ -62,6 +69,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