Chromium Code Reviews| 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 "grit/ui_resources.h" | 9 #include "grit/ui_resources.h" |
| 10 #include "ui/app_list/app_list_model.h" | 10 #include "ui/app_list/app_list_model.h" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 180 return handled; | 180 return handled; |
| 181 } | 181 } |
| 182 | 182 |
| 183 void SearchBoxView::ButtonPressed(views::Button* sender, | 183 void SearchBoxView::ButtonPressed(views::Button* sender, |
| 184 const ui::Event& event) { | 184 const ui::Event& event) { |
| 185 DCHECK(!speech_button_ && sender == speech_button_); | 185 DCHECK(!speech_button_ && sender == speech_button_); |
| 186 view_delegate_->ToggleSpeechRecognition(); | 186 view_delegate_->ToggleSpeechRecognition(); |
| 187 } | 187 } |
| 188 | 188 |
| 189 void SearchBoxView::OnMenuButtonClicked(View* source, const gfx::Point& point) { | 189 void SearchBoxView::OnMenuButtonClicked(View* source, const gfx::Point& point) { |
| 190 if (!menu_) | 190 // Always regenerate the menu in case view_delegate_->GetUsers() has changed. |
|
tapted
2013/11/26 00:40:07
So, mac isn't affected by the checkmark-not-moving
| |
| 191 menu_.reset(new AppListMenuViews(view_delegate_)); | 191 menu_.reset(new AppListMenuViews(view_delegate_)); |
| 192 | 192 |
| 193 const gfx::Point menu_location = | 193 const gfx::Point menu_location = |
| 194 menu_button_->GetBoundsInScreen().bottom_right() + | 194 menu_button_->GetBoundsInScreen().bottom_right() + |
| 195 gfx::Vector2d(kMenuXOffsetFromButton, kMenuYOffsetFromButton); | 195 gfx::Vector2d(kMenuXOffsetFromButton, kMenuYOffsetFromButton); |
| 196 menu_->RunMenuAt(menu_button_, menu_location); | 196 menu_->RunMenuAt(menu_button_, menu_location); |
| 197 } | 197 } |
| 198 | 198 |
| 199 void SearchBoxView::IconChanged() { | 199 void SearchBoxView::IconChanged() { |
| 200 icon_view_->SetImage(model_->search_box()->icon()); | 200 icon_view_->SetImage(model_->search_box()->icon()); |
| 201 } | 201 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 235 void SearchBoxView::SelectionModelChanged() { | 235 void SearchBoxView::SelectionModelChanged() { |
| 236 search_box_->SelectSelectionModel(model_->search_box()->selection_model()); | 236 search_box_->SelectSelectionModel(model_->search_box()->selection_model()); |
| 237 } | 237 } |
| 238 | 238 |
| 239 void SearchBoxView::TextChanged() { | 239 void SearchBoxView::TextChanged() { |
| 240 search_box_->SetText(model_->search_box()->text()); | 240 search_box_->SetText(model_->search_box()->text()); |
| 241 NotifyQueryChanged(); | 241 NotifyQueryChanged(); |
| 242 } | 242 } |
| 243 | 243 |
| 244 } // namespace app_list | 244 } // namespace app_list |
| OLD | NEW |