| OLD | NEW |
| 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 "base/mac/foundation_util.h" | 7 #include "base/mac/foundation_util.h" |
| 8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
| 9 #import "chrome/browser/ui/cocoa/info_bubble_view.h" | 9 #import "chrome/browser/ui/cocoa/info_bubble_view.h" |
| 10 #import "chrome/browser/ui/cocoa/info_bubble_window.h" | 10 #import "chrome/browser/ui/cocoa/info_bubble_window.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 if ((self = [super initWithWindow:window | 72 if ((self = [super initWithWindow:window |
| 73 parentWindow:parentWindow | 73 parentWindow:parentWindow |
| 74 anchoredAt:anchorPoint])) { | 74 anchoredAt:anchorPoint])) { |
| 75 acknowledged_ = NO; | 75 acknowledged_ = NO; |
| 76 delegate_ = delegate.Pass(); | 76 delegate_ = delegate.Pass(); |
| 77 | 77 |
| 78 ui::NativeTheme* nativeTheme = ui::NativeThemeMac::instance(); | 78 ui::NativeTheme* nativeTheme = ui::NativeThemeMac::instance(); |
| 79 [[self bubble] setAlignment:info_bubble::kAlignArrowToAnchor]; | 79 [[self bubble] setAlignment:info_bubble::kAlignArrowToAnchor]; |
| 80 [[self bubble] setArrowLocation:info_bubble::kTopRight]; | 80 [[self bubble] setArrowLocation:info_bubble::kTopRight]; |
| 81 [[self bubble] setBackgroundColor: | 81 [[self bubble] setBackgroundColor: |
| 82 gfx::SkColorToCalibratedNSColor(nativeTheme->GetSystemColor( | 82 skia::SkColorToCalibratedNSColor(nativeTheme->GetSystemColor( |
| 83 ui::NativeTheme::kColorId_DialogBackground))]; | 83 ui::NativeTheme::kColorId_DialogBackground))]; |
| 84 | 84 |
| 85 if (!g_animations_enabled) | 85 if (!g_animations_enabled) |
| 86 [window setAllowedAnimations:info_bubble::kAnimateNone]; | 86 [window setAllowedAnimations:info_bubble::kAnimateNone]; |
| 87 | 87 |
| 88 [self layout]; | 88 [self layout]; |
| 89 | 89 |
| 90 [[self window] makeFirstResponder: | 90 [[self window] makeFirstResponder: |
| 91 (actionButton_ ? actionButton_ : dismissButton_)]; | 91 (actionButton_ ? actionButton_ : dismissButton_)]; |
| 92 } | 92 } |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 } else { | 332 } else { |
| 333 DCHECK_EQ(sender, actionButton_); | 333 DCHECK_EQ(sender, actionButton_); |
| 334 action = ToolbarActionsBarBubbleDelegate::CLOSE_EXECUTE; | 334 action = ToolbarActionsBarBubbleDelegate::CLOSE_EXECUTE; |
| 335 } | 335 } |
| 336 acknowledged_ = YES; | 336 acknowledged_ = YES; |
| 337 delegate_->OnBubbleClosed(action); | 337 delegate_->OnBubbleClosed(action); |
| 338 [self close]; | 338 [self close]; |
| 339 } | 339 } |
| 340 | 340 |
| 341 @end | 341 @end |
| OLD | NEW |