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

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

Issue 2735723003: MacViews: Don't switch Spaces when calling ShowInactive() for a child Widget. (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « ui/views/cocoa/bridged_native_widget.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #import "ui/views/widget/native_widget_mac.h" 5 #import "ui/views/widget/native_widget_mac.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #import "base/mac/foundation_util.h" 9 #import "base/mac/foundation_util.h"
10 #include "base/mac/mac_util.h" 10 #include "base/mac/mac_util.h"
(...skipping 1357 matching lines...) Expand 10 before | Expand all | Expand 10 after
1368 EXPECT_TRUE([dialog_widget->GetNativeWindow() canBecomeKeyWindow]); 1368 EXPECT_TRUE([dialog_widget->GetNativeWindow() canBecomeKeyWindow]);
1369 // Dialogs shouldn't take main status away from their parent. 1369 // Dialogs shouldn't take main status away from their parent.
1370 EXPECT_FALSE([dialog_widget->GetNativeWindow() canBecomeMainWindow]); 1370 EXPECT_FALSE([dialog_widget->GetNativeWindow() canBecomeMainWindow]);
1371 1371
1372 // Create a bubble widget with a parent: also shouldn't get main. 1372 // Create a bubble widget with a parent: also shouldn't get main.
1373 BubbleDialogDelegateView* bubble_view = new SimpleBubbleView(); 1373 BubbleDialogDelegateView* bubble_view = new SimpleBubbleView();
1374 bubble_view->set_parent_window(regular_widget->GetNativeView()); 1374 bubble_view->set_parent_window(regular_widget->GetNativeView());
1375 Widget* bubble_widget = BubbleDialogDelegateView::CreateBubble(bubble_view); 1375 Widget* bubble_widget = BubbleDialogDelegateView::CreateBubble(bubble_view);
1376 EXPECT_TRUE([bubble_widget->GetNativeWindow() canBecomeKeyWindow]); 1376 EXPECT_TRUE([bubble_widget->GetNativeWindow() canBecomeKeyWindow]);
1377 EXPECT_FALSE([bubble_widget->GetNativeWindow() canBecomeMainWindow]); 1377 EXPECT_FALSE([bubble_widget->GetNativeWindow() canBecomeMainWindow]);
1378 EXPECT_EQ(NSWindowCollectionBehaviorTransient,
1379 [bubble_widget->GetNativeWindow() collectionBehavior] &
1380 NSWindowCollectionBehaviorTransient);
1378 1381
1379 // But a bubble without a parent should still be able to become main. 1382 // But a bubble without a parent should still be able to become main.
1380 Widget* toplevel_bubble_widget = 1383 Widget* toplevel_bubble_widget =
1381 BubbleDialogDelegateView::CreateBubble(new SimpleBubbleView()); 1384 BubbleDialogDelegateView::CreateBubble(new SimpleBubbleView());
1382 EXPECT_TRUE([toplevel_bubble_widget->GetNativeWindow() canBecomeKeyWindow]); 1385 EXPECT_TRUE([toplevel_bubble_widget->GetNativeWindow() canBecomeKeyWindow]);
1383 EXPECT_TRUE([toplevel_bubble_widget->GetNativeWindow() canBecomeMainWindow]); 1386 EXPECT_TRUE([toplevel_bubble_widget->GetNativeWindow() canBecomeMainWindow]);
1384 1387
1385 toplevel_bubble_widget->CloseNow(); 1388 toplevel_bubble_widget->CloseNow();
1386 regular_widget->CloseNow(); 1389 regular_widget->CloseNow();
1387 } 1390 }
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
1928 1931
1929 - (void)dealloc { 1932 - (void)dealloc {
1930 if (deallocFlag_) { 1933 if (deallocFlag_) {
1931 DCHECK(!*deallocFlag_); 1934 DCHECK(!*deallocFlag_);
1932 *deallocFlag_ = true; 1935 *deallocFlag_ = true;
1933 } 1936 }
1934 [super dealloc]; 1937 [super dealloc];
1935 } 1938 }
1936 1939
1937 @end 1940 @end
OLDNEW
« no previous file with comments | « ui/views/cocoa/bridged_native_widget.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698