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

Side by Side Diff: ui/views/widget/native_widget_mac.mm

Issue 322893005: MacViews: Add WidgetEventGenerator to abstract platform-specific event generation for tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cull orthogonal stuff, add WidgetTest.MouseEventTypesViaGenerator Created 6 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "ui/views/widget/native_widget_mac.h" 5 #include "ui/views/widget/native_widget_mac.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "base/mac/scoped_nsobject.h" 9 #include "base/mac/scoped_nsobject.h"
10 #include "ui/gfx/font_list.h" 10 #include "ui/gfx/font_list.h"
(...skipping 22 matching lines...) Expand all
33 NSMakeRect(0, 0, params.bounds.width(), params.bounds.height()); 33 NSMakeRect(0, 0, params.bounds.width(), params.bounds.height());
34 // TODO(tapted): Determine a good initial style mask from |params|. 34 // TODO(tapted): Determine a good initial style mask from |params|.
35 NSInteger style_mask = NSTitledWindowMask | NSClosableWindowMask | 35 NSInteger style_mask = NSTitledWindowMask | NSClosableWindowMask |
36 NSMiniaturizableWindowMask | NSResizableWindowMask; 36 NSMiniaturizableWindowMask | NSResizableWindowMask;
37 base::scoped_nsobject<NSWindow> window( 37 base::scoped_nsobject<NSWindow> window(
38 [[NSWindow alloc] initWithContentRect:content_rect 38 [[NSWindow alloc] initWithContentRect:content_rect
39 styleMask:style_mask 39 styleMask:style_mask
40 backing:NSBackingStoreBuffered 40 backing:NSBackingStoreBuffered
41 defer:NO]); 41 defer:NO]);
42 bridge_->Init(window); 42 bridge_->Init(window);
43 delegate_->OnNativeWidgetCreated(true);
43 } 44 }
44 45
45 NonClientFrameView* NativeWidgetMac::CreateNonClientFrameView() { 46 NonClientFrameView* NativeWidgetMac::CreateNonClientFrameView() {
46 return NULL; 47 return NULL;
47 } 48 }
48 49
49 bool NativeWidgetMac::ShouldUseNativeFrame() const { 50 bool NativeWidgetMac::ShouldUseNativeFrame() const {
50 return false; 51 return false;
51 } 52 }
52 53
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after
417 } 418 }
418 419
419 // static 420 // static
420 void NativeWidgetPrivate::ReparentNativeView(gfx::NativeView native_view, 421 void NativeWidgetPrivate::ReparentNativeView(gfx::NativeView native_view,
421 gfx::NativeView new_parent) { 422 gfx::NativeView new_parent) {
422 NOTIMPLEMENTED(); 423 NOTIMPLEMENTED();
423 } 424 }
424 425
425 // static 426 // static
426 bool NativeWidgetPrivate::IsMouseButtonDown() { 427 bool NativeWidgetPrivate::IsMouseButtonDown() {
427 NOTIMPLEMENTED(); 428 return [NSEvent pressedMouseButtons] != 0;
428 return false;
429 } 429 }
430 430
431 // static 431 // static
432 bool NativeWidgetPrivate::IsTouchDown() { 432 bool NativeWidgetPrivate::IsTouchDown() {
433 NOTIMPLEMENTED(); 433 NOTIMPLEMENTED();
434 return false; 434 return false;
435 } 435 }
436 436
437 // static 437 // static
438 gfx::FontList NativeWidgetPrivate::GetWindowTitleFontList() { 438 gfx::FontList NativeWidgetPrivate::GetWindowTitleFontList() {
439 NOTIMPLEMENTED(); 439 NOTIMPLEMENTED();
440 return gfx::FontList(); 440 return gfx::FontList();
441 } 441 }
442 442
443 } // namespace internal 443 } // namespace internal
444 } // namespace views 444 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698