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

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

Issue 1149002: Try and force the font size for the bookmarks bar and some hint (Closed)
Patch Set: Created 10 years, 9 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
« no previous file with comments | « chrome/browser/gtk/bookmark_utils_gtk.cc ('k') | no next file » | 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/location_bar_view_gtk.h" 5 #include "chrome/browser/gtk/location_bar_view_gtk.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "app/gfx/canvas_paint.h" 9 #include "app/gfx/canvas_paint.h"
10 #include "app/l10n_util.h" 10 #include "app/l10n_util.h"
11 #include "app/resource_bundle.h" 11 #include "app/resource_bundle.h"
12 #include "base/basictypes.h" 12 #include "base/basictypes.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/string_util.h" 14 #include "base/string_util.h"
15 #include "chrome/app/chrome_dll_resource.h" 15 #include "chrome/app/chrome_dll_resource.h"
16 #include "chrome/browser/accessibility_events.h" 16 #include "chrome/browser/accessibility_events.h"
17 #include "chrome/browser/alternate_nav_url_fetcher.h" 17 #include "chrome/browser/alternate_nav_url_fetcher.h"
18 #include "chrome/browser/autocomplete/autocomplete_edit_view_gtk.h" 18 #include "chrome/browser/autocomplete/autocomplete_edit_view_gtk.h"
19 #include "chrome/browser/browser.h" 19 #include "chrome/browser/browser.h"
20 #include "chrome/browser/browser_list.h" 20 #include "chrome/browser/browser_list.h"
21 #include "chrome/browser/command_updater.h" 21 #include "chrome/browser/command_updater.h"
22 #include "chrome/browser/content_setting_bubble_model.h" 22 #include "chrome/browser/content_setting_bubble_model.h"
23 #include "chrome/browser/content_setting_image_model.h" 23 #include "chrome/browser/content_setting_image_model.h"
24 #include "chrome/browser/defaults.h"
24 #include "chrome/browser/extensions/extension_accessibility_api_constants.h" 25 #include "chrome/browser/extensions/extension_accessibility_api_constants.h"
25 #include "chrome/browser/extensions/extension_action_context_menu_model.h" 26 #include "chrome/browser/extensions/extension_action_context_menu_model.h"
26 #include "chrome/browser/extensions/extension_browser_event_router.h" 27 #include "chrome/browser/extensions/extension_browser_event_router.h"
27 #include "chrome/browser/extensions/extension_tabs_module.h" 28 #include "chrome/browser/extensions/extension_tabs_module.h"
28 #include "chrome/browser/extensions/extensions_service.h" 29 #include "chrome/browser/extensions/extensions_service.h"
29 #include "chrome/browser/gtk/cairo_cached_surface.h" 30 #include "chrome/browser/gtk/cairo_cached_surface.h"
30 #include "chrome/browser/gtk/content_blocked_bubble_gtk.h" 31 #include "chrome/browser/gtk/content_blocked_bubble_gtk.h"
31 #include "chrome/browser/gtk/extension_popup_gtk.h" 32 #include "chrome/browser/gtk/extension_popup_gtk.h"
32 #include "chrome/browser/gtk/first_run_bubble.h" 33 #include "chrome/browser/gtk/first_run_bubble.h"
33 #include "chrome/browser/gtk/gtk_theme_provider.h" 34 #include "chrome/browser/gtk/gtk_theme_provider.h"
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after
343 gtk_box_pack_end(GTK_BOX(content_setting_hbox_.get()), 344 gtk_box_pack_end(GTK_BOX(content_setting_hbox_.get()),
344 content_setting_view->widget(), FALSE, FALSE, 0); 345 content_setting_view->widget(), FALSE, FALSE, 0);
345 } 346 }
346 347
347 page_action_hbox_.Own(gtk_hbox_new(FALSE, kInnerPadding)); 348 page_action_hbox_.Own(gtk_hbox_new(FALSE, kInnerPadding));
348 gtk_widget_set_name(page_action_hbox_.get(), 349 gtk_widget_set_name(page_action_hbox_.get(),
349 "chrome-page-action-hbox"); 350 "chrome-page-action-hbox");
350 gtk_box_pack_end(GTK_BOX(hbox_.get()), page_action_hbox_.get(), 351 gtk_box_pack_end(GTK_BOX(hbox_.get()), page_action_hbox_.get(),
351 FALSE, FALSE, 0); 352 FALSE, FALSE, 0);
352 353
354 // Until we switch to vector graphics, force the font size of labels.
355 gtk_util::ForceFontSizePixels(type_to_search_hint_,
356 browser_defaults::kAutocompleteEditFontPixelSize);
357 gtk_util::ForceFontSizePixels(info_label_,
358 browser_defaults::kAutocompleteEditFontPixelSize);
359 gtk_util::ForceFontSizePixels(tab_to_search_full_label_,
360 browser_defaults::kAutocompleteEditFontPixelSize);
361 gtk_util::ForceFontSizePixels(tab_to_search_partial_label_,
362 browser_defaults::kAutocompleteEditFontPixelSize);
363 gtk_util::ForceFontSizePixels(tab_to_search_hint_leading_label_,
364 browser_defaults::kAutocompleteEditFontPixelSize);
365 gtk_util::ForceFontSizePixels(tab_to_search_hint_trailing_label_,
366 browser_defaults::kAutocompleteEditFontPixelSize);
367 gtk_util::ForceFontSizePixels(type_to_search_hint_,
368 browser_defaults::kAutocompleteEditFontPixelSize);
369
353 registrar_.Add(this, 370 registrar_.Add(this,
354 NotificationType::BROWSER_THEME_CHANGED, 371 NotificationType::BROWSER_THEME_CHANGED,
355 NotificationService::AllSources()); 372 NotificationService::AllSources());
356 theme_provider_ = GtkThemeProvider::GetFrom(profile_); 373 theme_provider_ = GtkThemeProvider::GetFrom(profile_);
357 theme_provider_->InitThemesFor(this); 374 theme_provider_->InitThemesFor(this);
358 } 375 }
359 376
360 void LocationBarViewGtk::SetProfile(Profile* profile) { 377 void LocationBarViewGtk::SetProfile(Profile* profile) {
361 profile_ = profile; 378 profile_ = profile;
362 } 379 }
(...skipping 879 matching lines...) Expand 10 before | Expand all | Expand 10 after
1242 1259
1243 std::string badge_text = page_action_->GetBadgeText(tab_id); 1260 std::string badge_text = page_action_->GetBadgeText(tab_id);
1244 if (badge_text.empty()) 1261 if (badge_text.empty())
1245 return FALSE; 1262 return FALSE;
1246 1263
1247 gfx::CanvasPaint canvas(event, false); 1264 gfx::CanvasPaint canvas(event, false);
1248 gfx::Rect bounding_rect(widget->allocation); 1265 gfx::Rect bounding_rect(widget->allocation);
1249 page_action_->PaintBadge(&canvas, bounding_rect, tab_id); 1266 page_action_->PaintBadge(&canvas, bounding_rect, tab_id);
1250 return FALSE; 1267 return FALSE;
1251 } 1268 }
OLDNEW
« no previous file with comments | « chrome/browser/gtk/bookmark_utils_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698