Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(440)

Side by Side Diff: chrome/browser/gtk/bookmark_utils_gtk.cc

Issue 3083022: Rework gfx::Font by moving platform-specific code into inner classes.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/cocoa/status_bubble_mac.mm ('k') | chrome/browser/gtk/options/fonts_page_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/gtk/bookmark_utils_gtk.h" 5 #include "chrome/browser/gtk/bookmark_utils_gtk.h"
6 6
7 #include "app/gtk_dnd_util.h" 7 #include "app/gtk_dnd_util.h"
8 #include "app/l10n_util.h" 8 #include "app/l10n_util.h"
9 #include "app/resource_bundle.h" 9 #include "app/resource_bundle.h"
10 #include "base/pickle.h" 10 #include "base/pickle.h"
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 pixbuf, title, 189 pixbuf, title,
190 provider->GetColor(BrowserThemeProvider::COLOR_BOOKMARK_TEXT)); 190 provider->GetColor(BrowserThemeProvider::COLOR_BOOKMARK_TEXT));
191 g_signal_connect(window, "expose-event", G_CALLBACK(OnDragIconExpose), 191 g_signal_connect(window, "expose-event", G_CALLBACK(OnDragIconExpose),
192 data); 192 data);
193 g_object_ref(window); 193 g_object_ref(window);
194 g_signal_connect(window, "destroy", G_CALLBACK(OnDragIconDestroy), data); 194 g_signal_connect(window, "destroy", G_CALLBACK(OnDragIconDestroy), data);
195 195
196 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 196 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
197 const gfx::Font& base_font = rb.GetFont(ResourceBundle::BaseFont); 197 const gfx::Font& base_font = rb.GetFont(ResourceBundle::BaseFont);
198 gtk_widget_set_size_request(window, kDragRepresentationWidth, 198 gtk_widget_set_size_request(window, kDragRepresentationWidth,
199 base_font.height()); 199 base_font.GetHeight());
200 } else { 200 } else {
201 if (!provider->UseGtkTheme()) { 201 if (!provider->UseGtkTheme()) {
202 // TODO(erg): Theme wise, which color should I be picking here? 202 // TODO(erg): Theme wise, which color should I be picking here?
203 // COLOR_BUTTON_BACKGROUND doesn't match the default theme! 203 // COLOR_BUTTON_BACKGROUND doesn't match the default theme!
204 gtk_widget_modify_bg(window, GTK_STATE_NORMAL, &kBackgroundColor); 204 gtk_widget_modify_bg(window, GTK_STATE_NORMAL, &kBackgroundColor);
205 } 205 }
206 gtk_widget_realize(window); 206 gtk_widget_realize(window);
207 207
208 GtkWidget* frame = gtk_frame_new(NULL); 208 GtkWidget* frame = gtk_frame_new(NULL);
209 gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_OUT); 209 gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_OUT);
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 std::vector<GURL> urls; 416 std::vector<GURL> urls;
417 gtk_dnd_util::ExtractURIList(selection_data, &urls); 417 gtk_dnd_util::ExtractURIList(selection_data, &urls);
418 for (size_t i = 0; i < urls.size(); ++i) { 418 for (size_t i = 0; i < urls.size(); ++i) {
419 std::string title = GetNameForURL(urls[i]); 419 std::string title = GetNameForURL(urls[i]);
420 model->AddURL(parent, idx++, UTF8ToWide(title), urls[i]); 420 model->AddURL(parent, idx++, UTF8ToWide(title), urls[i]);
421 } 421 }
422 return true; 422 return true;
423 } 423 }
424 424
425 } // namespace bookmark_utils 425 } // namespace bookmark_utils
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/status_bubble_mac.mm ('k') | chrome/browser/gtk/options/fonts_page_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698