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

Side by Side Diff: ash/launcher/launcher_model.cc

Issue 9649013: Show a different icon in the launcher for incognito windows (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Re-upload Created 8 years, 9 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 | « no previous file | ash/launcher/launcher_types.h » ('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 "ash/launcher/launcher_model.h" 5 #include "ash/launcher/launcher_model.h"
6 6
7 #include "ash/launcher/launcher_model_observer.h" 7 #include "ash/launcher/launcher_model_observer.h"
8 #include "ui/aura/window.h" 8 #include "ui/aura/window.h"
9 9
10 namespace ash { 10 namespace ash {
11 11
12 LauncherModel::LauncherModel() : next_id_(1) { 12 LauncherModel::LauncherModel() : next_id_(1) {
13 Add(0, LauncherItem(TYPE_APP_LIST)); 13 LauncherItem app_list;
14 Add(1, LauncherItem(TYPE_BROWSER_SHORTCUT)); 14 app_list.type = TYPE_APP_LIST;
15 app_list.is_incognito = false;
16
17 LauncherItem browser_shortcut;
18 browser_shortcut.type = TYPE_BROWSER_SHORTCUT;
19 browser_shortcut.is_incognito = false;
20
21 Add(0, app_list);
22 Add(1, browser_shortcut);
15 } 23 }
16 24
17 LauncherModel::~LauncherModel() { 25 LauncherModel::~LauncherModel() {
18 } 26 }
19 27
20 void LauncherModel::Add(int index, const LauncherItem& item) { 28 void LauncherModel::Add(int index, const LauncherItem& item) {
21 DCHECK(index >= 0 && index <= item_count()); 29 DCHECK(index >= 0 && index <= item_count());
22 items_.insert(items_.begin() + index, item); 30 items_.insert(items_.begin() + index, item);
23 items_[index].id = next_id_++; 31 items_[index].id = next_id_++;
24 FOR_EACH_OBSERVER(LauncherModelObserver, observers_, 32 FOR_EACH_OBSERVER(LauncherModelObserver, observers_,
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 84
77 void LauncherModel::AddObserver(LauncherModelObserver* observer) { 85 void LauncherModel::AddObserver(LauncherModelObserver* observer) {
78 observers_.AddObserver(observer); 86 observers_.AddObserver(observer);
79 } 87 }
80 88
81 void LauncherModel::RemoveObserver(LauncherModelObserver* observer) { 89 void LauncherModel::RemoveObserver(LauncherModelObserver* observer) {
82 observers_.RemoveObserver(observer); 90 observers_.RemoveObserver(observer);
83 } 91 }
84 92
85 } // namespace ash 93 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/launcher/launcher_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698