diff options
author | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-24 00:55:35 +0000 |
---|---|---|
committer | akalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-24 00:55:35 +0000 |
commit | f9bc9b9ca68926b2687ae073941c8186aa3aed0d (patch) | |
tree | a15d6b735ca16d4739d1ce435512fe311bf8ef1a /chrome/browser/app_controller_mac.mm | |
parent | 6b5cc7aeca6761c88c0f98b0e54990becbe32177 (diff) | |
download | chromium_src-f9bc9b9ca68926b2687ae073941c8186aa3aed0d.zip chromium_src-f9bc9b9ca68926b2687ae073941c8186aa3aed0d.tar.gz chromium_src-f9bc9b9ca68926b2687ae073941c8186aa3aed0d.tar.bz2 |
Added main menu item for Sync in OS X. (Right below "Preferences..."). Made it work without a browser window being present.
Moved menu verification code into sync_status_ui_helper_mac{.h,.mm,_unittest.mm}.
BUG=27995
TEST=tested that the main menu item worked with or without a browser window. tested that the main menu item didn't show up unless --enable-sync was passed in.
Review URL: http://codereview.chromium.org/423004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32892 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/app_controller_mac.mm')
-rw-r--r-- | chrome/browser/app_controller_mac.mm | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm index e313130..ba41a4d 100644 --- a/chrome/browser/app_controller_mac.mm +++ b/chrome/browser/app_controller_mac.mm @@ -33,6 +33,9 @@ #include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/options_window.h" #include "chrome/browser/sessions/tab_restore_service.h" +#include "chrome/browser/sync/profile_sync_service.h" +#include "chrome/browser/sync/sync_status_ui_helper.h" +#include "chrome/browser/sync/sync_status_ui_helper_mac.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/notification_service.h" @@ -484,6 +487,10 @@ static bool g_is_opening_new_window = false; case IDC_NEW_TAB: enable = [self keyWindowIsMissingOrBlocked]; break; + case IDC_SYNC_BOOKMARKS: + enable = ProfileSyncService::IsSyncEnabled(); + browser_sync::UpdateSyncItem(item, enable, [self defaultProfile]); + break; default: enable = menuState_->IsCommandEnabled(tag) ? YES : NO; } @@ -566,6 +573,12 @@ static bool g_is_opening_new_window = false; [controller runModalDialog]; break; } + case IDC_SYNC_BOOKMARKS: + // TODO(akalin): Add a constant to denote starting sync from the + // main menu and use that instead of START_FROM_WRENCH. + SyncStatusUIHelper::OpenSyncMyBookmarksDialog( + defaultProfile, ProfileSyncService::START_FROM_WRENCH); + break; }; } @@ -604,6 +617,8 @@ static bool g_is_opening_new_window = false; menuState_->UpdateCommandEnabled(IDC_HELP_PAGE, true); menuState_->UpdateCommandEnabled(IDC_IMPORT_SETTINGS, true); menuState_->UpdateCommandEnabled(IDC_REPORT_BUG, true); + menuState_->UpdateCommandEnabled(IDC_SYNC_BOOKMARKS, + ProfileSyncService::IsSyncEnabled()); // TODO(pinkerton): ...more to come... } |