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

Side by Side Diff: ui/app_list/app_list_model.h

Issue 22268009: Move signin status and current user information into AppListModel. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 7 years, 4 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
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 #ifndef UI_APP_LIST_APP_LIST_MODEL_H_ 5 #ifndef UI_APP_LIST_APP_LIST_MODEL_H_
6 #define UI_APP_LIST_APP_LIST_MODEL_H_ 6 #define UI_APP_LIST_APP_LIST_MODEL_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "base/observer_list.h" 10 #include "base/observer_list.h"
11 #include "base/strings/string16.h"
11 #include "ui/app_list/app_list_export.h" 12 #include "ui/app_list/app_list_export.h"
12 #include "ui/base/models/list_model.h" 13 #include "ui/base/models/list_model.h"
13 14
14 namespace app_list { 15 namespace app_list {
15 16
16 class AppListItemModel; 17 class AppListItemModel;
17 class AppListModelObserver; 18 class AppListModelObserver;
18 class SearchBoxModel; 19 class SearchBoxModel;
19 class SearchResult; 20 class SearchResult;
20 21
(...skipping 11 matching lines...) Expand all
32 typedef ui::ListModel<AppListItemModel> Apps; 33 typedef ui::ListModel<AppListItemModel> Apps;
33 typedef ui::ListModel<SearchResult> SearchResults; 34 typedef ui::ListModel<SearchResult> SearchResults;
34 35
35 AppListModel(); 36 AppListModel();
36 ~AppListModel(); 37 ~AppListModel();
37 38
38 void AddObserver(AppListModelObserver* observer); 39 void AddObserver(AppListModelObserver* observer);
39 void RemoveObserver(AppListModelObserver* observer); 40 void RemoveObserver(AppListModelObserver* observer);
40 41
41 void SetStatus(Status status); 42 void SetStatus(Status status);
43 void SetCurrentUser(const base::string16& current_user_name,
44 const base::string16& current_user_email);
45 void SetSignedIn(bool signed_in);
42 46
43 Apps* apps() { return apps_.get(); } 47 Apps* apps() { return apps_.get(); }
44 SearchBoxModel* search_box() { return search_box_.get(); } 48 SearchBoxModel* search_box() { return search_box_.get(); }
45 SearchResults* results() { return results_.get(); } 49 SearchResults* results() { return results_.get(); }
46 Status status() const { return status_; } 50 Status status() const { return status_; }
51 bool signed_in() const { return signed_in_; }
52 const base::string16& current_user_name() const { return current_user_name_; }
53 const base::string16& current_user_email() const {
54 return current_user_email_;
55 }
47 56
48 private: 57 private:
49 scoped_ptr<Apps> apps_; 58 scoped_ptr<Apps> apps_;
50 59
51 scoped_ptr<SearchBoxModel> search_box_; 60 scoped_ptr<SearchBoxModel> search_box_;
52 scoped_ptr<SearchResults> results_; 61 scoped_ptr<SearchResults> results_;
53 62
63 base::string16 current_user_name_;
64 base::string16 current_user_email_;
65 bool signed_in_;
66
54 Status status_; 67 Status status_;
55 ObserverList<AppListModelObserver> observers_; 68 ObserverList<AppListModelObserver> observers_;
56 69
57 DISALLOW_COPY_AND_ASSIGN(AppListModel); 70 DISALLOW_COPY_AND_ASSIGN(AppListModel);
58 }; 71 };
59 72
60 } // namespace app_list 73 } // namespace app_list
61 74
62 #endif // UI_APP_LIST_APP_LIST_MODEL_H_ 75 #endif // UI_APP_LIST_APP_LIST_MODEL_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/app_list/app_list_controller_win.cc ('k') | ui/app_list/app_list_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698