From dd720a9ba7c6eea0daa1f5885f6abc0465a90d26 Mon Sep 17 00:00:00 2001 From: "akalin@chromium.org" Date: Fri, 18 Dec 2009 01:45:50 +0000 Subject: gtk/sync: Use GetStatus when it is not necessary to know the status labels. BUG=none TEST=compiles ( patch by thiago.farina@gmail.com : http://codereview.chromium.org/503009 ) Review URL: http://codereview.chromium.org/504036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@34917 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/gtk/bookmark_bar_gtk.cc | 15 ++------------- chrome/browser/gtk/browser_toolbar_gtk.cc | 8 +++----- 2 files changed, 5 insertions(+), 18 deletions(-) (limited to 'chrome/browser/gtk') diff --git a/chrome/browser/gtk/bookmark_bar_gtk.cc b/chrome/browser/gtk/bookmark_bar_gtk.cc index a02136f..31a7058 100644 --- a/chrome/browser/gtk/bookmark_bar_gtk.cc +++ b/chrome/browser/gtk/bookmark_bar_gtk.cc @@ -1301,17 +1301,6 @@ void BookmarkBarGtk::PopupForButtonNextTo(GtkWidget* button, // The sync state reported by the profile sync service determines whether or // not the re-login indicator button should be visible. bool BookmarkBarGtk::ShouldShowSyncErrorButton() { - bool show_sync_error_button(false); - if (sync_service_ && sync_service_->HasSyncSetupCompleted()) { - string16 status_text; - string16 link_text; - // TODO(akalin): use sync_ui_util::GetStatus instead. - sync_ui_util::MessageType sync_status; - sync_status = sync_ui_util::GetStatusLabels( - sync_service_, &status_text, &link_text); - if (sync_status == sync_ui_util::SYNC_ERROR) { - show_sync_error_button = true; - } - } - return show_sync_error_button; + return sync_service_ && sync_service_->HasSyncSetupCompleted() && + (sync_ui_util::GetStatus(sync_service_) == sync_ui_util::SYNC_ERROR); } diff --git a/chrome/browser/gtk/browser_toolbar_gtk.cc b/chrome/browser/gtk/browser_toolbar_gtk.cc index e2ae78f..a2f8e42 100644 --- a/chrome/browser/gtk/browser_toolbar_gtk.cc +++ b/chrome/browser/gtk/browser_toolbar_gtk.cc @@ -699,12 +699,10 @@ void BrowserToolbarGtk::OnDragDataReceived(GtkWidget* widget, void BrowserToolbarGtk::OnStateChanged() { DCHECK(sync_service_); - string16 label; - string16 link; - // TODO(akalin): use sync_ui_util::GetStatus instead. - sync_ui_util::MessageType type = sync_ui_util::GetStatusLabels( - sync_service_, &label, &link); + sync_ui_util::MessageType type = sync_ui_util::GetStatus(sync_service_); + // TODO(akalin): Refactor this logic into a function called GetSyncMenuLabel + // in sync_ui_util.h. And use the function in Windows/Mac code too. int menu_label = type == sync_ui_util::SYNCED ? IDS_SYNC_MENU_BOOKMARKS_SYNCED_LABEL : type == sync_ui_util::SYNC_ERROR ? -- cgit v1.1