| 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/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 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 } | 712 } |
| 713 | 713 |
| 714 void BrowserWindowGtk::UserChangedTheme() { | 714 void BrowserWindowGtk::UserChangedTheme() { |
| 715 SetBackgroundColor(); | 715 SetBackgroundColor(); |
| 716 gdk_window_invalidate_rect(GTK_WIDGET(window_)->window, | 716 gdk_window_invalidate_rect(GTK_WIDGET(window_)->window, |
| 717 >K_WIDGET(window_)->allocation, TRUE); | 717 >K_WIDGET(window_)->allocation, TRUE); |
| 718 | 718 |
| 719 toolbar_->UserChangedTheme(); | 719 toolbar_->UserChangedTheme(); |
| 720 GtkThemeProperties properties(browser_->profile()); | 720 GtkThemeProperties properties(browser_->profile()); |
| 721 bookmark_bar_->UserChangedTheme(&properties); | 721 bookmark_bar_->UserChangedTheme(&properties); |
| 722 status_bubble_->UserChangedTheme(&properties); |
| 722 } | 723 } |
| 723 | 724 |
| 724 int BrowserWindowGtk::GetExtraRenderViewHeight() const { | 725 int BrowserWindowGtk::GetExtraRenderViewHeight() const { |
| 725 int sum = infobar_container_->TotalHeightOfClosingBars(); | 726 int sum = infobar_container_->TotalHeightOfClosingBars(); |
| 726 if (bookmark_bar_->IsClosing()) | 727 if (bookmark_bar_->IsClosing()) |
| 727 sum += bookmark_bar_->GetHeight(); | 728 sum += bookmark_bar_->GetHeight(); |
| 728 if (download_shelf_.get() && download_shelf_->IsClosing()) { | 729 if (download_shelf_.get() && download_shelf_->IsClosing()) { |
| 729 sum += download_shelf_->GetHeight(); | 730 sum += download_shelf_->GetHeight(); |
| 730 } | 731 } |
| 731 return sum; | 732 return sum; |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1013 // The reason is that this area as a whole needs to be grouped in its own | 1014 // The reason is that this area as a whole needs to be grouped in its own |
| 1014 // GdkWindow hierarchy so that animations originating inside it (infobar, | 1015 // GdkWindow hierarchy so that animations originating inside it (infobar, |
| 1015 // download shelf, find bar) are all clipped to that area. This is why | 1016 // download shelf, find bar) are all clipped to that area. This is why |
| 1016 // |render_area_vbox_| is packed in |event_box|. | 1017 // |render_area_vbox_| is packed in |event_box|. |
| 1017 render_area_vbox_ = gtk_vbox_new(FALSE, 0); | 1018 render_area_vbox_ = gtk_vbox_new(FALSE, 0); |
| 1018 infobar_container_.reset(new InfoBarContainerGtk(this)); | 1019 infobar_container_.reset(new InfoBarContainerGtk(this)); |
| 1019 gtk_box_pack_start(GTK_BOX(render_area_vbox_), | 1020 gtk_box_pack_start(GTK_BOX(render_area_vbox_), |
| 1020 infobar_container_->widget(), | 1021 infobar_container_->widget(), |
| 1021 FALSE, FALSE, 0); | 1022 FALSE, FALSE, 0); |
| 1022 | 1023 |
| 1023 status_bubble_.reset(new StatusBubbleGtk()); | 1024 status_bubble_.reset(new StatusBubbleGtk(browser_->profile())); |
| 1024 | 1025 |
| 1025 contents_container_.reset(new TabContentsContainerGtk(status_bubble_.get())); | 1026 contents_container_.reset(new TabContentsContainerGtk(status_bubble_.get())); |
| 1026 contents_container_->AddContainerToBox(render_area_vbox_); | 1027 contents_container_->AddContainerToBox(render_area_vbox_); |
| 1027 gtk_widget_show_all(render_area_vbox_); | 1028 gtk_widget_show_all(render_area_vbox_); |
| 1028 | 1029 |
| 1029 // We have to realize the window before we try to apply a window shape mask. | 1030 // We have to realize the window before we try to apply a window shape mask. |
| 1030 gtk_widget_realize(GTK_WIDGET(window_)); | 1031 gtk_widget_realize(GTK_WIDGET(window_)); |
| 1031 state_ = gdk_window_get_state(GTK_WIDGET(window_)->window); | 1032 state_ = gdk_window_get_state(GTK_WIDGET(window_)->window); |
| 1032 // Note that calling this the first time is necessary to get the | 1033 // Note that calling this the first time is necessary to get the |
| 1033 // proper control layout. | 1034 // proper control layout. |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1350 *edge = GDK_WINDOW_EDGE_NORTH_EAST; | 1351 *edge = GDK_WINDOW_EDGE_NORTH_EAST; |
| 1351 } else if (y < bounds_.height() - kResizeAreaCornerSize) { | 1352 } else if (y < bounds_.height() - kResizeAreaCornerSize) { |
| 1352 *edge = GDK_WINDOW_EDGE_EAST; | 1353 *edge = GDK_WINDOW_EDGE_EAST; |
| 1353 } else { | 1354 } else { |
| 1354 *edge = GDK_WINDOW_EDGE_SOUTH_EAST; | 1355 *edge = GDK_WINDOW_EDGE_SOUTH_EAST; |
| 1355 } | 1356 } |
| 1356 return true; | 1357 return true; |
| 1357 } | 1358 } |
| 1358 NOTREACHED(); | 1359 NOTREACHED(); |
| 1359 } | 1360 } |
| OLD | NEW |