| 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 #include "chrome/browser/ui/views/location_bar/star_view.h" | 5 #include "chrome/browser/ui/views/location_bar/star_view.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
| 8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
| 9 #include "chrome/browser/bookmarks/bookmark_stats.h" | 9 #include "chrome/browser/bookmarks/bookmark_stats.h" |
| 10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
| 11 #include "chrome/browser/ui/browser_commands.h" | 11 #include "chrome/browser/ui/browser_commands.h" |
| 12 #include "chrome/browser/ui/view_ids.h" | 12 #include "chrome/browser/ui/view_ids.h" |
| 13 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" | 13 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" |
| 14 #include "chrome/grit/generated_resources.h" | 14 #include "chrome/grit/generated_resources.h" |
| 15 #include "components/strings/grit/components_strings.h" | 15 #include "components/strings/grit/components_strings.h" |
| 16 #include "components/toolbar/vector_icons.h" |
| 16 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
| 17 #include "ui/gfx/vector_icons_public.h" | 18 #include "ui/gfx/vector_icons_public.h" |
| 18 | 19 |
| 19 StarView::StarView(CommandUpdater* command_updater, Browser* browser) | 20 StarView::StarView(CommandUpdater* command_updater, Browser* browser) |
| 20 : BubbleIconView(command_updater, IDC_BOOKMARK_PAGE), browser_(browser) { | 21 : BubbleIconView(command_updater, IDC_BOOKMARK_PAGE), browser_(browser) { |
| 21 set_id(VIEW_ID_STAR_BUTTON); | 22 set_id(VIEW_ID_STAR_BUTTON); |
| 22 SetToggled(false); | 23 SetToggled(false); |
| 23 } | 24 } |
| 24 | 25 |
| 25 StarView::~StarView() {} | 26 StarView::~StarView() {} |
| (...skipping 29 matching lines...) Expand all Loading... |
| 55 chrome::BookmarkCurrentPageIgnoringExtensionOverrides(browser_); | 56 chrome::BookmarkCurrentPageIgnoringExtensionOverrides(browser_); |
| 56 } else { | 57 } else { |
| 57 BubbleIconView::ExecuteCommand(source); | 58 BubbleIconView::ExecuteCommand(source); |
| 58 } | 59 } |
| 59 } | 60 } |
| 60 | 61 |
| 61 views::BubbleDialogDelegateView* StarView::GetBubble() const { | 62 views::BubbleDialogDelegateView* StarView::GetBubble() const { |
| 62 return BookmarkBubbleView::bookmark_bubble(); | 63 return BookmarkBubbleView::bookmark_bubble(); |
| 63 } | 64 } |
| 64 | 65 |
| 65 gfx::VectorIconId StarView::GetVectorIcon() const { | 66 const gfx::VectorIcon& StarView::GetVectorIcon() const { |
| 66 return active() ? gfx::VectorIconId::LOCATION_BAR_STAR_ACTIVE | 67 return active() ? toolbar::kStarActiveIcon : toolbar::kStarIcon; |
| 67 : gfx::VectorIconId::LOCATION_BAR_STAR; | |
| 68 } | 68 } |
| OLD | NEW |