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/search_box_view.h" | 5 #include "ui/app_list/search_box_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "ui/app_list/search_box_model.h" | 9 #include "ui/app_list/search_box_model.h" |
10 #include "ui/app_list/search_box_view_delegate.h" | 10 #include "ui/app_list/search_box_view_delegate.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 gfx::Rect icon_frame(rect); | 78 gfx::Rect icon_frame(rect); |
79 icon_frame.set_width(icon_size.width() + 2 * kPadding); | 79 icon_frame.set_width(icon_size.width() + 2 * kPadding); |
80 icon_view_->SetBoundsRect(icon_frame); | 80 icon_view_->SetBoundsRect(icon_frame); |
81 | 81 |
82 gfx::Rect edit_frame(rect); | 82 gfx::Rect edit_frame(rect); |
83 edit_frame.set_x(icon_frame.right()); | 83 edit_frame.set_x(icon_frame.right()); |
84 edit_frame.set_width(rect.width() - icon_frame.width() - kPadding); | 84 edit_frame.set_width(rect.width() - icon_frame.width() - kPadding); |
85 search_box_->SetBoundsRect(edit_frame); | 85 search_box_->SetBoundsRect(edit_frame); |
86 } | 86 } |
87 | 87 |
88 bool SearchBoxView::OnMouseWheel(const views::MouseWheelEvent& event) { | 88 bool SearchBoxView::OnMouseWheel(const ui::MouseWheelEvent& event) { |
89 if (contents_view_) | 89 if (contents_view_) |
90 return contents_view_->OnMouseWheel(event); | 90 return contents_view_->OnMouseWheel(event); |
91 | 91 |
92 return false; | 92 return false; |
93 } | 93 } |
94 | 94 |
95 void SearchBoxView::UpdateModel() { | 95 void SearchBoxView::UpdateModel() { |
96 // Temporarily remove from observer to ignore notifications caused by us. | 96 // Temporarily remove from observer to ignore notifications caused by us. |
97 model_->RemoveObserver(this); | 97 model_->RemoveObserver(this); |
98 model_->SetText(search_box_->text()); | 98 model_->SetText(search_box_->text()); |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 void SearchBoxView::SelectionModelChanged() { | 146 void SearchBoxView::SelectionModelChanged() { |
147 search_box_->SelectSelectionModel(model_->selection_model()); | 147 search_box_->SelectSelectionModel(model_->selection_model()); |
148 } | 148 } |
149 | 149 |
150 void SearchBoxView::TextChanged() { | 150 void SearchBoxView::TextChanged() { |
151 search_box_->SetText(model_->text()); | 151 search_box_->SetText(model_->text()); |
152 } | 152 } |
153 | 153 |
154 } // namespace app_list | 154 } // namespace app_list |
155 | 155 |
OLD | NEW |