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

Unified Diff: chrome/browser/sync/sync_ui_util.cc

Issue 6293018: Fix DOMUI pref mode handling of Mac menu items (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Whitespace fix Created 9 years, 11 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
Index: chrome/browser/sync/sync_ui_util.cc
diff --git a/chrome/browser/sync/sync_ui_util.cc b/chrome/browser/sync/sync_ui_util.cc
index e1ac70f21b49aa76b9a8e45416483902f0aa1f70..1aa84d7e0845ad1e8162876de8942c864f60168f 100644
--- a/chrome/browser/sync/sync_ui_util.cc
+++ b/chrome/browser/sync/sync_ui_util.cc
@@ -4,14 +4,18 @@
#include "chrome/browser/sync/sync_ui_util.h"
+#include "base/command_line.h"
#include "base/i18n/number_formatting.h"
#include "base/i18n/time_formatting.h"
#include "base/string_util.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sync/profile_sync_service.h"
+#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/options/options_window.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/net/gaia/google_service_auth_error.h"
+#include "chrome/common/url_constants.h"
#include "grit/browser_resources.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
@@ -266,16 +270,30 @@ string16 GetSyncMenuLabel(ProfileSyncService* service) {
return l10n_util::GetStringUTF16(IDS_SYNC_START_SYNC_BUTTON_LABEL);
}
-void OpenSyncMyBookmarksDialog(
- Profile* profile, ProfileSyncService::SyncEventCodes code) {
+void OpenSyncMyBookmarksDialog(Profile* profile,
+ Browser* browser,
+ ProfileSyncService::SyncEventCodes code) {
ProfileSyncService* service =
profile->GetOriginalProfile()->GetProfileSyncService();
if (!service || !service->IsSyncEnabled()) {
LOG(DFATAL) << "OpenSyncMyBookmarksDialog called with sync disabled";
return;
}
+
+ bool use_tabbed_options = !CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kDisableTabbedOptions);
+
if (service->HasSyncSetupCompleted()) {
- ShowOptionsWindow(OPTIONS_PAGE_CONTENT, OPTIONS_GROUP_NONE, profile);
+ if (use_tabbed_options) {
+ bool create_window = browser == NULL;
+ if (create_window)
+ browser = Browser::Create(profile);
+ browser->ShowOptionsTab(chrome::kPersonalOptionsSubPage);
+ if (create_window)
+ browser->window()->Show();
+ } else {
+ ShowOptionsWindow(OPTIONS_PAGE_CONTENT, OPTIONS_GROUP_NONE, profile);
+ }
} else {
service->ShowLoginDialog(NULL);
ProfileSyncService::SyncEvent(code); // UMA stats

Powered by Google App Engine
This is Rietveld 408576698