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

Side by Side Diff: chrome/browser/profiles/profile_manager.cc

Issue 7466033: Fix warning prompting on closing a window that will cancel downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Parallel view cleanup to gtk. Created 9 years, 5 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) 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 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 } 549 }
550 550
551 // static 551 // static
552 bool ProfileManager::IsMultipleProfilesEnabled() { 552 bool ProfileManager::IsMultipleProfilesEnabled() {
553 #if defined(TOOLKIT_VIEWS) && !defined(OS_CHROMEOS) 553 #if defined(TOOLKIT_VIEWS) && !defined(OS_CHROMEOS)
554 return true; 554 return true;
555 #else 555 #else
556 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles); 556 return CommandLine::ForCurrentProcess()->HasSwitch(switches::kMultiProfiles);
557 #endif 557 #endif
558 } 558 }
559
560 int ProfileManager::TotalDownloadCount() const {
561 int count = 0;
562
563 for (ProfilesInfoMap::const_iterator iter = profiles_info_.begin();
564 iter != profiles_info_.end(); ++iter) {
565 if (!iter->second->created)
566 continue;
567
568 Profile* p = iter->second->profile.get();
569
570 count += p->DownloadCount();
571
572 if (p->HasOffTheRecordProfile())
573 count += p->GetOffTheRecordProfile()->DownloadCount();
574 }
575
576 return count;
577 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698