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

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

Issue 10169019: Add PanelBrowserTitlebarGtk for panels on GTK. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Patch to land Created 8 years, 8 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <dlfcn.h> 7 #include <dlfcn.h>
8 #include <gdk/gdkkeysyms.h> 8 #include <gdk/gdkkeysyms.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 1801 matching lines...) Expand 10 before | Expand all | Expand 10 after
1812 gtk_widget_set_double_buffered(window_container_, FALSE); 1812 gtk_widget_set_double_buffered(window_container_, FALSE);
1813 gtk_widget_set_redraw_on_allocate(window_container_, TRUE); 1813 gtk_widget_set_redraw_on_allocate(window_container_, TRUE);
1814 g_signal_connect(window_container_, "expose-event", 1814 g_signal_connect(window_container_, "expose-event",
1815 G_CALLBACK(OnCustomFrameExposeThunk), this); 1815 G_CALLBACK(OnCustomFrameExposeThunk), this);
1816 gtk_container_add(GTK_CONTAINER(window_container_), window_vbox_); 1816 gtk_container_add(GTK_CONTAINER(window_container_), window_vbox_);
1817 1817
1818 tabstrip_.reset(new TabStripGtk(browser_->tabstrip_model(), this)); 1818 tabstrip_.reset(new TabStripGtk(browser_->tabstrip_model(), this));
1819 tabstrip_->Init(); 1819 tabstrip_->Init();
1820 1820
1821 // Build the titlebar (tabstrip + header space + min/max/close buttons). 1821 // Build the titlebar (tabstrip + header space + min/max/close buttons).
1822 titlebar_.reset(new BrowserTitlebar(this, window_)); 1822 titlebar_.reset(CreateBrowserTitlebar());
1823 titlebar_->Init();
1823 1824
1824 // Insert the tabstrip into the window. 1825 // Insert the tabstrip into the window.
1825 gtk_box_pack_start(GTK_BOX(window_vbox_), titlebar_->widget(), FALSE, FALSE, 1826 gtk_box_pack_start(GTK_BOX(window_vbox_), titlebar_->widget(), FALSE, FALSE,
1826 0); 1827 0);
1827 1828
1828 toolbar_.reset(new BrowserToolbarGtk(browser_.get(), this)); 1829 toolbar_.reset(new BrowserToolbarGtk(browser_.get(), this));
1829 toolbar_->Init(window_); 1830 toolbar_->Init(window_);
1830 gtk_box_pack_start(GTK_BOX(window_vbox_), toolbar_->widget(), 1831 gtk_box_pack_start(GTK_BOX(window_vbox_), toolbar_->widget(),
1831 FALSE, FALSE, 0); 1832 FALSE, FALSE, 0);
1832 g_signal_connect_after(toolbar_->widget(), "expose-event", 1833 g_signal_connect_after(toolbar_->widget(), "expose-event",
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after
2447 return browser_->SupportsWindowFeature(Browser::FEATURE_BOOKMARKBAR); 2448 return browser_->SupportsWindowFeature(Browser::FEATURE_BOOKMARKBAR);
2448 } 2449 }
2449 2450
2450 bool BrowserWindowGtk::UsingCustomPopupFrame() const { 2451 bool BrowserWindowGtk::UsingCustomPopupFrame() const {
2451 ThemeServiceGtk* theme_provider = ThemeServiceGtk::GetFrom( 2452 ThemeServiceGtk* theme_provider = ThemeServiceGtk::GetFrom(
2452 browser()->profile()); 2453 browser()->profile());
2453 return !theme_provider->UsingNativeTheme() && 2454 return !theme_provider->UsingNativeTheme() &&
2454 (browser()->is_type_popup() || browser()->is_type_panel()); 2455 (browser()->is_type_popup() || browser()->is_type_panel());
2455 } 2456 }
2456 2457
2458 BrowserTitlebar* BrowserWindowGtk::CreateBrowserTitlebar() {
2459 return new BrowserTitlebar(this, window_);
2460 }
2461
2457 bool BrowserWindowGtk::GetWindowEdge(int x, int y, GdkWindowEdge* edge) { 2462 bool BrowserWindowGtk::GetWindowEdge(int x, int y, GdkWindowEdge* edge) {
2458 if (!UseCustomFrame()) 2463 if (!UseCustomFrame())
2459 return false; 2464 return false;
2460 2465
2461 if (IsMaximized() || IsFullscreen()) 2466 if (IsMaximized() || IsFullscreen())
2462 return false; 2467 return false;
2463 2468
2464 if (x < kFrameBorderThickness) { 2469 if (x < kFrameBorderThickness) {
2465 // Left edge. 2470 // Left edge.
2466 if (y < kResizeAreaCornerSize - kTopResizeAdjust) { 2471 if (y < kResizeAreaCornerSize - kTopResizeAdjust) {
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
2578 wm_type == ui::WM_OPENBOX || 2583 wm_type == ui::WM_OPENBOX ||
2579 wm_type == ui::WM_XFWM4); 2584 wm_type == ui::WM_XFWM4);
2580 } 2585 }
2581 2586
2582 // static 2587 // static
2583 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { 2588 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) {
2584 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); 2589 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser);
2585 browser_window_gtk->Init(); 2590 browser_window_gtk->Init();
2586 return browser_window_gtk; 2591 return browser_window_gtk;
2587 } 2592 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/browser_window_gtk.h ('k') | chrome/browser/ui/panels/panel_browser_titlebar_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698