OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <set> | 5 #include <set> |
6 | 6 |
7 #include "chrome/browser/profiles/profile_manager.h" | 7 #include "chrome/browser/profiles/profile_manager.h" |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 cache.DeleteProfileFromCache(profile_dir); | 560 cache.DeleteProfileFromCache(profile_dir); |
561 } | 561 } |
562 | 562 |
563 // static | 563 // static |
564 bool ProfileManager::IsMultipleProfilesEnabled() { | 564 bool ProfileManager::IsMultipleProfilesEnabled() { |
565 #if defined(TOOLKIT_VIEWS) && !defined(OS_CHROMEOS) | 565 #if defined(TOOLKIT_VIEWS) && !defined(OS_CHROMEOS) |
566 return true; | 566 return true; |
567 #endif | 567 #endif |
568 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles); | 568 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles); |
569 } | 569 } |
| 570 |
| 571 int ProfileManager::TotalDownloadCount() const { |
| 572 int count = 0; |
| 573 |
| 574 for (ProfilesInfoMap::const_iterator iter = profiles_info_.begin(); |
| 575 iter != profiles_info_.end(); ++iter) { |
| 576 if (!iter->second->created) |
| 577 continue; |
| 578 |
| 579 Profile* p = iter->second->profile.get(); |
| 580 |
| 581 count += p->DownloadCount(); |
| 582 |
| 583 if (p->HasOffTheRecordProfile()) |
| 584 count += p->GetOffTheRecordProfile()->DownloadCount(); |
| 585 } |
| 586 |
| 587 return count; |
| 588 } |
OLD | NEW |