| 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/extension_toolbar_icon_surfacing_bub
ble_mac.h" | 5 #import "chrome/browser/ui/cocoa/extensions/extension_toolbar_icon_surfacing_bub
ble_mac.h" |
| 6 | 6 |
| 7 #include "base/mac/foundation_util.h" | 7 #include "base/mac/foundation_util.h" |
| 8 #import "chrome/browser/ui/cocoa/info_bubble_view.h" | 8 #import "chrome/browser/ui/cocoa/info_bubble_view.h" |
| 9 #import "chrome/browser/ui/cocoa/info_bubble_window.h" | 9 #import "chrome/browser/ui/cocoa/info_bubble_window.h" |
| 10 #include "chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h" | 10 #include "chrome/browser/ui/toolbar/toolbar_actions_bar_bubble_delegate.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 [window setCanBecomeKeyWindow:NO]; | 64 [window setCanBecomeKeyWindow:NO]; |
| 65 | 65 |
| 66 ui::NativeTheme* nativeTheme = ui::NativeTheme::instance(); | 66 ui::NativeTheme* nativeTheme = ui::NativeTheme::instance(); |
| 67 [[self bubble] setAlignment:info_bubble::kAlignRightEdgeToAnchorEdge]; | 67 [[self bubble] setAlignment:info_bubble::kAlignRightEdgeToAnchorEdge]; |
| 68 [[self bubble] setArrowLocation:info_bubble::kNoArrow]; | 68 [[self bubble] setArrowLocation:info_bubble::kNoArrow]; |
| 69 [[self bubble] setBackgroundColor: | 69 [[self bubble] setBackgroundColor: |
| 70 gfx::SkColorToCalibratedNSColor(nativeTheme->GetSystemColor( | 70 gfx::SkColorToCalibratedNSColor(nativeTheme->GetSystemColor( |
| 71 ui::NativeTheme::kColorId_DialogBackground))]; | 71 ui::NativeTheme::kColorId_DialogBackground))]; |
| 72 | 72 |
| 73 [self layout]; | 73 [self layout]; |
| 74 |
| 75 delegate_->OnToolbarActionsBarBubbleShown(); |
| 74 } | 76 } |
| 75 return self; | 77 return self; |
| 76 } | 78 } |
| 77 | 79 |
| 78 // Private ///////////////////////////////////////////////////////////////////// | 80 // Private ///////////////////////////////////////////////////////////////////// |
| 79 | 81 |
| 80 - (void)windowWillClose:(NSNotification*)notification { | 82 - (void)windowWillClose:(NSNotification*)notification { |
| 81 if (!acknowledged_) { | 83 if (!acknowledged_) { |
| 82 delegate_->OnToolbarActionsBarBubbleClosed( | 84 delegate_->OnToolbarActionsBarBubbleClosed( |
| 83 ToolbarActionsBarBubbleDelegate::DISMISSED); | 85 ToolbarActionsBarBubbleDelegate::DISMISSED); |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 [selectedTitle addAttribute:NSForegroundColorAttributeName | 223 [selectedTitle addAttribute:NSForegroundColorAttributeName |
| 222 value:selectedTitleColor | 224 value:selectedTitleColor |
| 223 range:NSMakeRange(0, [title length])]; | 225 range:NSMakeRange(0, [title length])]; |
| 224 | 226 |
| 225 [[self cell] drawTitle:selectedTitle.get() | 227 [[self cell] drawTitle:selectedTitle.get() |
| 226 withFrame:bounds | 228 withFrame:bounds |
| 227 inView:self]; | 229 inView:self]; |
| 228 } | 230 } |
| 229 | 231 |
| 230 @end | 232 @end |
| OLD | NEW |