Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Side by Side Diff: chrome/browser/ui/views/location_bar/star_view.cc

Issue 2348853004: Remove non-md code in location bar (Views). (Closed)
Patch Set: resolve change collision Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/strings/utf_string_conversions.h"
9 #include "chrome/app/chrome_command_ids.h" 8 #include "chrome/app/chrome_command_ids.h"
10 #include "chrome/browser/bookmarks/bookmark_stats.h" 9 #include "chrome/browser/bookmarks/bookmark_stats.h"
11 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
12 #include "chrome/browser/ui/browser_commands.h" 11 #include "chrome/browser/ui/browser_commands.h"
13 #include "chrome/browser/ui/view_ids.h" 12 #include "chrome/browser/ui/view_ids.h"
14 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" 13 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h"
15 #include "chrome/grit/generated_resources.h" 14 #include "chrome/grit/generated_resources.h"
16 #include "chrome/grit/theme_resources.h"
17 #include "components/strings/grit/components_strings.h" 15 #include "components/strings/grit/components_strings.h"
18 #include "ui/base/l10n/l10n_util.h" 16 #include "ui/base/l10n/l10n_util.h"
19 #include "ui/base/material_design/material_design_controller.h"
20 #include "ui/base/resource/resource_bundle.h"
21 #include "ui/gfx/vector_icons_public.h" 17 #include "ui/gfx/vector_icons_public.h"
22 18
23 StarView::StarView(CommandUpdater* command_updater, Browser* browser) 19 StarView::StarView(CommandUpdater* command_updater, Browser* browser)
24 : BubbleIconView(command_updater, IDC_BOOKMARK_PAGE), browser_(browser) { 20 : BubbleIconView(command_updater, IDC_BOOKMARK_PAGE), browser_(browser) {
25 set_id(VIEW_ID_STAR_BUTTON); 21 set_id(VIEW_ID_STAR_BUTTON);
26 SetToggled(false); 22 SetToggled(false);
27 } 23 }
28 24
29 StarView::~StarView() {} 25 StarView::~StarView() {}
30 26
(...skipping 28 matching lines...) Expand all
59 chrome::BookmarkCurrentPageIgnoringExtensionOverrides(browser_); 55 chrome::BookmarkCurrentPageIgnoringExtensionOverrides(browser_);
60 } else { 56 } else {
61 BubbleIconView::ExecuteCommand(source); 57 BubbleIconView::ExecuteCommand(source);
62 } 58 }
63 } 59 }
64 60
65 views::BubbleDialogDelegateView* StarView::GetBubble() const { 61 views::BubbleDialogDelegateView* StarView::GetBubble() const {
66 return BookmarkBubbleView::bookmark_bubble(); 62 return BookmarkBubbleView::bookmark_bubble();
67 } 63 }
68 64
69 bool StarView::SetRasterIcon() {
70 if (ui::MaterialDesignController::IsModeMaterial())
71 return false;
72
73 SetImage(ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
74 active() ? IDR_STAR_LIT : IDR_STAR));
75 return true;
76 }
77
78 gfx::VectorIconId StarView::GetVectorIcon() const { 65 gfx::VectorIconId StarView::GetVectorIcon() const {
79 return active() ? gfx::VectorIconId::LOCATION_BAR_STAR_ACTIVE 66 return active() ? gfx::VectorIconId::LOCATION_BAR_STAR_ACTIVE
80 : gfx::VectorIconId::LOCATION_BAR_STAR; 67 : gfx::VectorIconId::LOCATION_BAR_STAR;
81 } 68 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/location_bar/star_view.h ('k') | chrome/browser/ui/views/omnibox/omnibox_result_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698