summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk/bookmark_bar_gtk.cc
diff options
context:
space:
mode:
authorzork@chromium.org <zork@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-15 17:32:20 +0000
committerzork@chromium.org <zork@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-15 17:32:20 +0000
commit44b78f90aa7fb40d6694045f4da76c502dea2272 (patch)
tree8b2d947065d5b00f5b12a61407134438b7a0446d /chrome/browser/gtk/bookmark_bar_gtk.cc
parent08b8f440a84673f70cdfbd52d3918c4a31d3ba90 (diff)
downloadchromium_src-44b78f90aa7fb40d6694045f4da76c502dea2272.zip
chromium_src-44b78f90aa7fb40d6694045f4da76c502dea2272.tar.gz
chromium_src-44b78f90aa7fb40d6694045f4da76c502dea2272.tar.bz2
Fix pieces of syncapi that aren't implemented on Linux.
Review URL: http://codereview.chromium.org/242141 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29134 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk/bookmark_bar_gtk.cc')
-rw-r--r--chrome/browser/gtk/bookmark_bar_gtk.cc31
1 files changed, 31 insertions, 0 deletions
diff --git a/chrome/browser/gtk/bookmark_bar_gtk.cc b/chrome/browser/gtk/bookmark_bar_gtk.cc
index eb71258..191844c 100644
--- a/chrome/browser/gtk/bookmark_bar_gtk.cc
+++ b/chrome/browser/gtk/bookmark_bar_gtk.cc
@@ -118,6 +118,10 @@ BookmarkBarGtk::BookmarkBarGtk(BrowserWindowGtk* window,
model_(NULL),
instructions_label_(NULL),
instructions_(NULL),
+#ifdef CHROME_PERSONALIZATION
+ sync_error_button_(NULL),
+ sync_service_(NULL),
+#endif
dragged_node_(NULL),
toolbar_drop_item_(NULL),
theme_provider_(GtkThemeProvider::GetFrom(profile)),
@@ -125,6 +129,15 @@ BookmarkBarGtk::BookmarkBarGtk(BrowserWindowGtk* window,
menu_bar_helper_(this),
floating_(false),
last_allocation_width_(-1) {
+#ifdef CHROME_PERSONALIZATION
+ if (profile->GetProfileSyncService()) {
+ // Obtain a pointer to the profile sync service and add our instance as an
+ // observer.
+ sync_service_ = profile->GetProfileSyncService();
+ sync_service_->AddObserver(this);
+ }
+#endif
+
Init(profile);
SetProfile(profile);
// Force an update by simulating being in the wrong state.
@@ -142,6 +155,11 @@ BookmarkBarGtk::~BookmarkBarGtk() {
RemoveAllBookmarkButtons();
bookmark_toolbar_.Destroy();
event_box_.Destroy();
+
+#ifdef CHROME_PERSONALIZATION
+ if (sync_service_)
+ sync_service_->RemoveObserver(this);
+#endif
}
void BookmarkBarGtk::SetProfile(Profile* profile) {
@@ -248,6 +266,13 @@ void BookmarkBarGtk::Init(Profile* profile) {
g_signal_connect(vseparator, "expose-event",
G_CALLBACK(OnSeparatorExpose), this);
+#ifdef CHROME_PERSONALIZATION
+ sync_error_button_ = theme_provider_->BuildChromeButton();
+ ConnectFolderButtonEvents(sync_error_button_);
+ gtk_box_pack_start(GTK_BOX(bookmark_hbox_), sync_error_button_,
+ FALSE, FALSE, 0);
+#endif
+
// We pack the button manually (rather than using gtk_button_set_*) so that
// we can have finer control over its label.
other_bookmarks_button_ = theme_provider_->BuildChromeButton();
@@ -311,6 +336,12 @@ void BookmarkBarGtk::Hide(bool animate) {
}
}
+#ifdef CHROME_PERSONALIZATION
+void BookmarkBarGtk::OnStateChanged() {
+ // TODO(zork): TODO
+}
+#endif
+
void BookmarkBarGtk::EnterFullscreen() {
UpdateFloatingState();
if (!floating_)