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

Side by Side Diff: ui/message_center/views/padded_button.cc

Issue 2729533002: Adjust behavior of control buttons of notifications. (Closed)
Patch Set: Add unimplemented method to TestContentViewDelegate Created 3 years, 9 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
« no previous file with comments | « ui/message_center/views/padded_button.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ui/message_center/views/padded_button.h" 5 #include "ui/message_center/views/padded_button.h"
6 6
7 #include "ui/base/resource/resource_bundle.h" 7 #include "ui/base/resource/resource_bundle.h"
8 #include "ui/gfx/canvas.h" 8 #include "ui/gfx/canvas.h"
9 #include "ui/message_center/message_center_style.h" 9 #include "ui/message_center/message_center_style.h"
10 #include "ui/views/animation/flood_fill_ink_drop_ripple.h"
11 #include "ui/views/animation/ink_drop_impl.h"
12 #include "ui/views/background.h"
10 #include "ui/views/border.h" 13 #include "ui/views/border.h"
11 #include "ui/views/controls/button/image_button.h" 14 #include "ui/views/controls/button/image_button.h"
12 #include "ui/views/painter.h" 15 #include "ui/views/painter.h"
13 16
14 namespace message_center { 17 namespace message_center {
15 18
16 PaddedButton::PaddedButton(views::ButtonListener* listener) 19 PaddedButton::PaddedButton(views::ButtonListener* listener)
17 : views::ImageButton(listener) { 20 : views::ImageButton(listener) {
18 SetFocusForPlatform(); 21 SetFocusForPlatform();
19 SetFocusPainter(views::Painter::CreateSolidFocusPainter( 22 SetFocusPainter(views::Painter::CreateSolidFocusPainter(
20 kFocusBorderColor, 23 kFocusBorderColor,
21 gfx::Insets(1, 2, 2, 2))); 24 gfx::Insets(1, 2, 2, 2)));
25 set_background(views::Background::CreateSolidBackground(
26 SkColorSetA(SK_ColorWHITE, 0.9 * 0xff)));
22 SetBorder( 27 SetBorder(
23 views::CreateEmptyBorder(gfx::Insets(kControlButtonPaddingFromBorder))); 28 views::CreateEmptyBorder(gfx::Insets(kControlButtonPaddingFromBorder)));
24 set_animate_on_state_change(false); 29 set_animate_on_state_change(false);
30
31 SetInkDropMode(InkDropMode::ON);
32 set_ink_drop_base_color(SkColorSetA(SK_ColorBLACK, 0.6 * 0xff));
25 } 33 }
26 34
27 PaddedButton::~PaddedButton() { 35 std::unique_ptr<views::InkDrop> PaddedButton::CreateInkDrop() {
36 auto ink_drop = CreateDefaultInkDropImpl();
37 ink_drop->SetShowHighlightOnHover(false);
38 ink_drop->SetShowHighlightOnFocus(false);
39 return std::move(ink_drop);
40 }
41
42 std::unique_ptr<views::InkDropRipple> PaddedButton::CreateInkDropRipple()
43 const {
44 return base::MakeUnique<views::FloodFillInkDropRipple>(
45 size(), GetInkDropCenterBasedOnLastEvent(),
46 SkColorSetA(SK_ColorBLACK, 0.6 * 255), ink_drop_visible_opacity());
28 } 47 }
29 48
30 } // namespace message_center 49 } // namespace message_center
OLDNEW
« no previous file with comments | « ui/message_center/views/padded_button.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698