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

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

Issue 2938203004: Revert of Added HALF, FULLSCREEN_ALL_APPS, and FULLSCREEN_SEARCH. (Closed)
Patch Set: Created 3 years, 6 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 | « ui/app_list/views/app_list_view_unittest.cc ('k') | no next file » | 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/search_box_view.h" 5 #include "ui/app_list/views/search_box_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 constexpr int kPadding = 12; 47 constexpr int kPadding = 12;
48 constexpr int kInnerPadding = 24; 48 constexpr int kInnerPadding = 24;
49 constexpr int kPreferredWidth = 360; 49 constexpr int kPreferredWidth = 360;
50 constexpr int kPreferredWidthFullscreen = 544; 50 constexpr int kPreferredWidthFullscreen = 544;
51 constexpr int kPreferredHeight = 48; 51 constexpr int kPreferredHeight = 48;
52 52
53 constexpr SkColor kHintTextColor = SkColorSetARGBMacro(0xFF, 0xA0, 0xA0, 0xA0); 53 constexpr SkColor kHintTextColor = SkColorSetARGBMacro(0xFF, 0xA0, 0xA0, 0xA0);
54 54
55 constexpr int kBackgroundBorderCornerRadius = 2; 55 constexpr int kBackgroundBorderCornerRadius = 2;
56 constexpr int kBackgroundBorderCornerRadiusFullscreen = 24; 56 constexpr int kBackgroundBorderCornerRadiusFullscreen = 24;
57
57 constexpr int kGoogleIconSize = 24; 58 constexpr int kGoogleIconSize = 24;
58 constexpr int kMicIconSize = 24; 59 constexpr int kMicIconSize = 24;
59 60
60 // Default color used when wallpaper customized color is not available for 61 // Default color used when wallpaper customized color is not available for
61 // searchbox, #000 at 87% opacity. 62 // searchbox, #000 at 87% opacity.
62 constexpr SkColor kDefaultSearchboxColor = 63 constexpr SkColor kDefaultSearchboxColor =
63 SkColorSetARGBMacro(0xDE, 0x00, 0x00, 0x00); 64 SkColorSetARGBMacro(0xDE, 0x00, 0x00, 0x00);
64 65
65 // A background that paints a solid white rounded rect with a thin grey border. 66 // A background that paints a solid white rounded rect with a thin grey border.
66 class SearchBoxBackground : public views::Background { 67 class SearchBoxBackground : public views::Background {
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 void SearchBoxView::NotifyQueryChanged() { 361 void SearchBoxView::NotifyQueryChanged() {
361 DCHECK(delegate_); 362 DCHECK(delegate_);
362 delegate_->QueryChanged(this); 363 delegate_->QueryChanged(this);
363 } 364 }
364 365
365 void SearchBoxView::ContentsChanged(views::Textfield* sender, 366 void SearchBoxView::ContentsChanged(views::Textfield* sender,
366 const base::string16& new_contents) { 367 const base::string16& new_contents) {
367 UpdateModel(); 368 UpdateModel();
368 view_delegate_->AutoLaunchCanceled(); 369 view_delegate_->AutoLaunchCanceled();
369 NotifyQueryChanged(); 370 NotifyQueryChanged();
370 if (is_fullscreen_app_list_enabled_) 371
371 app_list_view_->SetStateFromSearchBoxView(search_box_->text().empty()); 372 if (is_fullscreen_app_list_enabled_ && !app_list_view_->is_fullscreen()) {
373 // If the app list is in the peeking state, switch it to fullscreen.
374 app_list_view_->SetState(AppListView::FULLSCREEN);
375 }
372 } 376 }
373 377
374 bool SearchBoxView::HandleKeyEvent(views::Textfield* sender, 378 bool SearchBoxView::HandleKeyEvent(views::Textfield* sender,
375 const ui::KeyEvent& key_event) { 379 const ui::KeyEvent& key_event) {
376 if (key_event.type() == ui::ET_KEY_PRESSED) { 380 if (key_event.type() == ui::ET_KEY_PRESSED) {
377 if (key_event.key_code() == ui::VKEY_TAB && 381 if (key_event.key_code() == ui::VKEY_TAB &&
378 focused_view_ != FOCUS_CONTENTS_VIEW && 382 focused_view_ != FOCUS_CONTENTS_VIEW &&
379 MoveTabFocus(key_event.IsShiftDown())) 383 MoveTabFocus(key_event.IsShiftDown()))
380 return true; 384 return true;
381 385
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 NotifyQueryChanged(); 493 NotifyQueryChanged();
490 } 494 }
491 495
492 void SearchBoxView::OnSpeechRecognitionStateChanged( 496 void SearchBoxView::OnSpeechRecognitionStateChanged(
493 SpeechRecognitionState new_state) { 497 SpeechRecognitionState new_state) {
494 SpeechRecognitionButtonPropChanged(); 498 SpeechRecognitionButtonPropChanged();
495 SchedulePaint(); 499 SchedulePaint();
496 } 500 }
497 501
498 } // namespace app_list 502 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/views/app_list_view_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698