| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/star_decoration.h" | 5 #import "chrome/browser/ui/cocoa/location_bar/star_decoration.h" |
| 6 | 6 |
| 7 #include "chrome/app/chrome_command_ids.h" | 7 #include "chrome/app/chrome_command_ids.h" |
| 8 #import "chrome/browser/autocomplete/autocomplete_edit_view_mac.h" | 8 #import "chrome/browser/autocomplete/autocomplete_edit_view_mac.h" |
| 9 #include "chrome/browser/command_updater.h" | 9 #include "chrome/browser/command_updater.h" |
| 10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 SetImage(AutocompleteEditViewMac::ImageForResource(image_id)); | 36 SetImage(AutocompleteEditViewMac::ImageForResource(image_id)); |
| 37 tooltip_.reset([l10n_util::GetNSStringWithFixup(tip_id) retain]); | 37 tooltip_.reset([l10n_util::GetNSStringWithFixup(tip_id) retain]); |
| 38 } | 38 } |
| 39 | 39 |
| 40 NSPoint StarDecoration::GetBubblePointInFrame(NSRect frame) { | 40 NSPoint StarDecoration::GetBubblePointInFrame(NSRect frame) { |
| 41 const NSRect draw_frame = GetDrawRectInFrame(frame); | 41 const NSRect draw_frame = GetDrawRectInFrame(frame); |
| 42 return NSMakePoint(NSMidX(draw_frame), | 42 return NSMakePoint(NSMidX(draw_frame), |
| 43 NSMaxY(draw_frame) - kStarPointYOffset); | 43 NSMaxY(draw_frame) - kStarPointYOffset); |
| 44 } | 44 } |
| 45 | 45 |
| 46 bool StarDecoration::AcceptsMousePress() { |
| 47 return true; |
| 48 } |
| 49 |
| 46 bool StarDecoration::OnMousePressed(NSRect frame) { | 50 bool StarDecoration::OnMousePressed(NSRect frame) { |
| 47 command_updater_->ExecuteCommand(IDC_BOOKMARK_PAGE); | 51 command_updater_->ExecuteCommand(IDC_BOOKMARK_PAGE); |
| 48 return true; | 52 return true; |
| 49 } | 53 } |
| 50 | 54 |
| 51 NSString* StarDecoration::GetToolTip() { | 55 NSString* StarDecoration::GetToolTip() { |
| 52 return tooltip_.get(); | 56 return tooltip_.get(); |
| 53 } | 57 } |
| OLD | NEW |