OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/gtk/options/content_page_gtk.h" | 5 #include "chrome/browser/gtk/options/content_page_gtk.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "app/gtk_util.h" | 9 #include "app/gtk_util.h" |
10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
(...skipping 577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 IDS_SYNC_STOP_SYNCING_CONFIRM_BUTTON_LABEL).c_str(), | 588 IDS_SYNC_STOP_SYNCING_CONFIRM_BUTTON_LABEL).c_str(), |
589 GTK_RESPONSE_ACCEPT, | 589 GTK_RESPONSE_ACCEPT, |
590 NULL); | 590 NULL); |
591 | 591 |
592 g_signal_connect(dialog, "response", | 592 g_signal_connect(dialog, "response", |
593 G_CALLBACK(OnStopSyncDialogResponseThunk), this); | 593 G_CALLBACK(OnStopSyncDialogResponseThunk), this); |
594 | 594 |
595 gtk_util::ShowDialog(dialog); | 595 gtk_util::ShowDialog(dialog); |
596 return; | 596 return; |
597 } else { | 597 } else { |
598 sync_service_->EnableForUser(NULL); | 598 sync_service_->ShowLoginDialog(NULL); |
599 ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_OPTIONS); | 599 ProfileSyncService::SyncEvent(ProfileSyncService::START_FROM_OPTIONS); |
600 } | 600 } |
601 } | 601 } |
602 | 602 |
603 void ContentPageGtk::OnSyncCustomizeButtonClicked(GtkWidget* widget) { | 603 void ContentPageGtk::OnSyncCustomizeButtonClicked(GtkWidget* widget) { |
604 // sync_customize_button_ should be invisible if sync is not yet set up. | 604 // sync_customize_button_ should be invisible if sync is not yet set up. |
605 DCHECK(sync_service_ && !sync_service_->IsManaged() && | 605 DCHECK(sync_service_ && !sync_service_->IsManaged() && |
606 sync_service_->HasSyncSetupCompleted()); | 606 sync_service_->HasSyncSetupCompleted()); |
607 sync_service_->ShowChooseDataTypes(NULL); | 607 sync_service_->ShowChooseDataTypes(NULL); |
608 } | 608 } |
609 | 609 |
610 void ContentPageGtk::OnSyncActionLinkClicked(GtkWidget* widget) { | 610 void ContentPageGtk::OnSyncActionLinkClicked(GtkWidget* widget) { |
611 DCHECK(sync_service_ && !sync_service_->IsManaged()); | 611 DCHECK(sync_service_ && !sync_service_->IsManaged()); |
612 sync_service_->ShowChooseDataTypes(NULL); | 612 sync_service_->ShowChooseDataTypes(NULL); |
613 } | 613 } |
614 | 614 |
615 void ContentPageGtk::OnStopSyncDialogResponse(GtkWidget* widget, int response) { | 615 void ContentPageGtk::OnStopSyncDialogResponse(GtkWidget* widget, int response) { |
616 if (response == GTK_RESPONSE_ACCEPT) { | 616 if (response == GTK_RESPONSE_ACCEPT) { |
617 sync_service_->DisableForUser(); | 617 sync_service_->DisableForUser(); |
618 ProfileSyncService::SyncEvent(ProfileSyncService::STOP_FROM_OPTIONS); | 618 ProfileSyncService::SyncEvent(ProfileSyncService::STOP_FROM_OPTIONS); |
619 } | 619 } |
620 gtk_widget_destroy(widget); | 620 gtk_widget_destroy(widget); |
621 } | 621 } |
622 | 622 |
623 void ContentPageGtk::OnPrivacyDashboardLinkClicked(GtkWidget* widget) { | 623 void ContentPageGtk::OnPrivacyDashboardLinkClicked(GtkWidget* widget) { |
624 BrowserList::GetLastActive()->OpenPrivacyDashboardTabAndActivate(); | 624 BrowserList::GetLastActive()->OpenPrivacyDashboardTabAndActivate(); |
625 } | 625 } |
OLD | NEW |