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

Unified Diff: chrome/browser/cocoa/clear_browsing_data_controller.mm

Issue 3798007: Merge 62782 - Revert 62189 - [Mac] Update Clear Browsing dialog for proper fu... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/552/src/
Patch Set: Created 10 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/cocoa/clear_browsing_data_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/clear_browsing_data_controller.mm
===================================================================
--- chrome/browser/cocoa/clear_browsing_data_controller.mm (revision 62949)
+++ chrome/browser/cocoa/clear_browsing_data_controller.mm (working copy)
@@ -121,19 +121,10 @@
pathForResource:@"ClearBrowsingData"
ofType:@"nib"];
if ((self = [super initWithWindowNibPath:nibpath owner:self])) {
+ profile_ = profile;
observer_.reset(new ClearBrowsingObserver(self));
-
- // Always show preferences for the original profile. Most state when off
- // the record comes from the original profile, but we explicitly use
- // the original profile to avoid potential problems.
- profile_ = profile->GetOriginalProfile();
- sync_service_ = profile_->GetProfileSyncService();
-
- if (sync_service_) {
- sync_service_->ResetClearServerDataState();
- sync_service_->AddObserver(observer_.get());
- }
-
+ profile_->GetProfileSyncService()->ResetClearServerDataState();
+ profile_->GetProfileSyncService()->AddObserver(observer_.get());
[self initFromPrefs];
}
return self;
@@ -146,8 +137,7 @@
// while clearing is in progress as the dialog is modal and not closeable).
remover_->RemoveObserver(observer_.get());
}
- if (sync_service_)
- sync_service_->RemoveObserver(observer_.get());
+ profile_->GetProfileSyncService()->RemoveObserver(observer_.get());
[self setClearingStatus:nil];
[super dealloc];
@@ -351,13 +341,13 @@
// the syncer syncs and resets itself before the user tries pressing the Clear
// button in this dialog again. TODO(raz) Confirm whether we have an issue
// here
- if (sync_service_->HasSyncSetupCompleted()) {
+ if (profile_->GetProfileSyncService()->HasSyncSetupCompleted()) {
bool clear = platform_util::SimpleYesNoBox(
nil,
l10n_util::GetStringUTF16(IDS_CONFIRM_CLEAR_TITLE),
l10n_util::GetStringUTF16(IDS_CONFIRM_CLEAR_DESCRIPTION));
if (clear) {
- sync_service_->ClearServerData();
+ profile_->GetProfileSyncService()->ClearServerData();
[self syncStateChanged];
}
}
@@ -367,8 +357,8 @@
bool deleteInProgress = false;
ProfileSyncService::ClearServerDataState clearState =
- sync_service_->GetClearServerDataState();
- sync_service_->ResetClearServerDataState();
+ profile_->GetProfileSyncService()->GetClearServerDataState();
+ profile_->GetProfileSyncService()->ResetClearServerDataState();
switch (clearState) {
case ProfileSyncService::CLEAR_NOT_STARTED:
@@ -397,13 +387,13 @@
[self setIsClearing:deleteInProgress];
}
-- (BOOL)isSyncVisible {
- return CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableClearServerData);
-}
-
- (BOOL)isSyncEnabled {
- return sync_service_ && sync_service_->HasSyncSetupCompleted();
+ BOOL allowClearServerDataUI =
+ CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableClearServerData);
+
+ return allowClearServerDataUI &&
+ profile_->GetProfileSyncService()->HasSyncSetupCompleted();
}
- (NSFont*)labelFont {
« no previous file with comments | « chrome/browser/cocoa/clear_browsing_data_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698