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

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

Issue 1695018: Adding ExtensionPrefs methods for storing update-when-idle data.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 7 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
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/extensions_service.h" 5 #include "chrome/browser/extensions/extensions_service.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/histogram.h" 10 #include "base/histogram.h"
(...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after
659 } 659 }
660 } 660 }
661 661
662 // UnloadExtension will change the extensions_ list. So, we should 662 // UnloadExtension will change the extensions_ list. So, we should
663 // call it outside the iterator loop. 663 // call it outside the iterator loop.
664 for (unsigned int i = 0; i < to_be_removed.size(); ++i) { 664 for (unsigned int i = 0; i < to_be_removed.size(); ++i) {
665 UnloadExtension(to_be_removed[i]); 665 UnloadExtension(to_be_removed[i]);
666 } 666 }
667 } 667 }
668 668
669 void ExtensionsService::SetLastPingDay(const std::string& extension_id,
670 const base::Time& time) {
671 extension_prefs_->SetLastPingDay(extension_id, time);
672 }
673
674 base::Time ExtensionsService::LastPingDay(
675 const std::string& extension_id) const {
676 return extension_prefs_->LastPingDay(extension_id);
677 }
678
679 void ExtensionsService::SetBlacklistLastPingDay(const base::Time& time) {
680 extension_prefs_->SetBlacklistLastPingDay(time);
681 }
682
683 base::Time ExtensionsService::BlacklistLastPingDay() const {
684 return extension_prefs_->BlacklistLastPingDay();
685 }
686
687 bool ExtensionsService::IsIncognitoEnabled(const Extension* extension) { 669 bool ExtensionsService::IsIncognitoEnabled(const Extension* extension) {
688 // If this is a component extension we always allow it to work in incognito 670 // If this is a component extension we always allow it to work in incognito
689 // mode. 671 // mode.
690 if (extension->location() == Extension::COMPONENT) 672 if (extension->location() == Extension::COMPONENT)
691 return true; 673 return true;
692 674
693 // Check the prefs. 675 // Check the prefs.
694 return extension_prefs_->IsIncognitoEnabled(extension->id()); 676 return extension_prefs_->IsIncognitoEnabled(extension->id());
695 } 677 }
696 678
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
1250 // Finish installing on UI thread. 1232 // Finish installing on UI thread.
1251 ChromeThread::PostTask( 1233 ChromeThread::PostTask(
1252 ChromeThread::UI, FROM_HERE, 1234 ChromeThread::UI, FROM_HERE,
1253 NewRunnableMethod( 1235 NewRunnableMethod(
1254 frontend_, 1236 frontend_,
1255 &ExtensionsService::ContinueLoadAllExtensions, 1237 &ExtensionsService::ContinueLoadAllExtensions,
1256 extensions_to_reload, 1238 extensions_to_reload,
1257 start_time, 1239 start_time,
1258 true)); 1240 true));
1259 } 1241 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extensions_service.h ('k') | chrome/browser/extensions/test_extension_prefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698