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

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

Issue 10638018: app_list: Initialize more views in the initializer list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « no previous file | ui/app_list/apps_grid_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/app_list_item_model.h" 5 #include "ui/app_list/app_list_item_model.h"
6 6
7 #include "ui/app_list/app_list_item_model_observer.h" 7 #include "ui/app_list/app_list_item_model_observer.h"
8 8
9 namespace app_list { 9 namespace app_list {
10 10
11 AppListItemModel::AppListItemModel() : highlighted_(false) { 11 AppListItemModel::AppListItemModel() : highlighted_(false) {
12 } 12 }
13 13
14 AppListItemModel::~AppListItemModel() { 14 AppListItemModel::~AppListItemModel() {
15 } 15 }
16 16
17 void AppListItemModel::SetIcon(const SkBitmap& icon) { 17 void AppListItemModel::SetIcon(const SkBitmap& icon) {
18 icon_ = icon; 18 icon_ = icon;
19 FOR_EACH_OBSERVER(AppListItemModelObserver, observers_, 19 FOR_EACH_OBSERVER(AppListItemModelObserver, observers_, ItemIconChanged());
20 ItemIconChanged());
21 } 20 }
22 21
23 void AppListItemModel::SetTitle(const std::string& title) { 22 void AppListItemModel::SetTitle(const std::string& title) {
23 if (title_ == title)
24 return;
25
24 title_ = title; 26 title_ = title;
25 FOR_EACH_OBSERVER(AppListItemModelObserver, observers_, 27 FOR_EACH_OBSERVER(AppListItemModelObserver, observers_, ItemTitleChanged());
26 ItemTitleChanged());
27 } 28 }
28 29
29 void AppListItemModel::SetHighlighted(bool highlighted) { 30 void AppListItemModel::SetHighlighted(bool highlighted) {
30 if (highlighted_ == highlighted) 31 if (highlighted_ == highlighted)
31 return; 32 return;
32 33
33 highlighted_ = highlighted; 34 highlighted_ = highlighted;
34 FOR_EACH_OBSERVER(AppListItemModelObserver, observers_, 35 FOR_EACH_OBSERVER(AppListItemModelObserver,
36 observers_,
35 ItemHighlightedChanged()); 37 ItemHighlightedChanged());
36 } 38 }
37 39
38 void AppListItemModel::AddObserver(AppListItemModelObserver* observer) { 40 void AppListItemModel::AddObserver(AppListItemModelObserver* observer) {
39 observers_.AddObserver(observer); 41 observers_.AddObserver(observer);
40 } 42 }
41 43
42 void AppListItemModel::RemoveObserver(AppListItemModelObserver* observer) { 44 void AppListItemModel::RemoveObserver(AppListItemModelObserver* observer) {
43 observers_.RemoveObserver(observer); 45 observers_.RemoveObserver(observer);
44 } 46 }
45 47
46 ui::MenuModel* AppListItemModel::GetContextMenuModel() { 48 ui::MenuModel* AppListItemModel::GetContextMenuModel() {
47 return NULL; 49 return NULL;
48 } 50 }
49 51
50 } // namespace app_list 52 } // namespace app_list
OLDNEW
« no previous file with comments | « no previous file | ui/app_list/apps_grid_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698