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

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

Issue 853743002: First pass at fixing guest browser cookies issue. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Delete the Profile Manager. Guest Profile doesn't write to autocomplete/history. Views still needs … Created 5 years, 10 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
« no previous file with comments | « chrome/browser/ui/browser_list.cc ('k') | ui/app_list/views/app_list_folder_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_model.h" 5 #include "ui/app_list/app_list_model.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "ui/app_list/app_list_folder_item.h" 9 #include "ui/app_list/app_list_folder_item.h"
10 #include "ui/app_list/app_list_item.h" 10 #include "ui/app_list/app_list_item.h"
11 #include "ui/app_list/app_list_model_observer.h" 11 #include "ui/app_list/app_list_model_observer.h"
12 #include "ui/app_list/search_box_model.h" 12 #include "ui/app_list/search_box_model.h"
13 13
14 namespace app_list { 14 namespace app_list {
15 15
16 AppListModel::AppListModel() 16 AppListModel::AppListModel()
17 : top_level_item_list_(new AppListItemList), 17 : top_level_item_list_(new AppListItemList),
18 search_box_(new SearchBoxModel), 18 search_box_(new SearchBoxModel),
19 results_(new SearchResults), 19 results_(new SearchResults),
20 status_(STATUS_NORMAL), 20 status_(STATUS_NORMAL),
21 state_(INVALID_STATE), 21 state_(INVALID_STATE),
22 folders_enabled_(false), 22 folders_enabled_(false),
23 custom_launcher_page_enabled_(true) { 23 custom_launcher_page_enabled_(true) {
24 top_level_item_list_->AddObserver(this); 24 top_level_item_list_->AddObserver(this);
25 } 25 }
26 26
27 AppListModel::~AppListModel() { top_level_item_list_->RemoveObserver(this); } 27 AppListModel::~AppListModel() { top_level_item_list_->RemoveObserver(this); }
28 28
29 void AppListModel::AddObserver(AppListModelObserver* observer) { 29 void AppListModel::AddObserver(AppListModelObserver* observer) {
30 DLOG(ERROR) << "Adding " << observer;
30 observers_.AddObserver(observer); 31 observers_.AddObserver(observer);
31 } 32 }
32 33
33 void AppListModel::RemoveObserver(AppListModelObserver* observer) { 34 void AppListModel::RemoveObserver(AppListModelObserver* observer) {
34 observers_.RemoveObserver(observer); 35 DLOG(ERROR) << "Removing " << observer;
36 observers_.RemoveObserver(observer);
35 } 37 }
36 38
37 void AppListModel::SetStatus(Status status) { 39 void AppListModel::SetStatus(Status status) {
38 if (status_ == status) 40 if (status_ == status)
39 return; 41 return;
40 42
41 status_ = status; 43 status_ = status;
42 FOR_EACH_OBSERVER(AppListModelObserver, 44 FOR_EACH_OBSERVER(AppListModelObserver,
43 observers_, 45 observers_,
44 OnAppListModelStatusChanged()); 46 OnAppListModelStatusChanged());
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 scoped_ptr<AppListItem> result = folder->item_list()->RemoveItem(item->id()); 430 scoped_ptr<AppListItem> result = folder->item_list()->RemoveItem(item->id());
429 result->set_folder_id(""); 431 result->set_folder_id("");
430 if (folder->item_list()->item_count() == 0) { 432 if (folder->item_list()->item_count() == 0) {
431 DVLOG(2) << "Deleting empty folder: " << folder->ToDebugString(); 433 DVLOG(2) << "Deleting empty folder: " << folder->ToDebugString();
432 DeleteItem(folder_id); 434 DeleteItem(folder_id);
433 } 435 }
434 return result.Pass(); 436 return result.Pass();
435 } 437 }
436 438
437 } // namespace app_list 439 } // namespace app_list
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_list.cc ('k') | ui/app_list/views/app_list_folder_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698