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

Side by Side Diff: chrome/browser/ui/webui/sync_setup_handler.cc

Issue 7669052: Added DataTypeController integration and UI surfacing for syncing Search Engines. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Fixed notification registration. Created 9 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/webui/options/personal_options_handler.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "chrome/browser/ui/webui/sync_setup_handler.h" 5 #include "chrome/browser/ui/webui/sync_setup_handler.h"
6 6
7 #include "base/json/json_reader.h" 7 #include "base/json/json_reader.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 return false; 106 return false;
107 if (sync_extensions) 107 if (sync_extensions)
108 config->data_types.insert(syncable::EXTENSIONS); 108 config->data_types.insert(syncable::EXTENSIONS);
109 109
110 bool sync_typed_urls; 110 bool sync_typed_urls;
111 if (!result->GetBoolean("syncTypedUrls", &sync_typed_urls)) 111 if (!result->GetBoolean("syncTypedUrls", &sync_typed_urls))
112 return false; 112 return false;
113 if (sync_typed_urls) 113 if (sync_typed_urls)
114 config->data_types.insert(syncable::TYPED_URLS); 114 config->data_types.insert(syncable::TYPED_URLS);
115 115
116 bool sync_search_engines;
117 if (!result->GetBoolean("syncSearchEngines", &sync_search_engines))
118 return false;
119 if (sync_search_engines)
120 config->data_types.insert(syncable::SEARCH_ENGINES);
121
116 bool sync_sessions; 122 bool sync_sessions;
117 if (!result->GetBoolean("syncSessions", &sync_sessions)) 123 if (!result->GetBoolean("syncSessions", &sync_sessions))
118 return false; 124 return false;
119 if (sync_sessions) 125 if (sync_sessions)
120 config->data_types.insert(syncable::SESSIONS); 126 config->data_types.insert(syncable::SESSIONS);
121 127
122 bool sync_apps; 128 bool sync_apps;
123 if (!result->GetBoolean("syncApps", &sync_apps)) 129 if (!result->GetBoolean("syncApps", &sync_apps))
124 return false; 130 return false;
125 if (sync_apps) 131 if (sync_apps)
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 { "keepEverythingSynced", IDS_SYNC_EVERYTHING }, 231 { "keepEverythingSynced", IDS_SYNC_EVERYTHING },
226 { "chooseDataTypes", IDS_SYNC_CHOOSE_DATATYPES }, 232 { "chooseDataTypes", IDS_SYNC_CHOOSE_DATATYPES },
227 { "bookmarks", IDS_SYNC_DATATYPE_BOOKMARKS }, 233 { "bookmarks", IDS_SYNC_DATATYPE_BOOKMARKS },
228 { "preferences", IDS_SYNC_DATATYPE_PREFERENCES }, 234 { "preferences", IDS_SYNC_DATATYPE_PREFERENCES },
229 { "autofill", IDS_SYNC_DATATYPE_AUTOFILL }, 235 { "autofill", IDS_SYNC_DATATYPE_AUTOFILL },
230 { "themes", IDS_SYNC_DATATYPE_THEMES }, 236 { "themes", IDS_SYNC_DATATYPE_THEMES },
231 { "passwords", IDS_SYNC_DATATYPE_PASSWORDS }, 237 { "passwords", IDS_SYNC_DATATYPE_PASSWORDS },
232 { "extensions", IDS_SYNC_DATATYPE_EXTENSIONS }, 238 { "extensions", IDS_SYNC_DATATYPE_EXTENSIONS },
233 { "typedURLs", IDS_SYNC_DATATYPE_TYPED_URLS }, 239 { "typedURLs", IDS_SYNC_DATATYPE_TYPED_URLS },
234 { "apps", IDS_SYNC_DATATYPE_APPS }, 240 { "apps", IDS_SYNC_DATATYPE_APPS },
241 { "searchEngines", IDS_SYNC_DATATYPE_SEARCH_ENGINES },
235 { "foreignSessions", IDS_SYNC_DATATYPE_SESSIONS }, 242 { "foreignSessions", IDS_SYNC_DATATYPE_SESSIONS },
236 { "syncZeroDataTypesError", IDS_SYNC_ZERO_DATA_TYPES_ERROR }, 243 { "syncZeroDataTypesError", IDS_SYNC_ZERO_DATA_TYPES_ERROR },
237 { "abortedError", IDS_SYNC_SETUP_ABORTED_BY_PENDING_CLEAR }, 244 { "abortedError", IDS_SYNC_SETUP_ABORTED_BY_PENDING_CLEAR },
238 { "encryptAllLabel", IDS_SYNC_ENCRYPT_ALL_LABEL }, 245 { "encryptAllLabel", IDS_SYNC_ENCRYPT_ALL_LABEL },
239 { "googleOption", IDS_SYNC_PASSPHRASE_OPT_GOOGLE }, 246 { "googleOption", IDS_SYNC_PASSPHRASE_OPT_GOOGLE },
240 { "explicitOption", IDS_SYNC_PASSPHRASE_OPT_EXPLICIT }, 247 { "explicitOption", IDS_SYNC_PASSPHRASE_OPT_EXPLICIT },
241 { "sectionGoogleMessage", IDS_SYNC_PASSPHRASE_MSG_GOOGLE }, 248 { "sectionGoogleMessage", IDS_SYNC_PASSPHRASE_MSG_GOOGLE },
242 { "sectionExplicitMessage", IDS_SYNC_PASSPHRASE_MSG_EXPLICIT }, 249 { "sectionExplicitMessage", IDS_SYNC_PASSPHRASE_MSG_EXPLICIT },
243 { "passphraseLabel", IDS_SYNC_PASSPHRASE_LABEL }, 250 { "passphraseLabel", IDS_SYNC_PASSPHRASE_LABEL },
244 { "confirmLabel", IDS_SYNC_CONFIRM_PASSPHRASE_LABEL }, 251 { "confirmLabel", IDS_SYNC_CONFIRM_PASSPHRASE_LABEL },
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
478 ShowSetupUI(); 485 ShowSetupUI();
479 486
480 // The SyncSetupFlow will set itself as the |flow_|. 487 // The SyncSetupFlow will set itself as the |flow_|.
481 if (!service->get_wizard().AttachSyncSetupHandler(this)) { 488 if (!service->get_wizard().AttachSyncSetupHandler(this)) {
482 // If attach fails, a wizard is already activated and attached to a flow 489 // If attach fails, a wizard is already activated and attached to a flow
483 // handler. 490 // handler.
484 web_ui_->CallJavascriptFunction("OptionsPage.closeOverlay"); 491 web_ui_->CallJavascriptFunction("OptionsPage.closeOverlay");
485 service->get_wizard().Focus(); 492 service->get_wizard().Focus();
486 } 493 }
487 } 494 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/personal_options_handler.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698