OLD | NEW |
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 "chrome/browser/ui/views/location_bar/bubble_icon_view.h" | 5 #include "chrome/browser/ui/views/location_bar/bubble_icon_view.h" |
6 | 6 |
7 #include "chrome/browser/command_updater.h" | 7 #include "chrome/browser/command_updater.h" |
8 #include "ui/accessibility/ax_view_state.h" | 8 #include "ui/accessibility/ax_view_state.h" |
9 #include "ui/base/material_design/material_design_controller.h" | 9 #include "ui/base/material_design/material_design_controller.h" |
10 #include "ui/events/event.h" | 10 #include "ui/events/event.h" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 image_->SetPaintToLayer(true); | 138 image_->SetPaintToLayer(true); |
139 image_->layer()->SetFillsBoundsOpaquely(false); | 139 image_->layer()->SetFillsBoundsOpaquely(false); |
140 views::InkDropHostView::AddInkDropLayer(ink_drop_layer); | 140 views::InkDropHostView::AddInkDropLayer(ink_drop_layer); |
141 } | 141 } |
142 | 142 |
143 void BubbleIconView::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { | 143 void BubbleIconView::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { |
144 views::InkDropHostView::RemoveInkDropLayer(ink_drop_layer); | 144 views::InkDropHostView::RemoveInkDropLayer(ink_drop_layer); |
145 image_->SetPaintToLayer(false); | 145 image_->SetPaintToLayer(false); |
146 } | 146 } |
147 | 147 |
148 std::unique_ptr<views::InkDropHighlight> | |
149 BubbleIconView::CreateInkDropHighlight() const { | |
150 // BubbleIconView views don't show hover effect. | |
151 return HasFocus() ? InkDropHostView::CreateInkDropHighlight() : nullptr; | |
152 } | |
153 | |
154 SkColor BubbleIconView::GetInkDropBaseColor() const { | 148 SkColor BubbleIconView::GetInkDropBaseColor() const { |
155 return color_utils::DeriveDefaultIconColor(GetNativeTheme()->GetSystemColor( | 149 return color_utils::DeriveDefaultIconColor(GetNativeTheme()->GetSystemColor( |
156 ui::NativeTheme::kColorId_TextfieldDefaultColor)); | 150 ui::NativeTheme::kColorId_TextfieldDefaultColor)); |
157 } | 151 } |
158 | 152 |
159 bool BubbleIconView::ShouldShowInkDropForFocus() const { | 153 bool BubbleIconView::ShouldShowInkDropForFocus() const { |
160 return true; | 154 return true; |
161 } | 155 } |
162 | 156 |
163 void BubbleIconView::OnGestureEvent(ui::GestureEvent* event) { | 157 void BubbleIconView::OnGestureEvent(ui::GestureEvent* event) { |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 image_->SetImage( | 207 image_->SetImage( |
214 gfx::CreateVectorIcon(GetVectorIcon(), icon_size, icon_color)); | 208 gfx::CreateVectorIcon(GetVectorIcon(), icon_size, icon_color)); |
215 } | 209 } |
216 | 210 |
217 void BubbleIconView::SetActiveInternal(bool active) { | 211 void BubbleIconView::SetActiveInternal(bool active) { |
218 if (active_ == active) | 212 if (active_ == active) |
219 return; | 213 return; |
220 active_ = active; | 214 active_ = active; |
221 UpdateIcon(); | 215 UpdateIcon(); |
222 } | 216 } |
OLD | NEW |