| OLD | NEW |
| 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/tab_strip_gtk.h" | 5 #include "chrome/browser/gtk/tab_strip_gtk.h" |
| 6 | 6 |
| 7 #include "base/gfx/gtk_util.h" | 7 #include "base/gfx/gtk_util.h" |
| 8 #include "chrome/browser/browser.h" | 8 #include "chrome/browser/browser.h" |
| 9 #include "chrome/browser/tab_contents/tab_contents.h" | 9 #include "chrome/browser/tab_contents/tab_contents.h" |
| 10 #include "chrome/common/l10n_util.h" | 10 #include "chrome/common/l10n_util.h" |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 // TODO(jhawkins): Move the Layout call out of OnExpose and into methods | 419 // TODO(jhawkins): Move the Layout call out of OnExpose and into methods |
| 420 // that actually affect the layout. | 420 // that actually affect the layout. |
| 421 tabstrip->Layout(); | 421 tabstrip->Layout(); |
| 422 | 422 |
| 423 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 423 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 424 GdkPixbuf* background = rb.LoadPixbuf(IDR_WINDOW_TOP_CENTER); | 424 GdkPixbuf* background = rb.LoadPixbuf(IDR_WINDOW_TOP_CENTER); |
| 425 tabstrip->TileImageInt(background, 0, 0, | 425 tabstrip->TileImageInt(background, 0, 0, |
| 426 tabstrip->tabstrip_.get()->allocation.width, | 426 tabstrip->tabstrip_.get()->allocation.width, |
| 427 tabstrip->tabstrip_.get()->allocation.height); | 427 tabstrip->tabstrip_.get()->allocation.height); |
| 428 | 428 |
| 429 if (model->count() == 0) |
| 430 return TRUE; |
| 431 |
| 429 for (int i = 0; i < model->count(); i++) { | 432 for (int i = 0; i < model->count(); i++) { |
| 430 if (i != selected) { | 433 if (i != selected) { |
| 431 tabstrip->PaintTab(i, false); | 434 tabstrip->PaintTab(i, false); |
| 432 } | 435 } |
| 433 } | 436 } |
| 434 | 437 |
| 435 tabstrip->PaintTab(selected, true); | 438 tabstrip->PaintTab(selected, true); |
| 436 | 439 |
| 437 return TRUE; | 440 return TRUE; |
| 438 } | 441 } |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 | 491 |
| 489 LoadTabImages(); | 492 LoadTabImages(); |
| 490 | 493 |
| 491 // TODO(jhawkins): Move this into ChromeFont. Also, my default gtk font | 494 // TODO(jhawkins): Move this into ChromeFont. Also, my default gtk font |
| 492 // is really ugly compared to the other fonts being used in the UI. | 495 // is really ugly compared to the other fonts being used in the UI. |
| 493 title_font_ = load_default_font(); | 496 title_font_ = load_default_font(); |
| 494 DCHECK(title_font_); | 497 DCHECK(title_font_); |
| 495 title_font_height_ = gdk_char_height(title_font_, 'X'); | 498 title_font_height_ = gdk_char_height(title_font_, 'X'); |
| 496 initialized_ = true; | 499 initialized_ = true; |
| 497 } | 500 } |
| OLD | NEW |