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

Side by Side Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm

Issue 1162393003: Replace info_bubble::BubbleArrowLocation with views::BubbleBorder::Arrow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile in test Created 5 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 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/bookmarks/bookmark_bubble_controller.h" 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.h"
6 6
7 #include "base/mac/bundle_locations.h" 7 #include "base/mac/bundle_locations.h"
8 #include "base/strings/sys_string_conversions.h" 8 #include "base/strings/sys_string_conversions.h"
9 #include "chrome/browser/bookmarks/chrome_bookmark_client.h" 9 #include "chrome/browser/bookmarks/chrome_bookmark_client.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 // Override -[BaseBubbleController showWindow:] to tweak bubble location and 167 // Override -[BaseBubbleController showWindow:] to tweak bubble location and
168 // set up UI elements. 168 // set up UI elements.
169 - (void)showWindow:(id)sender { 169 - (void)showWindow:(id)sender {
170 NSWindow* window = [self window]; // Force load the NIB. 170 NSWindow* window = [self window]; // Force load the NIB.
171 NSWindow* parentWindow = self.parentWindow; 171 NSWindow* parentWindow = self.parentWindow;
172 BrowserWindowController* bwc = 172 BrowserWindowController* bwc =
173 [BrowserWindowController browserWindowControllerForWindow:parentWindow]; 173 [BrowserWindowController browserWindowControllerForWindow:parentWindow];
174 [bwc lockBarVisibilityForOwner:self withAnimation:NO delay:NO]; 174 [bwc lockBarVisibilityForOwner:self withAnimation:NO delay:NO];
175 175
176 InfoBubbleView* bubble = self.bubble; 176 InfoBubbleView* bubble = self.bubble;
177 [bubble setArrowLocation:info_bubble::kTopRight]; 177 [bubble setArrowLocation:views::BubbleBorder::TOP_RIGHT];
178 178
179 // Insure decent positioning even in the absence of a browser controller, 179 // Insure decent positioning even in the absence of a browser controller,
180 // which will occur for some unit tests. 180 // which will occur for some unit tests.
181 NSPoint arrowTip = bwc ? [bwc bookmarkBubblePoint] : 181 NSPoint arrowTip = bwc ? [bwc bookmarkBubblePoint] :
182 NSMakePoint([window frame].size.width, [window frame].size.height); 182 NSMakePoint([window frame].size.width, [window frame].size.height);
183 arrowTip = [parentWindow convertBaseToScreen:arrowTip]; 183 arrowTip = [parentWindow convertBaseToScreen:arrowTip];
184 NSPoint bubbleArrowTip = [bubble arrowTip]; 184 NSPoint bubbleArrowTip = [bubble arrowTip];
185 bubbleArrowTip = [bubble convertPoint:bubbleArrowTip toView:nil]; 185 bubbleArrowTip = [bubble convertPoint:bubbleArrowTip toView:nil];
186 arrowTip.y -= bubbleArrowTip.y; 186 arrowTip.y -= bubbleArrowTip.y;
187 arrowTip.x -= bubbleArrowTip.x; 187 arrowTip.x -= bubbleArrowTip.x;
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 NSInteger idx = [menu indexOfItemWithRepresentedObject:parentValue]; 403 NSInteger idx = [menu indexOfItemWithRepresentedObject:parentValue];
404 DCHECK(idx != -1); 404 DCHECK(idx != -1);
405 [folderPopUpButton_ selectItemAtIndex:idx]; 405 [folderPopUpButton_ selectItemAtIndex:idx];
406 } 406 }
407 407
408 - (NSPopUpButton*)folderPopUpButton { 408 - (NSPopUpButton*)folderPopUpButton {
409 return folderPopUpButton_; 409 return folderPopUpButton_;
410 } 410 }
411 411
412 @end // implementation BookmarkBubbleController(ExposedForUnitTesting) 412 @end // implementation BookmarkBubbleController(ExposedForUnitTesting)
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/base_bubble_controller_unittest.mm ('k') | chrome/browser/ui/cocoa/browser/zoom_bubble_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698