OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/gtk/browser_window_gtk.h" | 5 #include "chrome/browser/ui/gtk/browser_window_gtk.h" |
6 | 6 |
7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
8 | 8 |
9 #include <dlfcn.h> | 9 #include <dlfcn.h> |
10 #include <string> | 10 #include <string> |
(...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1298 if (rwhv) | 1298 if (rwhv) |
1299 rwhv->SetVisuallyDeemphasized(NULL, false); | 1299 rwhv->SetVisuallyDeemphasized(NULL, false); |
1300 } | 1300 } |
1301 | 1301 |
1302 void BrowserWindowGtk::MaybeShowBookmarkBar(bool animate) { | 1302 void BrowserWindowGtk::MaybeShowBookmarkBar(bool animate) { |
1303 if (!IsBookmarkBarSupported()) | 1303 if (!IsBookmarkBarSupported()) |
1304 return; | 1304 return; |
1305 | 1305 |
1306 TabContentsWrapper* tab = GetDisplayedTab(); | 1306 TabContentsWrapper* tab = GetDisplayedTab(); |
1307 | 1307 |
1308 if (tab) { | 1308 if (tab) |
1309 bookmark_bar_->SetProfile(tab->profile()); | |
1310 bookmark_bar_->SetPageNavigator(browser_.get()); | 1309 bookmark_bar_->SetPageNavigator(browser_.get()); |
1311 } | |
1312 | 1310 |
1313 BookmarkBar::State state = browser_->bookmark_bar_state(); | 1311 BookmarkBar::State state = browser_->bookmark_bar_state(); |
1314 if (contents_container_->HasPreview() && state == BookmarkBar::DETACHED) | 1312 if (contents_container_->HasPreview() && state == BookmarkBar::DETACHED) |
1315 state = BookmarkBar::HIDDEN; | 1313 state = BookmarkBar::HIDDEN; |
1316 | 1314 |
1317 toolbar_->UpdateForBookmarkBarVisibility(state == BookmarkBar::DETACHED); | 1315 toolbar_->UpdateForBookmarkBarVisibility(state == BookmarkBar::DETACHED); |
1318 PlaceBookmarkBar(state == BookmarkBar::DETACHED); | 1316 PlaceBookmarkBar(state == BookmarkBar::DETACHED); |
1319 bookmark_bar_->SetBookmarkBarState( | 1317 bookmark_bar_->SetBookmarkBarState( |
1320 state, | 1318 state, |
1321 animate ? BookmarkBar::ANIMATE_STATE_CHANGE : | 1319 animate ? BookmarkBar::ANIMATE_STATE_CHANGE : |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1680 tabstrip_->Init(); | 1678 tabstrip_->Init(); |
1681 | 1679 |
1682 // Build the titlebar (tabstrip + header space + min/max/close buttons). | 1680 // Build the titlebar (tabstrip + header space + min/max/close buttons). |
1683 titlebar_.reset(new BrowserTitlebar(this, window_)); | 1681 titlebar_.reset(new BrowserTitlebar(this, window_)); |
1684 | 1682 |
1685 // Insert the tabstrip into the window. | 1683 // Insert the tabstrip into the window. |
1686 gtk_box_pack_start(GTK_BOX(window_vbox_), titlebar_->widget(), FALSE, FALSE, | 1684 gtk_box_pack_start(GTK_BOX(window_vbox_), titlebar_->widget(), FALSE, FALSE, |
1687 0); | 1685 0); |
1688 | 1686 |
1689 toolbar_.reset(new BrowserToolbarGtk(browser_.get(), this)); | 1687 toolbar_.reset(new BrowserToolbarGtk(browser_.get(), this)); |
1690 toolbar_->Init(browser_->profile(), window_); | 1688 toolbar_->Init(window_); |
1691 gtk_box_pack_start(GTK_BOX(window_vbox_), toolbar_->widget(), | 1689 gtk_box_pack_start(GTK_BOX(window_vbox_), toolbar_->widget(), |
1692 FALSE, FALSE, 0); | 1690 FALSE, FALSE, 0); |
1693 g_signal_connect_after(toolbar_->widget(), "expose-event", | 1691 g_signal_connect_after(toolbar_->widget(), "expose-event", |
1694 G_CALLBACK(OnExposeDrawInfobarBitsThunk), this); | 1692 G_CALLBACK(OnExposeDrawInfobarBitsThunk), this); |
1695 // This vbox surrounds the render area: find bar, info bars and render view. | 1693 // This vbox surrounds the render area: find bar, info bars and render view. |
1696 // The reason is that this area as a whole needs to be grouped in its own | 1694 // The reason is that this area as a whole needs to be grouped in its own |
1697 // GdkWindow hierarchy so that animations originating inside it (infobar, | 1695 // GdkWindow hierarchy so that animations originating inside it (infobar, |
1698 // download shelf, find bar) are all clipped to that area. This is why | 1696 // download shelf, find bar) are all clipped to that area. This is why |
1699 // |render_area_vbox_| is packed in |render_area_event_box_|. | 1697 // |render_area_vbox_| is packed in |render_area_event_box_|. |
1700 render_area_vbox_ = gtk_vbox_new(FALSE, 0); | 1698 render_area_vbox_ = gtk_vbox_new(FALSE, 0); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1746 gtk_widget_modify_bg(render_area_event_box_, GTK_STATE_NORMAL, | 1744 gtk_widget_modify_bg(render_area_event_box_, GTK_STATE_NORMAL, |
1747 >k_util::kGdkWhite); | 1745 >k_util::kGdkWhite); |
1748 gtk_container_add(GTK_CONTAINER(render_area_event_box_), | 1746 gtk_container_add(GTK_CONTAINER(render_area_event_box_), |
1749 render_area_floating_container_); | 1747 render_area_floating_container_); |
1750 gtk_widget_show(render_area_event_box_); | 1748 gtk_widget_show(render_area_event_box_); |
1751 gtk_box_pack_end(GTK_BOX(window_vbox_), render_area_event_box_, | 1749 gtk_box_pack_end(GTK_BOX(window_vbox_), render_area_event_box_, |
1752 TRUE, TRUE, 0); | 1750 TRUE, TRUE, 0); |
1753 | 1751 |
1754 if (IsBookmarkBarSupported()) { | 1752 if (IsBookmarkBarSupported()) { |
1755 bookmark_bar_.reset(new BookmarkBarGtk(this, | 1753 bookmark_bar_.reset(new BookmarkBarGtk(this, |
1756 browser_->profile(), | |
1757 browser_.get(), | 1754 browser_.get(), |
1758 tabstrip_.get())); | 1755 tabstrip_.get())); |
1759 PlaceBookmarkBar(false); | 1756 PlaceBookmarkBar(false); |
1760 gtk_widget_show(bookmark_bar_->widget()); | 1757 gtk_widget_show(bookmark_bar_->widget()); |
1761 | 1758 |
1762 g_signal_connect_after(bookmark_bar_->widget(), "expose-event", | 1759 g_signal_connect_after(bookmark_bar_->widget(), "expose-event", |
1763 G_CALLBACK(OnBookmarkBarExposeThunk), this); | 1760 G_CALLBACK(OnBookmarkBarExposeThunk), this); |
1764 g_signal_connect(bookmark_bar_->widget(), "size-allocate", | 1761 g_signal_connect(bookmark_bar_->widget(), "size-allocate", |
1765 G_CALLBACK(OnBookmarkBarSizeAllocateThunk), this); | 1762 G_CALLBACK(OnBookmarkBarSizeAllocateThunk), this); |
1766 } | 1763 } |
(...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2374 // are taken from the WMs' source code. | 2371 // are taken from the WMs' source code. |
2375 return (wm_name == "Blackbox" || | 2372 return (wm_name == "Blackbox" || |
2376 wm_name == "compiz" || | 2373 wm_name == "compiz" || |
2377 wm_name == "Compiz" || | 2374 wm_name == "Compiz" || |
2378 wm_name == "e16" || // Enlightenment DR16 | 2375 wm_name == "e16" || // Enlightenment DR16 |
2379 wm_name == "Metacity" || | 2376 wm_name == "Metacity" || |
2380 wm_name == "Mutter" || | 2377 wm_name == "Mutter" || |
2381 wm_name == "Openbox" || | 2378 wm_name == "Openbox" || |
2382 wm_name == "Xfwm4"); | 2379 wm_name == "Xfwm4"); |
2383 } | 2380 } |
OLD | NEW |