Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / webui / sync_setup_handler.cc
index dc20992..d3e6f69 100644 (file)
@@ -54,7 +54,7 @@
 #if defined(OS_CHROMEOS)
 #include "components/signin/core/browser/signin_manager_base.h"
 #else
-#include "chrome/browser/signin/signin_manager.h"
+#include "components/signin/core/browser/signin_manager.h"
 #endif
 
 using content::WebContents;
@@ -228,6 +228,8 @@ void SyncSetupHandler::GetStaticLocalizedValues(
           l10n_util::GetStringUTF16(IDS_PRODUCT_NAME),
           base::ASCIIToUTF16(google_util::StringAppendGoogleLocaleParam(
               chrome::kSyncGoogleDashboardURL))));
+  localized_strings->SetString("deleteProfileLabel",
+      l10n_util::GetStringUTF16(IDS_SYNC_STOP_DELETE_PROFILE_LABEL));
   localized_strings->SetString("stopSyncingTitle",
       l10n_util::GetStringUTF16(IDS_SYNC_STOP_SYNCING_DIALOG_TITLE));
   localized_strings->SetString("stopSyncingConfirm",
@@ -779,6 +781,12 @@ void SyncSetupHandler::HandleStopSyncing(const base::ListValue* args) {
   if (GetSyncService())
     ProfileSyncService::SyncEvent(ProfileSyncService::STOP_FROM_OPTIONS);
   SigninManagerFactory::GetForProfile(GetProfile())->SignOut();
+
+  bool delete_profile = false;
+  if (args->GetBoolean(0, &delete_profile) && delete_profile) {
+    web_ui()->CallJavascriptFunction(
+        "BrowserOptions.deleteCurrentProfile");
+  }
 }
 #endif