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

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

Issue 2070143003: Add MD ink drop ripple to app list button (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@b612539_shelf_button_ripple
Patch Set: Rebased Created 4 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
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/content_setting_image_view.h" 5 #include "chrome/browser/ui/views/location_bar/content_setting_image_view.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/browser/themes/theme_properties.h" 8 #include "chrome/browser/themes/theme_properties.h"
9 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" 9 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h"
10 #include "chrome/browser/ui/content_settings/content_setting_image_model.h" 10 #include "chrome/browser/ui/content_settings/content_setting_image_model.h"
(...skipping 28 matching lines...) Expand all
39 SkColor parent_background_color) 39 SkColor parent_background_color)
40 : IconLabelBubbleView(0, font_list, parent_background_color, false), 40 : IconLabelBubbleView(0, font_list, parent_background_color, false),
41 parent_(parent), 41 parent_(parent),
42 content_setting_image_model_(image_model), 42 content_setting_image_model_(image_model),
43 slide_animator_(this), 43 slide_animator_(this),
44 pause_animation_(false), 44 pause_animation_(false),
45 pause_animation_state_(0.0), 45 pause_animation_state_(0.0),
46 bubble_view_(nullptr), 46 bubble_view_(nullptr),
47 suppress_mouse_released_action_(false) { 47 suppress_mouse_released_action_(false) {
48 if (ui::MaterialDesignController::IsModeMaterial()) { 48 if (ui::MaterialDesignController::IsModeMaterial()) {
49 SetHasInkDrop(true); 49 SetInkDropMode(InkDropMode::ON);
50 SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY); 50 SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY);
51 } else { 51 } else {
52 static const int kBackgroundImages[] = 52 static const int kBackgroundImages[] =
53 IMAGE_GRID(IDR_OMNIBOX_CONTENT_SETTING_BUBBLE); 53 IMAGE_GRID(IDR_OMNIBOX_CONTENT_SETTING_BUBBLE);
54 SetBackgroundImageGrid(kBackgroundImages); 54 SetBackgroundImageGrid(kBackgroundImages);
55 image()->set_interactive(true); 55 image()->set_interactive(true);
56 image()->SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY); 56 image()->SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY);
57 } 57 }
58 58
59 image()->SetHorizontalAlignment(base::i18n::IsRTL() 59 image()->SetHorizontalAlignment(base::i18n::IsRTL()
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 bool visible) { 282 bool visible) {
283 // |widget| is a bubble that has just got shown / hidden. 283 // |widget| is a bubble that has just got shown / hidden.
284 if (!visible && !label()->visible()) 284 if (!visible && !label()->visible())
285 AnimateInkDrop(views::InkDropState::DEACTIVATED, nullptr /* event */); 285 AnimateInkDrop(views::InkDropState::DEACTIVATED, nullptr /* event */);
286 } 286 }
287 287
288 void ContentSettingImageView::UpdateImage() { 288 void ContentSettingImageView::UpdateImage() {
289 SetImage(content_setting_image_model_->GetIcon(GetTextColor()).AsImageSkia()); 289 SetImage(content_setting_image_model_->GetIcon(GetTextColor()).AsImageSkia());
290 image()->SetTooltipText(content_setting_image_model_->get_tooltip()); 290 image()->SetTooltipText(content_setting_image_model_->get_tooltip());
291 } 291 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/location_bar/bubble_icon_view.cc ('k') | chrome/browser/ui/views/toolbar/app_menu_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698