| 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 #import "chrome/browser/ui/cocoa/clear_browsing_data_controller.h" | 5 #import "chrome/browser/ui/cocoa/clear_browsing_data_controller.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/mac/mac_util.h" | 8 #include "base/mac/mac_util.h" |
| 9 #include "base/scoped_nsobject.h" | 9 #include "base/scoped_nsobject.h" |
| 10 #include "chrome/browser/browsing_data_remover.h" | 10 #include "chrome/browser/browsing_data_remover.h" |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 // |GetOriginalProfile()| will return the same profile if it is the original | 76 // |GetOriginalProfile()| will return the same profile if it is the original |
| 77 // profile. | 77 // profile. |
| 78 profile = profile->GetOriginalProfile(); | 78 profile = profile->GetOriginalProfile(); |
| 79 | 79 |
| 80 ProfileControllerMap* map = g_profile_controller_map.Pointer(); | 80 ProfileControllerMap* map = g_profile_controller_map.Pointer(); |
| 81 DCHECK(map != NULL); | 81 DCHECK(map != NULL); |
| 82 ProfileControllerMap::iterator it = map->find(profile); | 82 ProfileControllerMap::iterator it = map->find(profile); |
| 83 if (it == map->end()) { | 83 if (it == map->end()) { |
| 84 // Since we don't currently support multiple profiles, this class | 84 // Since we don't currently support multiple profiles, this class |
| 85 // has not been tested against this case. | 85 // has not been tested against this case. |
| 86 if (map->size() != 0) { | 86 if (!map->empty()) |
| 87 return nil; | 87 return nil; |
| 88 } | |
| 89 | 88 |
| 90 ClearBrowsingDataController* controller = | 89 ClearBrowsingDataController* controller = |
| 91 [[self alloc] initWithProfile:profile]; | 90 [[self alloc] initWithProfile:profile]; |
| 92 it = map->insert(std::make_pair(profile, controller)).first; | 91 it = map->insert(std::make_pair(profile, controller)).first; |
| 93 } | 92 } |
| 94 return it->second; | 93 return it->second; |
| 95 } | 94 } |
| 96 | 95 |
| 97 - (id)initWithProfile:(Profile*)profile { | 96 - (id)initWithProfile:(Profile*)profile { |
| 98 DCHECK(profile); | 97 DCHECK(profile); |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 object:self | 257 object:self |
| 259 userInfo:userInfo]; | 258 userInfo:userInfo]; |
| 260 | 259 |
| 261 [self closeDialog]; | 260 [self closeDialog]; |
| 262 [[self window] orderOut:self]; | 261 [[self window] orderOut:self]; |
| 263 [self setIsClearing:NO]; | 262 [self setIsClearing:NO]; |
| 264 remover_ = NULL; | 263 remover_ = NULL; |
| 265 } | 264 } |
| 266 | 265 |
| 267 @end | 266 @end |
| OLD | NEW |