OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |