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

Side by Side Diff: chrome/browser/gtk/tabs/tab_renderer_gtk.cc

Issue 125109: Refactor the PlatformContext layer to have only one class. (Closed)
Patch Set: Created 11 years, 6 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/sad_tab_gtk.cc ('k') | chrome/browser/gtk/tabs/tab_strip_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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/tabs/tab_renderer_gtk.h" 5 #include "chrome/browser/gtk/tabs/tab_renderer_gtk.h"
6 6
7 #include "app/gfx/canvas_paint.h"
7 #include "app/l10n_util.h" 8 #include "app/l10n_util.h"
8 #include "app/resource_bundle.h" 9 #include "app/resource_bundle.h"
9 #include "chrome/browser/browser.h" 10 #include "chrome/browser/browser.h"
10 #include "chrome/browser/browser_theme_provider.h" 11 #include "chrome/browser/browser_theme_provider.h"
11 #include "chrome/browser/gtk/custom_button.h" 12 #include "chrome/browser/gtk/custom_button.h"
12 #include "chrome/browser/profile.h" 13 #include "chrome/browser/profile.h"
13 #include "chrome/browser/tab_contents/tab_contents.h" 14 #include "chrome/browser/tab_contents/tab_contents.h"
14 #include "grit/app_resources.h" 15 #include "grit/app_resources.h"
15 #include "grit/generated_resources.h" 16 #include "grit/generated_resources.h"
16 #include "grit/theme_resources.h" 17 #include "grit/theme_resources.h"
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 gtk_fixed_move(GTK_FIXED(tab_.get()), close_button_->widget(), 504 gtk_fixed_move(GTK_FIXED(tab_.get()), close_button_->widget(),
504 close_button_bounds_.x(), close_button_bounds_.y()); 505 close_button_bounds_.x(), close_button_bounds_.y());
505 gtk_widget_show(close_button_->widget()); 506 gtk_widget_show(close_button_->widget());
506 } else { 507 } else {
507 gtk_widget_hide(close_button_->widget()); 508 gtk_widget_hide(close_button_->widget());
508 } 509 }
509 } 510 }
510 511
511 void TabRendererGtk::PaintTab(GdkEventExpose* event) { 512 void TabRendererGtk::PaintTab(GdkEventExpose* event) {
512 gfx::CanvasPaint canvas(event, false); 513 gfx::CanvasPaint canvas(event, false);
513 if (canvas.isEmpty()) 514 if (canvas.is_empty())
514 return; 515 return;
515 516
516 // The tab is rendered into a windowless widget whose offset is at the 517 // The tab is rendered into a windowless widget whose offset is at the
517 // coordinate [x(), y()]. Translate by that offset so we can render at (0,0) 518 // coordinate [x(), y()]. Translate by that offset so we can render at (0,0)
518 // to match windows rendering metrics. 519 // to match windows rendering metrics.
519 canvas.TranslateInt(x(), y()); 520 canvas.TranslateInt(x(), y());
520 Paint(&canvas); 521 Paint(&canvas);
521 } 522 }
522 523
523 void TabRendererGtk::PaintTabBackground(gfx::Canvas* canvas) { 524 void TabRendererGtk::PaintTabBackground(gfx::Canvas* canvas) {
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after
726 gfx::Font base_font = rb.GetFont(ResourceBundle::BaseFont); 727 gfx::Font base_font = rb.GetFont(ResourceBundle::BaseFont);
727 title_font_ = new gfx::Font(gfx::Font::CreateFont(base_font.FontName(), 10)); 728 title_font_ = new gfx::Font(gfx::Font::CreateFont(base_font.FontName(), 10));
728 title_font_height_ = title_font_->height(); 729 title_font_height_ = title_font_->height();
729 730
730 InitializeLoadingAnimationData(&rb, &loading_animation_data); 731 InitializeLoadingAnimationData(&rb, &loading_animation_data);
731 732
732 crashed_fav_icon = rb.GetBitmapNamed(IDR_SAD_FAVICON); 733 crashed_fav_icon = rb.GetBitmapNamed(IDR_SAD_FAVICON);
733 734
734 initialized_ = true; 735 initialized_ = true;
735 } 736 }
OLDNEW
« no previous file with comments | « chrome/browser/gtk/sad_tab_gtk.cc ('k') | chrome/browser/gtk/tabs/tab_strip_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698