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

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

Issue 1063933003: MacViews: Allow views::Widgets to be parented off NSWindows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20150401-MacViews-AppInfo-Standalone
Patch Set: respond to comments 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 unified diff | Download patch
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/foundation_util.h" 9 #include "base/mac/foundation_util.h"
10 #include "base/mac/scoped_nsobject.h" 10 #include "base/mac/scoped_nsobject.h"
(...skipping 562 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 } 573 }
574 return NULL; // Not created by NativeWidgetMac. 574 return NULL; // Not created by NativeWidgetMac.
575 } 575 }
576 576
577 // static 577 // static
578 NativeWidgetPrivate* NativeWidgetPrivate::GetTopLevelNativeWidget( 578 NativeWidgetPrivate* NativeWidgetPrivate::GetTopLevelNativeWidget(
579 gfx::NativeView native_view) { 579 gfx::NativeView native_view) {
580 BridgedNativeWidget* bridge = 580 BridgedNativeWidget* bridge =
581 NativeWidgetMac::GetBridgeForNativeWindow([native_view window]); 581 NativeWidgetMac::GetBridgeForNativeWindow([native_view window]);
582 if (!bridge) 582 if (!bridge)
583 return NULL; 583 return nullptr;
584 584
585 for (BridgedNativeWidget* parent; 585 NativeWidgetPrivate* ancestor =
586 (parent = bridge->parent()); 586 bridge->parent() ? GetTopLevelNativeWidget(
587 bridge = parent) { 587 [bridge->parent()->GetNSWindow() contentView])
588 } 588 : nullptr;
589 return bridge->native_widget_mac(); 589 return ancestor ? ancestor : bridge->native_widget_mac();
590 } 590 }
591 591
592 // static 592 // static
593 void NativeWidgetPrivate::GetAllChildWidgets(gfx::NativeView native_view, 593 void NativeWidgetPrivate::GetAllChildWidgets(gfx::NativeView native_view,
594 Widget::Widgets* children) { 594 Widget::Widgets* children) {
595 BridgedNativeWidget* bridge = 595 BridgedNativeWidget* bridge =
596 NativeWidgetMac::GetBridgeForNativeWindow([native_view window]); 596 NativeWidgetMac::GetBridgeForNativeWindow([native_view window]);
597 if (!bridge) 597 if (!bridge)
598 return; 598 return;
599 599
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 } 632 }
633 633
634 // static 634 // static
635 gfx::FontList NativeWidgetPrivate::GetWindowTitleFontList() { 635 gfx::FontList NativeWidgetPrivate::GetWindowTitleFontList() {
636 NOTIMPLEMENTED(); 636 NOTIMPLEMENTED();
637 return gfx::FontList(); 637 return gfx::FontList();
638 } 638 }
639 639
640 } // namespace internal 640 } // namespace internal
641 } // namespace views 641 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698