Chromium Code Reviews| Index: chrome/browser/ui/gtk/gtk_util.cc |
| diff --git a/chrome/browser/ui/gtk/gtk_util.cc b/chrome/browser/ui/gtk/gtk_util.cc |
| index 99be05a739569519ef61cf18381ca9980c6053b1..5380a6af67987fd8cdf6b96258173ea99985ab03 100644 |
| --- a/chrome/browser/ui/gtk/gtk_util.cc |
| +++ b/chrome/browser/ui/gtk/gtk_util.cc |
| @@ -26,6 +26,7 @@ |
| #include "chrome/browser/profiles/profile.h" |
| #include "chrome/browser/renderer_host/render_view_host.h" |
| #include "chrome/browser/tab_contents/tab_contents.h" |
| +#include "chrome/browser/ui/gtk/browser_window_gtk.h" |
|
satorux1
2011/02/02 03:29:49
Do we need to add this? Otherwise, please remove i
falken
2011/02/02 04:59:34
Yes, it's still needed. I just moved it from the
|
| #include "chrome/browser/ui/gtk/cairo_cached_surface.h" |
| #include "chrome/browser/ui/gtk/gtk_theme_provider.h" |
| #include "chrome/common/renderer_preferences.h" |
| @@ -38,15 +39,6 @@ |
| #include "ui/base/resource/resource_bundle.h" |
| #include "ui/base/x/x11_util.h" |
| -#if defined(OS_CHROMEOS) |
| -#include "chrome/browser/chromeos/frame/browser_view.h" |
| -#include "chrome/browser/chromeos/native_dialog_window.h" |
| -#include "chrome/browser/chromeos/options/options_window_view.h" |
| -#include "views/window/window.h" |
| -#else |
| -#include "chrome/browser/ui/gtk/browser_window_gtk.h" |
| -#endif |
| - |
| using WebKit::WebDragOperationsMask; |
| using WebKit::WebDragOperation; |
| using WebKit::WebDragOperationNone; |
| @@ -143,28 +135,6 @@ gboolean PaintNoBackground(GtkWidget* widget, |
| return TRUE; |
| } |
| -#if defined(OS_CHROMEOS) |
| - |
| -TabContents* GetBrowserWindowSelectedTabContents(BrowserWindow* window) { |
| - chromeos::BrowserView* browser_view = static_cast<chromeos::BrowserView*>( |
| - window); |
| - return browser_view->GetSelectedTabContents(); |
| -} |
| - |
| -GtkWidget* GetBrowserWindowFocusedWidget(BrowserWindow* window) { |
| - gfx::NativeView widget = gtk_window_get_focus(window->GetNativeHandle()); |
| - |
| - if (widget == NULL) { |
| - chromeos::BrowserView* browser_view = static_cast<chromeos::BrowserView*>( |
| - window); |
| - widget = browser_view->saved_focused_widget(); |
| - } |
| - |
| - return widget; |
| -} |
| - |
| -#else |
| - |
| TabContents* GetBrowserWindowSelectedTabContents(BrowserWindow* window) { |
| BrowserWindowGtk* browser_window = static_cast<BrowserWindowGtk*>( |
| window); |
| @@ -175,8 +145,6 @@ GtkWidget* GetBrowserWindowFocusedWidget(BrowserWindow* window) { |
| return gtk_window_get_focus(window->GetNativeHandle()); |
| } |
| -#endif |
| - |
| } // namespace |
| namespace event_utils { |
| @@ -1004,83 +972,6 @@ void GetTextColors(GdkColor* normal_base, |
| g_object_unref(fake_entry); |
| } |
| -#if defined(OS_CHROMEOS) |
| - |
| -GtkWindow* GetDialogTransientParent(GtkWindow* dialog) { |
| - GtkWindow* parent = gtk_window_get_transient_for(dialog); |
| - if (!parent) |
| - parent = chromeos::GetOptionsViewParent(); |
| - |
| - return parent; |
| -} |
| - |
| -void ShowDialog(GtkWidget* dialog) { |
| - // Make sure all controls are visible so that we get correct size. |
| - gtk_widget_show_all(GTK_DIALOG(dialog)->vbox); |
| - |
| - // Get dialog window size. |
| - gint width = 0; |
| - gint height = 0; |
| - gtk_window_get_size(GTK_WINDOW(dialog), &width, &height); |
| - |
| - chromeos::ShowNativeDialog(GetDialogTransientParent(GTK_WINDOW(dialog)), |
| - dialog, |
| - gtk_window_get_resizable(GTK_WINDOW(dialog)) ? |
| - chromeos::DIALOG_FLAG_RESIZEABLE : |
| - chromeos::DIALOG_FLAG_DEFAULT, |
| - gfx::Size(width, height), |
| - gfx::Size()); |
| -} |
| - |
| -void ShowDialogWithLocalizedSize(GtkWidget* dialog, |
| - int width_id, |
| - int height_id, |
| - bool resizeable) { |
| - int width = (width_id == -1) ? 0 : |
| - views::Window::GetLocalizedContentsWidth(width_id); |
| - int height = (height_id == -1) ? 0 : |
| - views::Window::GetLocalizedContentsHeight(height_id); |
| - |
| - chromeos::ShowNativeDialog(GetDialogTransientParent(GTK_WINDOW(dialog)), |
| - dialog, |
| - resizeable ? chromeos::DIALOG_FLAG_RESIZEABLE : |
| - chromeos::DIALOG_FLAG_DEFAULT, |
| - gfx::Size(width, height), |
| - gfx::Size()); |
| -} |
| - |
| -void ShowModalDialogWithMinLocalizedWidth(GtkWidget* dialog, |
| - int width_id) { |
| - int width = (width_id == -1) ? 0 : |
| - views::Window::GetLocalizedContentsWidth(width_id); |
| - |
| - chromeos::ShowNativeDialog(GetDialogTransientParent(GTK_WINDOW(dialog)), |
| - dialog, |
| - chromeos::DIALOG_FLAG_MODAL, |
| - gfx::Size(), |
| - gfx::Size(width, 0)); |
| -} |
| - |
| -void PresentWindow(GtkWidget* window, int timestamp) { |
| - GtkWindow* host_window = chromeos::GetNativeDialogWindow(window); |
| - if (!host_window) |
| - host_window = GTK_WINDOW(window); |
| - if (timestamp) |
| - gtk_window_present_with_time(host_window, timestamp); |
| - else |
| - gtk_window_present(host_window); |
| -} |
| - |
| -GtkWindow* GetDialogWindow(GtkWidget* dialog) { |
| - return chromeos::GetNativeDialogWindow(dialog); |
| -} |
| - |
| -gfx::Rect GetDialogBounds(GtkWidget* dialog) { |
| - return chromeos::GetNativeDialogContentsBounds(dialog); |
| -} |
| - |
| -#else |
| - |
| void ShowDialog(GtkWidget* dialog) { |
| gtk_widget_show_all(dialog); |
| } |
| @@ -1129,8 +1020,6 @@ gfx::Rect GetDialogBounds(GtkWidget* dialog) { |
| return gfx::Rect(x, y, width, height); |
| } |
| -#endif |
| - |
| string16 GetStockPreferencesMenuLabel() { |
| GtkStockItem stock_item; |
| string16 preferences; |