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

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

Issue 149102: Fix a crash that happens when changing themes. (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 | « no previous file | chrome/browser/gtk/nine_box.h » ('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/browser_window_gtk.h" 5 #include "chrome/browser/gtk/browser_window_gtk.h"
6 6
7 #include <gdk/gdkkeysyms.h> 7 #include <gdk/gdkkeysyms.h>
8 #include <X11/XF86keysym.h> 8 #include <X11/XF86keysym.h>
9 9
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 } 411 }
412 412
413 // Draw the default background. 413 // Draw the default background.
414 // TODO(tc): Handle maximized windows. 414 // TODO(tc): Handle maximized windows.
415 cairo_t* cr = gdk_cairo_create(GDK_DRAWABLE(widget->window)); 415 cairo_t* cr = gdk_cairo_create(GDK_DRAWABLE(widget->window));
416 cairo_rectangle(cr, event->area.x, event->area.y, event->area.width, 416 cairo_rectangle(cr, event->area.x, event->area.y, event->area.width,
417 event->area.height); 417 event->area.height);
418 cairo_clip(cr); 418 cairo_clip(cr);
419 NineBox* image = window->browser()->profile()->IsOffTheRecord() 419 NineBox* image = window->browser()->profile()->IsOffTheRecord()
420 ? default_background_otr : default_background; 420 ? default_background_otr : default_background;
421 image->RenderTopCenterStrip(cr, event->area.x, 0, event->area.width); 421 image->RenderTopCenterStrip(cr, 0, 0, widget->allocation.width);
422 cairo_destroy(cr); 422 cairo_destroy(cr);
423 423
424 // TODO(tc): Draw the theme overlay. The windows code is below. 424 // TODO(tc): Draw the theme overlay. The windows code is below.
425 // if (theme_provider->HasCustomImage(IDR_THEME_FRAME_OVERLAY)) { 425 // if (theme_provider->HasCustomImage(IDR_THEME_FRAME_OVERLAY)) {
426 // SkBitmap* theme_overlay = theme_provider->GetBitmapNamed( 426 // SkBitmap* theme_overlay = theme_provider->GetBitmapNamed(
427 // IDR_THEME_FRAME_OVERLAY); 427 // IDR_THEME_FRAME_OVERLAY);
428 // canvas->DrawBitmapInt(*theme_overlay, 0, 0); 428 // canvas->DrawBitmapInt(*theme_overlay, 0, 0);
429 // } 429 // }
430 430
431 if (window->use_custom_frame_.GetValue()) { 431 if (window->use_custom_frame_.GetValue()) {
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
696 void BrowserWindowGtk::ShowNewProfileDialog() { 696 void BrowserWindowGtk::ShowNewProfileDialog() {
697 NOTIMPLEMENTED(); 697 NOTIMPLEMENTED();
698 } 698 }
699 699
700 void BrowserWindowGtk::ShowHTMLDialog(HtmlDialogUIDelegate* delegate, 700 void BrowserWindowGtk::ShowHTMLDialog(HtmlDialogUIDelegate* delegate,
701 gfx::NativeWindow parent_window) { 701 gfx::NativeWindow parent_window) {
702 NOTIMPLEMENTED(); 702 NOTIMPLEMENTED();
703 } 703 }
704 704
705 void BrowserWindowGtk::UserChangedTheme() { 705 void BrowserWindowGtk::UserChangedTheme() {
706 NOTIMPLEMENTED(); 706 gdk_window_invalidate_rect(GTK_WIDGET(window_)->window,
707 &GTK_WIDGET(window_)->allocation, TRUE);
707 } 708 }
708 709
709 int BrowserWindowGtk::GetExtraRenderViewHeight() const { 710 int BrowserWindowGtk::GetExtraRenderViewHeight() const {
710 int sum = infobar_container_->TotalHeightOfClosingBars(); 711 int sum = infobar_container_->TotalHeightOfClosingBars();
711 if (bookmark_bar_->IsClosing()) 712 if (bookmark_bar_->IsClosing())
712 sum += bookmark_bar_->GetHeight(); 713 sum += bookmark_bar_->GetHeight();
713 if (download_shelf_.get() && download_shelf_->IsClosing()) { 714 if (download_shelf_.get() && download_shelf_->IsClosing()) {
714 sum += download_shelf_->GetHeight(); 715 sum += download_shelf_->GetHeight();
715 } 716 }
716 return sum; 717 return sum;
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
1326 *edge = GDK_WINDOW_EDGE_NORTH_EAST; 1327 *edge = GDK_WINDOW_EDGE_NORTH_EAST;
1327 } else if (y < bounds_.height() - kResizeAreaCornerSize) { 1328 } else if (y < bounds_.height() - kResizeAreaCornerSize) {
1328 *edge = GDK_WINDOW_EDGE_EAST; 1329 *edge = GDK_WINDOW_EDGE_EAST;
1329 } else { 1330 } else {
1330 *edge = GDK_WINDOW_EDGE_SOUTH_EAST; 1331 *edge = GDK_WINDOW_EDGE_SOUTH_EAST;
1331 } 1332 }
1332 return true; 1333 return true;
1333 } 1334 }
1334 NOTREACHED(); 1335 NOTREACHED();
1335 } 1336 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/gtk/nine_box.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698