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 546 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
557 cache.DeleteProfileFromCache(profile_dir); | 557 cache.DeleteProfileFromCache(profile_dir); |
558 } | 558 } |
559 | 559 |
560 // static | 560 // static |
561 bool ProfileManager::IsMultipleProfilesEnabled() { | 561 bool ProfileManager::IsMultipleProfilesEnabled() { |
562 #if defined(TOOLKIT_VIEWS) && !defined(OS_CHROMEOS) | 562 #if defined(TOOLKIT_VIEWS) && !defined(OS_CHROMEOS) |
563 return true; | 563 return true; |
564 #endif | 564 #endif |
565 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles); | 565 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles); |
566 } | 566 } |
| 567 |
| 568 int ProfileManager::TotalDownloadCount() const { |
| 569 int count = 0; |
| 570 |
| 571 for (ProfilesInfoMap::const_iterator iter = profiles_info_.begin(); |
| 572 iter != profiles_info_.end(); ++iter) { |
| 573 if (!iter->second->created) |
| 574 continue; |
| 575 |
| 576 Profile* p = iter->second->profile.get(); |
| 577 |
| 578 count += p->DownloadCount(); |
| 579 |
| 580 if (p->HasOffTheRecordProfile()) |
| 581 count += p->GetOffTheRecordProfile()->DownloadCount(); |
| 582 } |
| 583 |
| 584 return count; |
| 585 } |
OLD | NEW |