Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / browser / ui / cocoa / floating_bar_backing_view.mm
blob7f626f4a47152f4c55fc95ad1a8b85674025ecae
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
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/cocoa/floating_bar_backing_view.h"
7 #include "base/mac/mac_util.h"
8 #import "chrome/browser/ui/cocoa/framed_browser_window.h"
10 @implementation FloatingBarBackingView
12 - (void)drawRect:(NSRect)rect {
13   NSWindow* window = [self window];
14   BOOL isMainWindow = [window isMainWindow];
16   if (isMainWindow)
17     [[NSColor windowFrameColor] set];
18   else
19     [[NSColor windowBackgroundColor] set];
20   NSRectFill(rect);
22   [FramedBrowserWindow drawWindowThemeInDirtyRect:rect
23                                           forView:self
24                                            bounds:[self bounds]
25                              forceBlackBackground:YES];
29 // Eat all mouse events (and do *not* pass them on to the next responder!).
30 - (void)mouseDown:(NSEvent*)event {}
31 - (void)rightMouseDown:(NSEvent*)event {}
32 - (void)otherMouseDown:(NSEvent*)event {}
33 - (void)rightMouseUp:(NSEvent*)event {}
34 - (void)otherMouseUp:(NSEvent*)event {}
35 - (void)mouseMoved:(NSEvent*)event {}
36 - (void)mouseDragged:(NSEvent*)event {}
37 - (void)rightMouseDragged:(NSEvent*)event {}
38 - (void)otherMouseDragged:(NSEvent*)event {}
40 // Eat this too, except that ...
41 - (void)mouseUp:(NSEvent*)event {
42   // a double-click in the blank area should try to minimize, to be consistent
43   // with double-clicks on the contiguous tab strip area. (It'll fail and beep.)
44   if ([event clickCount] == 2 &&
45       base::mac::ShouldWindowsMiniaturizeOnDoubleClick())
46     [[self window] performMiniaturize:self];
49 @end  // @implementation FloatingBarBackingView