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

Side by Side Diff: chrome/browser/ui/panels/panel_titlebar_view_cocoa.mm

Issue 10106008: Change Panel titlebars to activate the panel on click (rather than minimize). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Mac changes. New test. Ready for review. Created 8 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/panels/panel_titlebar_view_cocoa.h" 5 #import "chrome/browser/ui/panels/panel_titlebar_view_cocoa.h"
6 6
7 #include <Carbon/Carbon.h> // kVK_Escape 7 #include <Carbon/Carbon.h> // kVK_Escape
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 } 55 }
56 56
57 @implementation PanelTitlebarOverlayView 57 @implementation PanelTitlebarOverlayView
58 // Sometimes we do not want to bring chrome window to foreground when we click 58 // Sometimes we do not want to bring chrome window to foreground when we click
59 // on any part of the titlebar. To do this, we first postpone the window 59 // on any part of the titlebar. To do this, we first postpone the window
60 // reorder here (shouldDelayWindowOrderingForEvent is called during when mouse 60 // reorder here (shouldDelayWindowOrderingForEvent is called during when mouse
61 // button is pressed but before mouseDown: is dispatched) and then complete 61 // button is pressed but before mouseDown: is dispatched) and then complete
62 // canceling the reorder by [NSApp preventWindowOrdering] in mouseDown handler 62 // canceling the reorder by [NSApp preventWindowOrdering] in mouseDown handler
63 // of this view. 63 // of this view.
64 - (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent*)theEvent { 64 - (BOOL)shouldDelayWindowOrderingForEvent:(NSEvent*)theEvent {
65 disableReordering_ = ![controller_ isActivationByClickingTitlebarEnabled]; 65 disableReordering_ = ![controller_ canBecomeKeyWindow];
66 return disableReordering_; 66 return disableReordering_;
67 } 67 }
68 68
69 - (void)mouseDown:(NSEvent*)event { 69 - (void)mouseDown:(NSEvent*)event {
70 if (disableReordering_) 70 if (disableReordering_)
71 [NSApp preventWindowOrdering]; 71 [NSApp preventWindowOrdering];
72 disableReordering_ = NO; 72 disableReordering_ = NO;
73 // Continue bubbling the event up the chain of responders. 73 // Continue bubbling the event up the chain of responders.
74 [super mouseDown:event]; 74 [super mouseDown:event];
75 } 75 }
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 - (void)cancelDragTitlebar { 630 - (void)cancelDragTitlebar {
631 [self endDrag:YES]; 631 [self endDrag:YES];
632 } 632 }
633 633
634 - (void)finishDragTitlebar { 634 - (void)finishDragTitlebar {
635 [self endDrag:NO]; 635 [self endDrag:NO];
636 } 636 }
637 637
638 @end 638 @end
639 639
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698