| 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.h" | 7 #include "base/metrics/histogram.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_stats.h" | 10 #include "chrome/browser/bookmarks/bookmark_stats.h" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 | 55 |
| 56 void StarView::ExecuteCommand(ExecuteSource source) { | 56 void StarView::ExecuteCommand(ExecuteSource source) { |
| 57 if (browser_) { | 57 if (browser_) { |
| 58 OnExecuting(source); | 58 OnExecuting(source); |
| 59 chrome::BookmarkCurrentPageIgnoringExtensionOverrides(browser_); | 59 chrome::BookmarkCurrentPageIgnoringExtensionOverrides(browser_); |
| 60 } else { | 60 } else { |
| 61 BubbleIconView::ExecuteCommand(source); | 61 BubbleIconView::ExecuteCommand(source); |
| 62 } | 62 } |
| 63 } | 63 } |
| 64 | 64 |
| 65 views::BubbleDelegateView* StarView::GetBubble() const { | 65 views::BubbleDialogDelegateView* StarView::GetBubble() const { |
| 66 return BookmarkBubbleView::bookmark_bubble(); | 66 return BookmarkBubbleView::bookmark_bubble(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 bool StarView::SetRasterIcon() { | 69 bool StarView::SetRasterIcon() { |
| 70 if (ui::MaterialDesignController::IsModeMaterial()) | 70 if (ui::MaterialDesignController::IsModeMaterial()) |
| 71 return false; | 71 return false; |
| 72 | 72 |
| 73 SetImage(ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( | 73 SetImage(ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed( |
| 74 active() ? IDR_STAR_LIT : IDR_STAR)); | 74 active() ? IDR_STAR_LIT : IDR_STAR)); |
| 75 return true; | 75 return true; |
| 76 } | 76 } |
| 77 | 77 |
| 78 gfx::VectorIconId StarView::GetVectorIcon() const { | 78 gfx::VectorIconId StarView::GetVectorIcon() const { |
| 79 return active() ? gfx::VectorIconId::LOCATION_BAR_STAR_ACTIVE | 79 return active() ? gfx::VectorIconId::LOCATION_BAR_STAR_ACTIVE |
| 80 : gfx::VectorIconId::LOCATION_BAR_STAR; | 80 : gfx::VectorIconId::LOCATION_BAR_STAR; |
| 81 } | 81 } |
| OLD | NEW |