| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 icon_view_(new views::ImageView), | 49 icon_view_(new views::ImageView), |
| 50 speech_button_(NULL), | 50 speech_button_(NULL), |
| 51 search_box_(new views::Textfield), | 51 search_box_(new views::Textfield), |
| 52 contents_view_(NULL) { | 52 contents_view_(NULL) { |
| 53 AddChildView(icon_view_); | 53 AddChildView(icon_view_); |
| 54 | 54 |
| 55 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 55 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 56 | 56 |
| 57 #if !defined(OS_CHROMEOS) | 57 #if !defined(OS_CHROMEOS) |
| 58 menu_button_ = new views::MenuButton(NULL, base::string16(), this, false); | 58 menu_button_ = new views::MenuButton(NULL, base::string16(), this, false); |
| 59 menu_button_->set_border(NULL); | 59 menu_button_->SetBorder(views::Border::NullBorder()); |
| 60 menu_button_->SetIcon(*rb.GetImageSkiaNamed(IDR_APP_LIST_TOOLS_NORMAL)); | 60 menu_button_->SetIcon(*rb.GetImageSkiaNamed(IDR_APP_LIST_TOOLS_NORMAL)); |
| 61 menu_button_->SetHoverIcon(*rb.GetImageSkiaNamed(IDR_APP_LIST_TOOLS_HOVER)); | 61 menu_button_->SetHoverIcon(*rb.GetImageSkiaNamed(IDR_APP_LIST_TOOLS_HOVER)); |
| 62 menu_button_->SetPushedIcon(*rb.GetImageSkiaNamed( | 62 menu_button_->SetPushedIcon(*rb.GetImageSkiaNamed( |
| 63 IDR_APP_LIST_TOOLS_PRESSED)); | 63 IDR_APP_LIST_TOOLS_PRESSED)); |
| 64 AddChildView(menu_button_); | 64 AddChildView(menu_button_); |
| 65 #endif | 65 #endif |
| 66 | 66 |
| 67 search_box_->set_border(NULL); | 67 search_box_->SetBorder(views::Border::NullBorder()); |
| 68 search_box_->SetFontList(rb.GetFontList(ui::ResourceBundle::MediumFont)); | 68 search_box_->SetFontList(rb.GetFontList(ui::ResourceBundle::MediumFont)); |
| 69 search_box_->set_placeholder_text_color(kHintTextColor); | 69 search_box_->set_placeholder_text_color(kHintTextColor); |
| 70 search_box_->set_controller(this); | 70 search_box_->set_controller(this); |
| 71 AddChildView(search_box_); | 71 AddChildView(search_box_); |
| 72 | 72 |
| 73 ModelChanged(); | 73 ModelChanged(); |
| 74 } | 74 } |
| 75 | 75 |
| 76 SearchBoxView::~SearchBoxView() { | 76 SearchBoxView::~SearchBoxView() { |
| 77 model_->search_box()->RemoveObserver(this); | 77 model_->search_box()->RemoveObserver(this); |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 void SearchBoxView::SelectionModelChanged() { | 236 void SearchBoxView::SelectionModelChanged() { |
| 237 search_box_->SelectSelectionModel(model_->search_box()->selection_model()); | 237 search_box_->SelectSelectionModel(model_->search_box()->selection_model()); |
| 238 } | 238 } |
| 239 | 239 |
| 240 void SearchBoxView::TextChanged() { | 240 void SearchBoxView::TextChanged() { |
| 241 search_box_->SetText(model_->search_box()->text()); | 241 search_box_->SetText(model_->search_box()->text()); |
| 242 NotifyQueryChanged(); | 242 NotifyQueryChanged(); |
| 243 } | 243 } |
| 244 | 244 |
| 245 } // namespace app_list | 245 } // namespace app_list |
| OLD | NEW |