| OLD | NEW |
| 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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 content_container_->set_background(new SearchBoxBackground()); | 136 content_container_->set_background(new SearchBoxBackground()); |
| 137 | 137 |
| 138 views::BoxLayout* layout = | 138 views::BoxLayout* layout = |
| 139 new views::BoxLayout(views::BoxLayout::kHorizontal, kPadding, 0, | 139 new views::BoxLayout(views::BoxLayout::kHorizontal, kPadding, 0, |
| 140 kInnerPadding - views::Textfield::kTextPadding); | 140 kInnerPadding - views::Textfield::kTextPadding); |
| 141 content_container_->SetLayoutManager(layout); | 141 content_container_->SetLayoutManager(layout); |
| 142 layout->set_cross_axis_alignment( | 142 layout->set_cross_axis_alignment( |
| 143 views::BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER); | 143 views::BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER); |
| 144 layout->set_minimum_cross_axis_size(kPreferredHeight); | 144 layout->set_minimum_cross_axis_size(kPreferredHeight); |
| 145 | 145 |
| 146 search_box_->SetBorder(views::Border::NullBorder()); | 146 search_box_->SetBorder(views::NullBorder()); |
| 147 search_box_->SetTextColor(kSearchTextColor); | 147 search_box_->SetTextColor(kSearchTextColor); |
| 148 search_box_->SetBackgroundColor(kSearchBoxBackground); | 148 search_box_->SetBackgroundColor(kSearchBoxBackground); |
| 149 search_box_->set_placeholder_text_color(kHintTextColor); | 149 search_box_->set_placeholder_text_color(kHintTextColor); |
| 150 search_box_->set_controller(this); | 150 search_box_->set_controller(this); |
| 151 search_box_->SetTextInputType(ui::TEXT_INPUT_TYPE_SEARCH); | 151 search_box_->SetTextInputType(ui::TEXT_INPUT_TYPE_SEARCH); |
| 152 search_box_->SetTextInputFlags(ui::TEXT_INPUT_FLAG_AUTOCORRECT_OFF); | 152 search_box_->SetTextInputFlags(ui::TEXT_INPUT_FLAG_AUTOCORRECT_OFF); |
| 153 content_container_->AddChildView(search_box_); | 153 content_container_->AddChildView(search_box_); |
| 154 layout->SetFlexForView(search_box_, 1); | 154 layout->SetFlexForView(search_box_, 1); |
| 155 | 155 |
| 156 view_delegate_->GetSpeechUI()->AddObserver(this); | 156 view_delegate_->GetSpeechUI()->AddObserver(this); |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 NotifyQueryChanged(); | 427 NotifyQueryChanged(); |
| 428 } | 428 } |
| 429 | 429 |
| 430 void SearchBoxView::OnSpeechRecognitionStateChanged( | 430 void SearchBoxView::OnSpeechRecognitionStateChanged( |
| 431 SpeechRecognitionState new_state) { | 431 SpeechRecognitionState new_state) { |
| 432 SpeechRecognitionButtonPropChanged(); | 432 SpeechRecognitionButtonPropChanged(); |
| 433 SchedulePaint(); | 433 SchedulePaint(); |
| 434 } | 434 } |
| 435 | 435 |
| 436 } // namespace app_list | 436 } // namespace app_list |
| OLD | NEW |