diff options
author | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-18 23:04:52 +0000 |
---|---|---|
committer | rsesek@chromium.org <rsesek@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-18 23:04:52 +0000 |
commit | 0d7e8811d119932473dcb7f11632ee4972d19cb6 (patch) | |
tree | dd19e2f189613612a7ed82764bdace2bf5fac374 /chrome/browser/cocoa/clear_browsing_data_controller.mm | |
parent | 743a1aa270e02d6b5cbf424ba07f1fd77a038f3c (diff) | |
download | chromium_src-0d7e8811d119932473dcb7f11632ee4972d19cb6.zip chromium_src-0d7e8811d119932473dcb7f11632ee4972d19cb6.tar.gz chromium_src-0d7e8811d119932473dcb7f11632ee4972d19cb6.tar.bz2 |
[Mac] If a user clears browsing data with the cookie manager open, update the UI
BUG=32030
TEST=See repro steps in bug report.
Review URL: http://codereview.chromium.org/551058
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@36497 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/clear_browsing_data_controller.mm')
-rw-r--r-- | chrome/browser/cocoa/clear_browsing_data_controller.mm | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/chrome/browser/cocoa/clear_browsing_data_controller.mm b/chrome/browser/cocoa/clear_browsing_data_controller.mm index 00f2260..4e9e537 100644 --- a/chrome/browser/cocoa/clear_browsing_data_controller.mm +++ b/chrome/browser/cocoa/clear_browsing_data_controller.mm @@ -1,4 +1,4 @@ -// Copyright (c) 2009 The Chromium Authors. All rights reserved. +// Copyright (c) 2009-2010 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -12,6 +12,11 @@ #include "chrome/common/pref_service.h" #include "chrome/browser/profile.h" +NSString* const kClearBrowsingDataControllerDidDelete = + @"kClearBrowsingDataControllerDidDelete"; +NSString* const kClearBrowsingDataControllerRemoveMask = + @"kClearBrowsingDataControllerRemoveMask"; + @interface ClearBrowsingDataController(Private) - (void)initFromPrefs; - (void)persistToPrefs; @@ -65,10 +70,12 @@ typedef std::map<Profile*, ClearBrowsingDataController*> ProfileControllerMap; if (it == map->end()) { // Since we don't currently support multiple profiles, this class // has not been tested against this case. - DCHECK_EQ(map->size(), 0U); + if (map->size() != 0) { + return nil; + } ClearBrowsingDataController* controller = - [[self alloc] initWithProfile:profile]; + [[self alloc] initWithProfile:profile]; it = map->insert(std::make_pair(profile, controller)).first; } return it->second; @@ -192,6 +199,15 @@ typedef std::map<Profile*, ClearBrowsingDataController*> ProfileControllerMap; // Called when the data remover object is done with its work. Close the window. // The remover will delete itself. End the modal session at this point. - (void)dataRemoverDidFinish { + NSNotificationCenter* center = [NSNotificationCenter defaultCenter]; + int removeMask = [self removeMask]; + NSDictionary* userInfo = + [NSDictionary dictionaryWithObject:[NSNumber numberWithInt:removeMask] + forKey:kClearBrowsingDataControllerRemoveMask]; + [center postNotificationName:kClearBrowsingDataControllerDidDelete + object:self + userInfo:userInfo]; + [self closeDialog]; [[self window] orderOut:self]; [self setIsClearing:NO]; |