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" |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
13 #include "base/string16.h" | 13 #include "base/string16.h" |
14 #include "base/utf_string_conversions.h" | 14 #include "base/utf_string_conversions.h" |
15 #include "chrome/browser/bookmarks/bookmark_editor.h" | 15 #include "chrome/browser/bookmarks/bookmark_editor.h" |
16 #include "chrome/browser/bookmarks/bookmark_model.h" | 16 #include "chrome/browser/bookmarks/bookmark_model.h" |
17 #include "chrome/browser/bookmarks/bookmark_utils.h" | 17 #include "chrome/browser/bookmarks/bookmark_utils.h" |
18 #include "chrome/browser/bookmarks/recently_used_folders_combo_model.h" | 18 #include "chrome/browser/bookmarks/recently_used_folders_combo_model.h" |
19 #include "chrome/browser/profiles/profile.h" | 19 #include "chrome/browser/profiles/profile.h" |
20 #include "chrome/browser/ui/browser.h" | 20 #include "chrome/browser/ui/browser.h" |
21 #include "chrome/browser/ui/browser_list.h" | 21 #include "chrome/browser/ui/browser_list.h" |
22 #include "chrome/browser/ui/gtk/gtk_theme_service.h" | 22 #include "chrome/browser/ui/gtk/gtk_theme_service.h" |
23 #include "chrome/browser/ui/gtk/gtk_util.h" | 23 #include "chrome/browser/ui/gtk/gtk_util.h" |
24 #include "chrome/common/chrome_notification_types.h" | 24 #include "chrome/common/chrome_notification_types.h" |
25 #include "content/browser/user_metrics.h" | 25 #include "content/browser/user_metrics.h" |
26 #include "content/common/notification_service.h" | 26 #include "content/common/notification_service.h" |
27 #include "grit/generated_resources.h" | 27 #include "grit/generated_resources.h" |
| 28 #include "ui/base/gtk/gtk_hig_constants.h" |
28 #include "ui/base/l10n/l10n_util.h" | 29 #include "ui/base/l10n/l10n_util.h" |
29 | 30 |
30 namespace { | 31 namespace { |
31 | 32 |
32 // We basically have a singleton, since a bubble is sort of app-modal. This | 33 // We basically have a singleton, since a bubble is sort of app-modal. This |
33 // keeps track of the currently open bubble, or NULL if none is open. | 34 // keeps track of the currently open bubble, or NULL if none is open. |
34 BookmarkBubbleGtk* g_bubble = NULL; | 35 BookmarkBubbleGtk* g_bubble = NULL; |
35 | 36 |
36 // Padding between content and edge of bubble. | 37 // Padding between content and edge of bubble. |
37 const int kContentBorder = 7; | 38 const int kContentBorder = 7; |
(...skipping 28 matching lines...) Expand all Loading... |
66 DCHECK(type == chrome::NOTIFICATION_BROWSER_THEME_CHANGED); | 67 DCHECK(type == chrome::NOTIFICATION_BROWSER_THEME_CHANGED); |
67 | 68 |
68 if (theme_service_->UsingNativeTheme()) { | 69 if (theme_service_->UsingNativeTheme()) { |
69 for (std::vector<GtkWidget*>::iterator it = labels_.begin(); | 70 for (std::vector<GtkWidget*>::iterator it = labels_.begin(); |
70 it != labels_.end(); ++it) { | 71 it != labels_.end(); ++it) { |
71 gtk_widget_modify_fg(*it, GTK_STATE_NORMAL, NULL); | 72 gtk_widget_modify_fg(*it, GTK_STATE_NORMAL, NULL); |
72 } | 73 } |
73 } else { | 74 } else { |
74 for (std::vector<GtkWidget*>::iterator it = labels_.begin(); | 75 for (std::vector<GtkWidget*>::iterator it = labels_.begin(); |
75 it != labels_.end(); ++it) { | 76 it != labels_.end(); ++it) { |
76 gtk_widget_modify_fg(*it, GTK_STATE_NORMAL, >k_util::kGdkBlack); | 77 gtk_widget_modify_fg(*it, GTK_STATE_NORMAL, &ui::kGdkBlack); |
77 } | 78 } |
78 } | 79 } |
79 } | 80 } |
80 | 81 |
81 BookmarkBubbleGtk::BookmarkBubbleGtk(GtkWidget* anchor, | 82 BookmarkBubbleGtk::BookmarkBubbleGtk(GtkWidget* anchor, |
82 Profile* profile, | 83 Profile* profile, |
83 const GURL& url, | 84 const GURL& url, |
84 bool newly_bookmarked) | 85 bool newly_bookmarked) |
85 : url_(url), | 86 : url_(url), |
86 profile_(profile), | 87 profile_(profile), |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 // We always have nodes + 1 entries in the combo. The last entry will be | 342 // We always have nodes + 1 entries in the combo. The last entry will be |
342 // the 'Select another folder...' entry that opens the bookmark editor. | 343 // the 'Select another folder...' entry that opens the bookmark editor. |
343 for (int i = 0; i < folder_combo_model_->GetItemCount(); ++i) { | 344 for (int i = 0; i < folder_combo_model_->GetItemCount(); ++i) { |
344 gtk_combo_box_append_text(GTK_COMBO_BOX(folder_combo_), | 345 gtk_combo_box_append_text(GTK_COMBO_BOX(folder_combo_), |
345 UTF16ToUTF8(folder_combo_model_->GetItemAt(i)).c_str()); | 346 UTF16ToUTF8(folder_combo_model_->GetItemAt(i)).c_str()); |
346 } | 347 } |
347 | 348 |
348 gtk_combo_box_set_active(GTK_COMBO_BOX(folder_combo_), | 349 gtk_combo_box_set_active(GTK_COMBO_BOX(folder_combo_), |
349 folder_combo_model_->node_parent_index()); | 350 folder_combo_model_->node_parent_index()); |
350 } | 351 } |
OLD | NEW |