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

Side by Side Diff: chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_mac.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/extensions/toolbar_actions_bar_bubble_mac.h" 5 #import "chrome/browser/ui/cocoa/extensions/toolbar_actions_bar_bubble_mac.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/mac/foundation_util.h" 9 #include "base/mac/foundation_util.h"
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 defer:NO]); 80 defer:NO]);
81 if ((self = [super initWithWindow:window 81 if ((self = [super initWithWindow:window
82 parentWindow:parentWindow 82 parentWindow:parentWindow
83 anchoredAt:anchorPoint])) { 83 anchoredAt:anchorPoint])) {
84 acknowledged_ = NO; 84 acknowledged_ = NO;
85 anchoredToAction_ = anchoredToAction; 85 anchoredToAction_ = anchoredToAction;
86 delegate_ = std::move(delegate); 86 delegate_ = std::move(delegate);
87 87
88 ui::NativeTheme* nativeTheme = ui::NativeTheme::GetInstanceForNativeUi(); 88 ui::NativeTheme* nativeTheme = ui::NativeTheme::GetInstanceForNativeUi();
89 [[self bubble] setAlignment:info_bubble::kAlignArrowToAnchor]; 89 [[self bubble] setAlignment:info_bubble::kAlignArrowToAnchor];
90 [[self bubble] setArrowLocation:info_bubble::kTopRight]; 90 [[self bubble] setArrowLocation:info_bubble::kTopTrailing];
91 [[self bubble] setBackgroundColor: 91 [[self bubble] setBackgroundColor:
92 skia::SkColorToCalibratedNSColor(nativeTheme->GetSystemColor( 92 skia::SkColorToCalibratedNSColor(nativeTheme->GetSystemColor(
93 ui::NativeTheme::kColorId_DialogBackground))]; 93 ui::NativeTheme::kColorId_DialogBackground))];
94 94
95 if (!g_animations_enabled) 95 if (!g_animations_enabled)
96 [window setAllowedAnimations:info_bubble::kAnimateNone]; 96 [window setAllowedAnimations:info_bubble::kAnimateNone];
97 97
98 [self setShouldCloseOnResignKey:delegate_->ShouldCloseOnDeactivate()]; 98 [self setShouldCloseOnResignKey:delegate_->ShouldCloseOnDeactivate()];
99 99
100 [self layout]; 100 [self layout];
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
389 } else { 389 } else {
390 DCHECK_EQ(sender, actionButton_); 390 DCHECK_EQ(sender, actionButton_);
391 action = ToolbarActionsBarBubbleDelegate::CLOSE_EXECUTE; 391 action = ToolbarActionsBarBubbleDelegate::CLOSE_EXECUTE;
392 } 392 }
393 acknowledged_ = YES; 393 acknowledged_ = YES;
394 delegate_->OnBubbleClosed(action); 394 delegate_->OnBubbleClosed(action);
395 [self close]; 395 [self close];
396 } 396 }
397 397
398 @end 398 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698