| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 10 #include "base/bind.h" |
| 11 #include "base/i18n/rtl.h" | 11 #include "base/i18n/rtl.h" |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
| 14 #include "base/string16.h" | 14 #include "base/string16.h" |
| 15 #include "base/utf_string_conversions.h" | 15 #include "base/utf_string_conversions.h" |
| 16 #include "chrome/browser/bookmarks/bookmark_editor.h" | 16 #include "chrome/browser/bookmarks/bookmark_editor.h" |
| 17 #include "chrome/browser/bookmarks/bookmark_model.h" | 17 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 18 #include "chrome/browser/bookmarks/bookmark_utils.h" | 18 #include "chrome/browser/bookmarks/bookmark_utils.h" |
| 19 #include "chrome/browser/bookmarks/recently_used_folders_combo_model.h" | 19 #include "chrome/browser/bookmarks/recently_used_folders_combo_model.h" |
| 20 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
| 21 #include "chrome/browser/ui/browser.h" | 21 #include "chrome/browser/ui/browser.h" |
| 22 #include "chrome/browser/ui/browser_list.h" | 22 #include "chrome/browser/ui/browser_list.h" |
| 23 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | |
| 24 #include "chrome/browser/ui/gtk/gtk_util.h" | 23 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 24 #include "chrome/browser/ui/gtk/theme_service_gtk.h" |
| 25 #include "chrome/common/chrome_notification_types.h" | 25 #include "chrome/common/chrome_notification_types.h" |
| 26 #include "content/public/browser/notification_service.h" | 26 #include "content/public/browser/notification_service.h" |
| 27 #include "content/public/browser/user_metrics.h" | 27 #include "content/public/browser/user_metrics.h" |
| 28 #include "grit/generated_resources.h" | 28 #include "grit/generated_resources.h" |
| 29 #include "ui/base/gtk/gtk_hig_constants.h" | 29 #include "ui/base/gtk/gtk_hig_constants.h" |
| 30 #include "ui/base/l10n/l10n_util.h" | 30 #include "ui/base/l10n/l10n_util.h" |
| 31 | 31 |
| 32 using content::UserMetricsAction; | 32 using content::UserMetricsAction; |
| 33 | 33 |
| 34 namespace { | 34 namespace { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 } | 85 } |
| 86 } | 86 } |
| 87 | 87 |
| 88 BookmarkBubbleGtk::BookmarkBubbleGtk(GtkWidget* anchor, | 88 BookmarkBubbleGtk::BookmarkBubbleGtk(GtkWidget* anchor, |
| 89 Profile* profile, | 89 Profile* profile, |
| 90 const GURL& url, | 90 const GURL& url, |
| 91 bool newly_bookmarked) | 91 bool newly_bookmarked) |
| 92 : url_(url), | 92 : url_(url), |
| 93 profile_(profile), | 93 profile_(profile), |
| 94 model_(profile->GetBookmarkModel()), | 94 model_(profile->GetBookmarkModel()), |
| 95 theme_service_(GtkThemeService::GetFrom(profile_)), | 95 theme_service_(ThemeServiceGtk::GetFrom(profile_)), |
| 96 anchor_(anchor), | 96 anchor_(anchor), |
| 97 content_(NULL), | 97 content_(NULL), |
| 98 name_entry_(NULL), | 98 name_entry_(NULL), |
| 99 folder_combo_(NULL), | 99 folder_combo_(NULL), |
| 100 bubble_(NULL), | 100 bubble_(NULL), |
| 101 factory_(this), | 101 factory_(this), |
| 102 newly_bookmarked_(newly_bookmarked), | 102 newly_bookmarked_(newly_bookmarked), |
| 103 apply_edits_(true), | 103 apply_edits_(true), |
| 104 remove_bookmark_(false) { | 104 remove_bookmark_(false) { |
| 105 GtkWidget* label = gtk_label_new(l10n_util::GetStringUTF8( | 105 GtkWidget* label = gtk_label_new(l10n_util::GetStringUTF8( |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 // We always have nodes + 1 entries in the combo. The last entry will be | 335 // We always have nodes + 1 entries in the combo. The last entry will be |
| 336 // the 'Select another folder...' entry that opens the bookmark editor. | 336 // the 'Select another folder...' entry that opens the bookmark editor. |
| 337 for (int i = 0; i < folder_combo_model_->GetItemCount(); ++i) { | 337 for (int i = 0; i < folder_combo_model_->GetItemCount(); ++i) { |
| 338 gtk_combo_box_append_text(GTK_COMBO_BOX(folder_combo_), | 338 gtk_combo_box_append_text(GTK_COMBO_BOX(folder_combo_), |
| 339 UTF16ToUTF8(folder_combo_model_->GetItemAt(i)).c_str()); | 339 UTF16ToUTF8(folder_combo_model_->GetItemAt(i)).c_str()); |
| 340 } | 340 } |
| 341 | 341 |
| 342 gtk_combo_box_set_active(GTK_COMBO_BOX(folder_combo_), | 342 gtk_combo_box_set_active(GTK_COMBO_BOX(folder_combo_), |
| 343 folder_combo_model_->node_parent_index()); | 343 folder_combo_model_->node_parent_index()); |
| 344 } | 344 } |
| OLD | NEW |