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

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

Issue 1915063003: Change ContentSettingImageView activation to key release (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2704
Patch Set: Created 4 years, 7 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 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 if (!event.IsLeftMouseButton()) 91 if (!event.IsLeftMouseButton())
92 return; 92 return;
93 93
94 const bool activated = HitTestPoint(event.location()); 94 const bool activated = HitTestPoint(event.location());
95 ink_drop_delegate_->OnAction( 95 ink_drop_delegate_->OnAction(
96 activated ? views::InkDropState::ACTIVATED : views::InkDropState::HIDDEN); 96 activated ? views::InkDropState::ACTIVATED : views::InkDropState::HIDDEN);
97 if (activated) 97 if (activated)
98 ExecuteCommand(EXECUTE_SOURCE_MOUSE); 98 ExecuteCommand(EXECUTE_SOURCE_MOUSE);
99 } 99 }
100 100
101 bool BubbleIconView::OnKeyPressed(const ui::KeyEvent& event) { 101 bool BubbleIconView::OnKeyReleased(const ui::KeyEvent& event) {
102 if (event.key_code() != ui::VKEY_SPACE && event.key_code() != ui::VKEY_RETURN) 102 if (event.key_code() != ui::VKEY_SPACE && event.key_code() != ui::VKEY_RETURN)
103 return false; 103 return false;
104 104
105 ink_drop_delegate_->OnAction(views::InkDropState::ACTIVATED); 105 ink_drop_delegate_->OnAction(views::InkDropState::ACTIVATED);
106 ExecuteCommand(EXECUTE_SOURCE_KEYBOARD); 106 ExecuteCommand(EXECUTE_SOURCE_KEYBOARD);
107 return true; 107 return true;
108 } 108 }
109 109
110 void BubbleIconView::ViewHierarchyChanged( 110 void BubbleIconView::ViewHierarchyChanged(
111 const ViewHierarchyChangedDetails& details) { 111 const ViewHierarchyChangedDetails& details) {
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 image_->SetImage( 193 image_->SetImage(
194 gfx::CreateVectorIcon(GetVectorIcon(), icon_size, icon_color)); 194 gfx::CreateVectorIcon(GetVectorIcon(), icon_size, icon_color));
195 } 195 }
196 196
197 void BubbleIconView::SetActiveInternal(bool active) { 197 void BubbleIconView::SetActiveInternal(bool active) {
198 if (active_ == active) 198 if (active_ == active)
199 return; 199 return;
200 active_ = active; 200 active_ = active;
201 UpdateIcon(); 201 UpdateIcon();
202 } 202 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698