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

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

Issue 10800054: Add pin icon to the omnibar in windows 8 metro mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: linux tests Created 8 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/views/location_bar/metro_pin_view.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/ui/views/location_bar/metro_pin_view.h"
6
7 #include "base/utf_string_conversions.h"
8 #include "chrome/app/chrome_command_ids.h"
9 #include "chrome/browser/command_updater.h"
10 #include "chrome/browser/ui/view_ids.h"
11 #include "chrome/browser/ui/views/browser_dialogs.h"
12 #include "grit/generated_resources.h"
13 #include "grit/theme_resources.h"
14 #include "ui/base/accessibility/accessible_view_state.h"
15 #include "ui/base/l10n/l10n_util.h"
16 #include "ui/base/resource/resource_bundle.h"
17
18 MetroPinView::MetroPinView(CommandUpdater* command_updater)
19 : ALLOW_THIS_IN_INITIALIZER_LIST(ImageButton(this)),
20 command_updater_(command_updater) {
21 set_id(VIEW_ID_METRO_PIN);
22 SetImageAlignment(ALIGN_CENTER, ALIGN_MIDDLE);
23 SetAccessibleName(l10n_util::GetStringUTF16(IDS_ACCNAME_METRO_PIN));
24 TouchableLocationBarView::Init(this);
25 SetIsPinned(false);
26 }
27
28 MetroPinView::~MetroPinView() {}
29
30 void MetroPinView::SetIsPinned(bool is_pinned) {
31 SetTooltipText(l10n_util::GetStringUTF16(
32 is_pinned ? IDS_TOOLTIP_METRO_PINNED : IDS_TOOLTIP_METRO_PIN));
33 SetImage(BS_NORMAL, ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
34 is_pinned ? IDR_METRO_PINNED : IDR_METRO_PIN));
35 }
36
37 void MetroPinView::ButtonPressed(Button* sender, const views::Event& event) {
38 command_updater_->ExecuteCommand(IDC_METRO_PIN_TO_START_SCREEN);
39 }
40
41 int MetroPinView::GetBuiltInHorizontalPadding() const {
42 return GetBuiltInHorizontalPaddingImpl();
43 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/location_bar/metro_pin_view.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698