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

Side by Side Diff: chrome/browser/ui/cocoa/passwords/passwords_bubble_controller.mm

Issue 2717603003: [Mac] Make bubble arrow location/position RTL-aware (Closed)
Patch Set: Now with proper enum formatting 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
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 "chrome/browser/ui/cocoa/passwords/passwords_bubble_controller.h" 5 #import "chrome/browser/ui/cocoa/passwords/passwords_bubble_controller.h"
6 6
7 #include "base/mac/scoped_nsobject.h" 7 #include "base/mac/scoped_nsobject.h"
8 #include "chrome/browser/ui/browser_finder.h" 8 #include "chrome/browser/ui/browser_finder.h"
9 #import "chrome/browser/ui/cocoa/browser_window_controller.h" 9 #import "chrome/browser/ui/cocoa/browser_window_controller.h"
10 #import "chrome/browser/ui/cocoa/info_bubble_view.h" 10 #import "chrome/browser/ui/cocoa/info_bubble_view.h"
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 info_bubble::BubbleArrowLocation arrow; 111 info_bubble::BubbleArrowLocation arrow;
112 Browser* browser = chrome::FindBrowserWithWindow([self parentWindow]); 112 Browser* browser = chrome::FindBrowserWithWindow([self parentWindow]);
113 bool hasLocationBar = 113 bool hasLocationBar =
114 browser && browser->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR); 114 browser && browser->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR);
115 115
116 if (hasLocationBar) { 116 if (hasLocationBar) {
117 BrowserWindowController* controller = [BrowserWindowController 117 BrowserWindowController* controller = [BrowserWindowController
118 browserWindowControllerForWindow:[self parentWindow]]; 118 browserWindowControllerForWindow:[self parentWindow]];
119 anchorPoint = [controller locationBarBridge]->GetBubblePointForDecoration( 119 anchorPoint = [controller locationBarBridge]->GetBubblePointForDecoration(
120 [self decorationForBubble]); 120 [self decorationForBubble]);
121 arrow = info_bubble::kTopRight; 121 arrow = info_bubble::kTopTrailing;
122 } else { 122 } else {
123 // Center the bubble if there's no location bar. 123 // Center the bubble if there's no location bar.
124 NSRect contentFrame = [[[self parentWindow] contentView] frame]; 124 NSRect contentFrame = [[[self parentWindow] contentView] frame];
125 anchorPoint = NSMakePoint(NSMidX(contentFrame), NSMaxY(contentFrame)); 125 anchorPoint = NSMakePoint(NSMidX(contentFrame), NSMaxY(contentFrame));
126 arrow = info_bubble::kNoArrow; 126 arrow = info_bubble::kNoArrow;
127 } 127 }
128 128
129 // Update the anchor arrow. 129 // Update the anchor arrow.
130 [[self bubble] setArrowLocation:arrow]; 130 [[self bubble] setArrowLocation:arrow];
131 131
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 181
182 @end 182 @end
183 183
184 @implementation ManagePasswordsBubbleController (Testing) 184 @implementation ManagePasswordsBubbleController (Testing)
185 185
186 - (NSViewController*)currentController { 186 - (NSViewController*)currentController {
187 return currentController_.get(); 187 return currentController_.get();
188 } 188 }
189 189
190 @end 190 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/info_bubble_view.mm ('k') | chrome/browser/ui/cocoa/validation_message_bubble_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698