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

Side by Side Diff: ui/app_list/search_box_model.cc

Issue 10386224: app_list: Add search box and search result view for v2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win_aura Created 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "ui/app_list/search_box_model.h"
6
7 #include "ui/app_list/search_box_model_observer.h"
8 #include "ui/views/controls/textfield/textfield.h"
9
10 namespace app_list {
11
12 SearchBoxModel::SearchBoxModel() {
13 }
14
15 SearchBoxModel::~SearchBoxModel() {
16 }
17
18 void SearchBoxModel::SetIcon(const gfx::ImageSkia& icon) {
19 icon_ = icon;
20 FOR_EACH_OBSERVER(SearchBoxModelObserver,
21 observers_,
22 IconChanged());
23 }
24
25 void SearchBoxModel::SetHintText(const string16& hint_text) {
26 if (hint_text_ == hint_text)
27 return;
28
29 hint_text_ = hint_text;
30 FOR_EACH_OBSERVER(SearchBoxModelObserver,
31 observers_,
32 HintTextChanged());
33 }
34
35 void SearchBoxModel::SetSelectionModel(const gfx::SelectionModel& sel) {
36 if (selection_model_ == sel)
37 return;
38
39 selection_model_ = sel;
40 FOR_EACH_OBSERVER(SearchBoxModelObserver,
41 observers_,
42 SelectionModelChanged());
43 }
44
45 void SearchBoxModel::SetText(const string16& text) {
46 if (text_ == text)
47 return;
48
49 text_ = text;
50 FOR_EACH_OBSERVER(SearchBoxModelObserver,
51 observers_,
52 TextChanged());
53 }
54
55 void SearchBoxModel::AddObserver(SearchBoxModelObserver* observer) {
56 observers_.AddObserver(observer);
57 }
58
59 void SearchBoxModel::RemoveObserver(SearchBoxModelObserver* observer) {
60 observers_.RemoveObserver(observer);
61 }
62
63 } // namespace app_list
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698