| OLD | NEW |
| 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/location_bar/plus_decoration.h" | 5 #import "chrome/browser/ui/cocoa/location_bar/plus_decoration.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/browser.h" | 7 #include "chrome/browser/ui/browser.h" |
| 8 #include "chrome/browser/ui/browser_window.h" | 8 #include "chrome/browser/ui/browser_window.h" |
| 9 #import "chrome/browser/ui/cocoa/location_bar/action_box_menu_bubble_controller.
h" | 9 #import "chrome/browser/ui/cocoa/location_bar/action_box_menu_bubble_controller.
h" |
| 10 #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h" | 10 #import "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h" |
| 11 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" | 11 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" |
| 12 #import "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h" | 12 #import "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h" |
| 13 #include "chrome/browser/ui/toolbar/action_box_menu_model.h" |
| 13 #include "grit/generated_resources.h" | 14 #include "grit/generated_resources.h" |
| 14 #include "grit/theme_resources.h" | 15 #include "grit/theme_resources.h" |
| 15 #include "ui/base/l10n/l10n_util_mac.h" | 16 #include "ui/base/l10n/l10n_util_mac.h" |
| 16 | 17 |
| 17 namespace { | 18 namespace { |
| 18 // The offset to apply to the menu so that it appears just attached to the | 19 // The offset to apply to the menu so that it appears just attached to the |
| 19 // right-hand side of the omnibox while slightly overlapping vertically. | 20 // right-hand side of the omnibox while slightly overlapping vertically. |
| 20 const CGFloat kAnchorPointXOffset = 1.0; | 21 const CGFloat kAnchorPointXOffset = 1.0; |
| 21 const CGFloat kAnchorPointYOffset = 2.0; | 22 const CGFloat kAnchorPointYOffset = 2.0; |
| 22 } // namespace | 23 } // namespace |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 anchoredAt:[parent convertBaseToScreen:GetActionBoxAnchorPoint()]]; | 77 anchoredAt:[parent convertBaseToScreen:GetActionBoxAnchorPoint()]]; |
| 77 | 78 |
| 78 [menu_controller showWindow:nil]; | 79 [menu_controller showWindow:nil]; |
| 79 } | 80 } |
| 80 | 81 |
| 81 void PlusDecoration::SetIcons(int normal_id, int hover_id, int pressed_id) { | 82 void PlusDecoration::SetIcons(int normal_id, int hover_id, int pressed_id) { |
| 82 SetNormalImage(OmniboxViewMac::ImageForResource(normal_id)); | 83 SetNormalImage(OmniboxViewMac::ImageForResource(normal_id)); |
| 83 SetHoverImage(OmniboxViewMac::ImageForResource(hover_id)); | 84 SetHoverImage(OmniboxViewMac::ImageForResource(hover_id)); |
| 84 SetPressedImage(OmniboxViewMac::ImageForResource(pressed_id)); | 85 SetPressedImage(OmniboxViewMac::ImageForResource(pressed_id)); |
| 85 } | 86 } |
| OLD | NEW |