| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/gtk/bookmarks/bookmark_bubble_gtk.h" | 5 #include "chrome/browser/ui/gtk/bookmarks/bookmark_bubble_gtk.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 } | 45 } |
| 46 | 46 |
| 47 void BookmarkBubbleGtk::BubbleClosing(BubbleGtk* bubble, | 47 void BookmarkBubbleGtk::BubbleClosing(BubbleGtk* bubble, |
| 48 bool closed_by_escape) { | 48 bool closed_by_escape) { |
| 49 if (closed_by_escape) { | 49 if (closed_by_escape) { |
| 50 remove_bookmark_ = newly_bookmarked_; | 50 remove_bookmark_ = newly_bookmarked_; |
| 51 apply_edits_ = false; | 51 apply_edits_ = false; |
| 52 } | 52 } |
| 53 | 53 |
| 54 NotificationService::current()->Notify( | 54 NotificationService::current()->Notify( |
| 55 NotificationType::BOOKMARK_BUBBLE_HIDDEN, | 55 chrome::BOOKMARK_BUBBLE_HIDDEN, |
| 56 Source<Profile>(profile_->GetOriginalProfile()), | 56 Source<Profile>(profile_->GetOriginalProfile()), |
| 57 NotificationService::NoDetails()); | 57 NotificationService::NoDetails()); |
| 58 } | 58 } |
| 59 | 59 |
| 60 void BookmarkBubbleGtk::Observe(NotificationType type, | 60 void BookmarkBubbleGtk::Observe(NotificationType type, |
| 61 const NotificationSource& source, | 61 const NotificationSource& source, |
| 62 const NotificationDetails& details) { | 62 const NotificationDetails& details) { |
| 63 DCHECK(type == NotificationType::BROWSER_THEME_CHANGED); | 63 DCHECK(type == chrome::BROWSER_THEME_CHANGED); |
| 64 | 64 |
| 65 if (theme_service_->UsingNativeTheme()) { | 65 if (theme_service_->UsingNativeTheme()) { |
| 66 for (std::vector<GtkWidget*>::iterator it = labels_.begin(); | 66 for (std::vector<GtkWidget*>::iterator it = labels_.begin(); |
| 67 it != labels_.end(); ++it) { | 67 it != labels_.end(); ++it) { |
| 68 gtk_widget_modify_fg(*it, GTK_STATE_NORMAL, NULL); | 68 gtk_widget_modify_fg(*it, GTK_STATE_NORMAL, NULL); |
| 69 } | 69 } |
| 70 } else { | 70 } else { |
| 71 for (std::vector<GtkWidget*>::iterator it = labels_.begin(); | 71 for (std::vector<GtkWidget*>::iterator it = labels_.begin(); |
| 72 it != labels_.end(); ++it) { | 72 it != labels_.end(); ++it) { |
| 73 gtk_widget_modify_fg(*it, GTK_STATE_NORMAL, >k_util::kGdkBlack); | 73 gtk_widget_modify_fg(*it, GTK_STATE_NORMAL, >k_util::kGdkBlack); |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 G_CALLBACK(&OnFolderChangedThunk), this); | 174 G_CALLBACK(&OnFolderChangedThunk), this); |
| 175 g_signal_connect(folder_combo_, "notify::popup-shown", | 175 g_signal_connect(folder_combo_, "notify::popup-shown", |
| 176 G_CALLBACK(&OnFolderPopupShownThunk), this); | 176 G_CALLBACK(&OnFolderPopupShownThunk), this); |
| 177 g_signal_connect(edit_button, "clicked", | 177 g_signal_connect(edit_button, "clicked", |
| 178 G_CALLBACK(&OnEditClickedThunk), this); | 178 G_CALLBACK(&OnEditClickedThunk), this); |
| 179 g_signal_connect(close_button, "clicked", | 179 g_signal_connect(close_button, "clicked", |
| 180 G_CALLBACK(&OnCloseClickedThunk), this); | 180 G_CALLBACK(&OnCloseClickedThunk), this); |
| 181 g_signal_connect(remove_button_, "clicked", | 181 g_signal_connect(remove_button_, "clicked", |
| 182 G_CALLBACK(&OnRemoveClickedThunk), this); | 182 G_CALLBACK(&OnRemoveClickedThunk), this); |
| 183 | 183 |
| 184 registrar_.Add(this, NotificationType::BROWSER_THEME_CHANGED, | 184 registrar_.Add(this, chrome::BROWSER_THEME_CHANGED, |
| 185 Source<ThemeService>(theme_service_)); | 185 Source<ThemeService>(theme_service_)); |
| 186 theme_service_->InitThemesFor(this); | 186 theme_service_->InitThemesFor(this); |
| 187 } | 187 } |
| 188 | 188 |
| 189 BookmarkBubbleGtk::~BookmarkBubbleGtk() { | 189 BookmarkBubbleGtk::~BookmarkBubbleGtk() { |
| 190 DCHECK(!content_); // |content_| should have already been destroyed. | 190 DCHECK(!content_); // |content_| should have already been destroyed. |
| 191 | 191 |
| 192 DCHECK(g_bubble); | 192 DCHECK(g_bubble); |
| 193 g_bubble = NULL; | 193 g_bubble = NULL; |
| 194 | 194 |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 // We always have nodes + 1 entries in the combo. The last entry will be | 330 // We always have nodes + 1 entries in the combo. The last entry will be |
| 331 // the 'Select another folder...' entry that opens the bookmark editor. | 331 // the 'Select another folder...' entry that opens the bookmark editor. |
| 332 for (int i = 0; i < folder_combo_model_->GetItemCount(); ++i) { | 332 for (int i = 0; i < folder_combo_model_->GetItemCount(); ++i) { |
| 333 gtk_combo_box_append_text(GTK_COMBO_BOX(folder_combo_), | 333 gtk_combo_box_append_text(GTK_COMBO_BOX(folder_combo_), |
| 334 UTF16ToUTF8(folder_combo_model_->GetItemAt(i)).c_str()); | 334 UTF16ToUTF8(folder_combo_model_->GetItemAt(i)).c_str()); |
| 335 } | 335 } |
| 336 | 336 |
| 337 gtk_combo_box_set_active(GTK_COMBO_BOX(folder_combo_), | 337 gtk_combo_box_set_active(GTK_COMBO_BOX(folder_combo_), |
| 338 folder_combo_model_->node_parent_index()); | 338 folder_combo_model_->node_parent_index()); |
| 339 } | 339 } |
| OLD | NEW |