summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk
diff options
context:
space:
mode:
authorakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-18 01:45:50 +0000
committerakalin@chromium.org <akalin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-12-18 01:45:50 +0000
commitdd720a9ba7c6eea0daa1f5885f6abc0465a90d26 (patch)
tree28075e0b9f6f72b822c62de79cae789a3f81e798 /chrome/browser/gtk
parent7c4b495825710ab2f37967a3963ac48a977bcfc6 (diff)
downloadchromium_src-dd720a9ba7c6eea0daa1f5885f6abc0465a90d26.zip
chromium_src-dd720a9ba7c6eea0daa1f5885f6abc0465a90d26.tar.gz
chromium_src-dd720a9ba7c6eea0daa1f5885f6abc0465a90d26.tar.bz2
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
Diffstat (limited to 'chrome/browser/gtk')
-rw-r--r--chrome/browser/gtk/bookmark_bar_gtk.cc15
-rw-r--r--chrome/browser/gtk/browser_toolbar_gtk.cc8
2 files changed, 5 insertions, 18 deletions
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 ?