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 #include "chrome/browser/views/location_bar/star_view.h" | 5 #include "chrome/browser/views/location_bar/star_view.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "chrome/app/chrome_dll_resource.h" | 9 #include "chrome/app/chrome_dll_resource.h" |
10 #include "chrome/browser/command_updater.h" | 10 #include "chrome/browser/command_updater.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 } | 24 } |
25 | 25 |
26 void StarView::SetToggled(bool on) { | 26 void StarView::SetToggled(bool on) { |
27 SetTooltipText(l10n_util::GetString( | 27 SetTooltipText(l10n_util::GetString( |
28 on ? IDS_TOOLTIP_STARRED : IDS_TOOLTIP_STAR)); | 28 on ? IDS_TOOLTIP_STARRED : IDS_TOOLTIP_STAR)); |
29 // Since StarView is an ImageView, the SetTooltipText changes the accessible | 29 // Since StarView is an ImageView, the SetTooltipText changes the accessible |
30 // name. To keep the accessible name unchanged, we need to set the accessible | 30 // name. To keep the accessible name unchanged, we need to set the accessible |
31 // name right after we modify the tooltip text for this view. | 31 // name right after we modify the tooltip text for this view. |
32 SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_STAR)); | 32 SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_STAR)); |
33 SetImage(ResourceBundle::GetSharedInstance().GetBitmapNamed( | 33 SetImage(ResourceBundle::GetSharedInstance().GetBitmapNamed( |
34 on ? IDR_OMNIBOX_STAR_LIT : IDR_OMNIBOX_STAR)); | 34 on ? IDR_STAR_LIT : IDR_STAR)); |
35 } | 35 } |
36 | 36 |
37 bool StarView::GetAccessibleRole(AccessibilityTypes::Role* role) { | 37 bool StarView::GetAccessibleRole(AccessibilityTypes::Role* role) { |
38 *role = AccessibilityTypes::ROLE_PUSHBUTTON; | 38 *role = AccessibilityTypes::ROLE_PUSHBUTTON; |
39 return true; | 39 return true; |
40 } | 40 } |
41 | 41 |
42 bool StarView::GetTooltipText(const gfx::Point& p, std::wstring* tooltip) { | 42 bool StarView::GetTooltipText(const gfx::Point& p, std::wstring* tooltip) { |
43 // Don't show tooltip to distract user if BookmarkBubbleView is showing. | 43 // Don't show tooltip to distract user if BookmarkBubbleView is showing. |
44 if (browser::IsBookmarkBubbleViewShowing()) | 44 if (browser::IsBookmarkBubbleViewShowing()) |
(...skipping 22 matching lines...) Expand all Loading... |
67 return false; | 67 return false; |
68 } | 68 } |
69 | 69 |
70 void StarView::InfoBubbleClosing(InfoBubble* info_bubble, | 70 void StarView::InfoBubbleClosing(InfoBubble* info_bubble, |
71 bool closed_by_escape) { | 71 bool closed_by_escape) { |
72 } | 72 } |
73 | 73 |
74 bool StarView::CloseOnEscape() { | 74 bool StarView::CloseOnEscape() { |
75 return true; | 75 return true; |
76 } | 76 } |
OLD | NEW |