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

Side by Side Diff: chrome/browser/extensions/default_apps.cc

Issue 3743001: FBTF: Fix more ctor/dtors found by clang plugin. (Closed) Base URL: http://git.chromium.org/git/chromium.git
Patch Set: Rebase to pick up mac fix on ToT Created 10 years, 2 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 | « chrome/browser/extensions/default_apps.h ('k') | chrome/browser/shell_dialogs.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "chrome/browser/extensions/default_apps.h" 5 #include "chrome/browser/extensions/default_apps.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/prefs/pref_service.h" 8 #include "chrome/browser/prefs/pref_service.h"
9 #include "chrome/common/chrome_switches.h" 9 #include "chrome/common/chrome_switches.h"
10 #include "chrome/common/pref_names.h" 10 #include "chrome/common/pref_names.h"
11 11
12 const int DefaultApps::kAppsPromoCounterMax = 10; 12 const int DefaultApps::kAppsPromoCounterMax = 10;
13 13
14 // static 14 // static
15 void DefaultApps::RegisterUserPrefs(PrefService* prefs) { 15 void DefaultApps::RegisterUserPrefs(PrefService* prefs) {
16 prefs->RegisterBooleanPref(prefs::kDefaultAppsInstalled, false); 16 prefs->RegisterBooleanPref(prefs::kDefaultAppsInstalled, false);
17 prefs->RegisterIntegerPref(prefs::kAppsPromoCounter, 0); 17 prefs->RegisterIntegerPref(prefs::kAppsPromoCounter, 0);
18 } 18 }
19 19
20 DefaultApps::DefaultApps(PrefService* prefs) 20 DefaultApps::DefaultApps(PrefService* prefs)
21 : prefs_(prefs) { 21 : prefs_(prefs) {
22 // gmail, calendar, docs 22 // gmail, calendar, docs
23 ids_.insert("pjkljhegncpnkpknbcohdijeoejaedia"); 23 ids_.insert("pjkljhegncpnkpknbcohdijeoejaedia");
24 ids_.insert("ejjicmeblgpmajnghnpcppodonldlgfn"); 24 ids_.insert("ejjicmeblgpmajnghnpcppodonldlgfn");
25 ids_.insert("apdfllckaahabafndbhieahigkjlhalf"); 25 ids_.insert("apdfllckaahabafndbhieahigkjlhalf");
26 } 26 }
27 27
28 DefaultApps::~DefaultApps() {}
29
28 const ExtensionIdSet* DefaultApps::GetAppsToInstall() const { 30 const ExtensionIdSet* DefaultApps::GetAppsToInstall() const {
29 if (GetDefaultAppsInstalled()) 31 if (GetDefaultAppsInstalled())
30 return NULL; 32 return NULL;
31 else 33 else
32 return &ids_; 34 return &ids_;
33 } 35 }
34 36
35 void DefaultApps::DidInstallApp(const ExtensionIdSet& installed_ids) { 37 void DefaultApps::DidInstallApp(const ExtensionIdSet& installed_ids) {
36 // If all the default apps have been installed, stop trying to install them. 38 // If all the default apps have been installed, stop trying to install them.
37 // Note that we use std::includes here instead of == because apps might have 39 // Note that we use std::includes here instead of == because apps might have
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 } 98 }
97 99
98 bool DefaultApps::GetDefaultAppsInstalled() const { 100 bool DefaultApps::GetDefaultAppsInstalled() const {
99 return prefs_->GetBoolean(prefs::kDefaultAppsInstalled); 101 return prefs_->GetBoolean(prefs::kDefaultAppsInstalled);
100 } 102 }
101 103
102 void DefaultApps::SetDefaultAppsInstalled(bool val) { 104 void DefaultApps::SetDefaultAppsInstalled(bool val) {
103 prefs_->SetBoolean(prefs::kDefaultAppsInstalled, val); 105 prefs_->SetBoolean(prefs::kDefaultAppsInstalled, val);
104 prefs_->ScheduleSavePersistentPrefs(); 106 prefs_->ScheduleSavePersistentPrefs();
105 } 107 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/default_apps.h ('k') | chrome/browser/shell_dialogs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698