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

Unified Diff: athena/home/home_card_impl.cc

Issue 512963002: Clears focus on gesture event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 years, 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | athena/home/home_card_unittest.cc » ('j') | athena/home/home_card_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: athena/home/home_card_impl.cc
diff --git a/athena/home/home_card_impl.cc b/athena/home/home_card_impl.cc
index bd481f83ac0a03a1e3b37851ffd57ac4b2396ec0..4b38542b2b4773261b672d3025f03f628ebb989b 100644
--- a/athena/home/home_card_impl.cc
+++ b/athena/home/home_card_impl.cc
@@ -156,6 +156,10 @@ class HomeCardView : public views::WidgetDelegateView {
void SetStateProgress(HomeCard::State from_state,
HomeCard::State to_state,
float progress) {
+ if (from_state != HomeCard::VISIBLE_CENTERED ||
oshima 2014/08/28 19:33:12 We probably don't want to clear focus when a user
Jun Mukai 2014/08/28 21:26:25 Done.
+ to_state != HomeCard::VISIBLE_CENTERED) {
+ GetFocusManager()->ClearFocus();
+ }
if (from_state == HomeCard::VISIBLE_CENTERED)
main_view_->SetLayoutState(1.0f - progress);
else if (to_state == HomeCard::VISIBLE_CENTERED)
@@ -178,6 +182,11 @@ class HomeCardView : public views::WidgetDelegateView {
}
void SetStateWithAnimation(HomeCard::State state) {
+ if (state == HomeCard::VISIBLE_CENTERED)
+ main_view_->RequestFocusOnSearchBox();
+ else
+ GetWidget()->GetFocusManager()->ClearFocus();
+
if (state == HomeCard::VISIBLE_MINIMIZED)
return;
« no previous file with comments | « no previous file | athena/home/home_card_unittest.cc » ('j') | athena/home/home_card_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698