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 1968 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1979 | 1979 |
1980 int BrowserWindowGtk::GetXPositionOfLocationIcon(GtkWidget* relative_to) { | 1980 int BrowserWindowGtk::GetXPositionOfLocationIcon(GtkWidget* relative_to) { |
1981 GtkWidget* location_icon = toolbar_->GetLocationBarView()-> | 1981 GtkWidget* location_icon = toolbar_->GetLocationBarView()-> |
1982 location_icon_widget(); | 1982 location_icon_widget(); |
1983 int x = 0; | 1983 int x = 0; |
1984 gtk_widget_translate_coordinates( | 1984 gtk_widget_translate_coordinates( |
1985 location_icon, relative_to, | 1985 location_icon, relative_to, |
1986 (location_icon->allocation.width + 1) / 2, | 1986 (location_icon->allocation.width + 1) / 2, |
1987 0, &x, NULL); | 1987 0, &x, NULL); |
1988 | 1988 |
1989 if (GTK_WIDGET_NO_WINDOW(relative_to)) | 1989 if (!gtk_widget_get_has_window(relative_to)) { |
1990 x += relative_to->allocation.x; | 1990 GtkAllocation allocation; |
| 1991 gtk_widget_get_allocation(relative_to, &allocation); |
| 1992 x += allocation.x; |
| 1993 } |
1991 | 1994 |
1992 return x; | 1995 return x; |
1993 } | 1996 } |
1994 | 1997 |
1995 void BrowserWindowGtk::OnLocationIconSizeAllocate(GtkWidget* sender, | 1998 void BrowserWindowGtk::OnLocationIconSizeAllocate(GtkWidget* sender, |
1996 GtkAllocation* allocation) { | 1999 GtkAllocation* allocation) { |
1997 // The position of the arrow may have changed, so we'll have to redraw it. | 2000 // The position of the arrow may have changed, so we'll have to redraw it. |
1998 InvalidateInfoBarBits(); | 2001 InvalidateInfoBarBits(); |
1999 } | 2002 } |
2000 | 2003 |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2429 wm_type == ui::WM_OPENBOX || | 2432 wm_type == ui::WM_OPENBOX || |
2430 wm_type == ui::WM_XFWM4); | 2433 wm_type == ui::WM_XFWM4); |
2431 } | 2434 } |
2432 | 2435 |
2433 // static | 2436 // static |
2434 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { | 2437 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { |
2435 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); | 2438 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); |
2436 browser_window_gtk->Init(); | 2439 browser_window_gtk->Init(); |
2437 return browser_window_gtk; | 2440 return browser_window_gtk; |
2438 } | 2441 } |
OLD | NEW |