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

Side by Side Diff: ui/app_list/views/app_list_view.cc

Issue 945373002: Refocus app list search box when dialogs are closed. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add_Test Created 5 years, 10 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 | « no previous file | ui/app_list/views/app_list_view_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/app_list/views/app_list_view.h" 5 #include "ui/app_list/views/app_list_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 overlay_view_->layer()->SetOpacity(visible ? kOverlayOpacity : 0.0f); 302 overlay_view_->layer()->SetOpacity(visible ? kOverlayOpacity : 0.0f);
303 // Create the illusion that the search box is hidden behind the app list 303 // Create the illusion that the search box is hidden behind the app list
304 // overlay mask by setting its opacity to the same value, and disabling it. 304 // overlay mask by setting its opacity to the same value, and disabling it.
305 { 305 {
306 ui::ScopedLayerAnimationSettings settings( 306 ui::ScopedLayerAnimationSettings settings(
307 search_box_widget_->GetLayer()->GetAnimator()); 307 search_box_widget_->GetLayer()->GetAnimator());
308 const float kSearchBoxWidgetOpacity = 0.5f; 308 const float kSearchBoxWidgetOpacity = 0.5f;
309 search_box_widget_->GetLayer()->SetOpacity(visible ? kSearchBoxWidgetOpacity 309 search_box_widget_->GetLayer()->SetOpacity(visible ? kSearchBoxWidgetOpacity
310 : 1.0f); 310 : 1.0f);
311 search_box_view_->SetEnabled(!visible); 311 search_box_view_->SetEnabled(!visible);
312 if (!visible)
313 search_box_view_->search_box()->RequestFocus();
312 } 314 }
313 } 315 }
314 316
315 bool AppListView::ShouldCenterWindow() const { 317 bool AppListView::ShouldCenterWindow() const {
316 return delegate_->ShouldCenterWindow(); 318 return delegate_->ShouldCenterWindow();
317 } 319 }
318 320
319 gfx::Size AppListView::GetPreferredSize() const { 321 gfx::Size AppListView::GetPreferredSize() const {
320 return app_list_main_view_->GetPreferredSize(); 322 return app_list_main_view_->GetPreferredSize();
321 } 323 }
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
768 770
769 if (will_appear) { 771 if (will_appear) {
770 speech_view_->SetVisible(true); 772 speech_view_->SetVisible(true);
771 } else { 773 } else {
772 app_list_main_view_->SetVisible(true); 774 app_list_main_view_->SetVisible(true);
773 search_box_view_->search_box()->RequestFocus(); 775 search_box_view_->search_box()->RequestFocus();
774 } 776 }
775 } 777 }
776 778
777 } // namespace app_list 779 } // namespace app_list
OLDNEW
« no previous file with comments | « no previous file | ui/app_list/views/app_list_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698