| 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 | 8 |
| 9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
| 10 #include "base/base_paths_linux.h" | 10 #include "base/base_paths_linux.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 #include "chrome/browser/gtk/toolbar_star_toggle_gtk.h" | 37 #include "chrome/browser/gtk/toolbar_star_toggle_gtk.h" |
| 38 #include "chrome/browser/location_bar.h" | 38 #include "chrome/browser/location_bar.h" |
| 39 #include "chrome/browser/renderer_host/render_widget_host_view_gtk.h" | 39 #include "chrome/browser/renderer_host/render_widget_host_view_gtk.h" |
| 40 #include "chrome/browser/tab_contents/tab_contents.h" | 40 #include "chrome/browser/tab_contents/tab_contents.h" |
| 41 #include "chrome/browser/tab_contents/tab_contents_view.h" | 41 #include "chrome/browser/tab_contents/tab_contents_view.h" |
| 42 #include "chrome/common/notification_service.h" | 42 #include "chrome/common/notification_service.h" |
| 43 #include "chrome/common/pref_names.h" | 43 #include "chrome/common/pref_names.h" |
| 44 #include "chrome/common/pref_service.h" | 44 #include "chrome/common/pref_service.h" |
| 45 #include "grit/theme_resources.h" | 45 #include "grit/theme_resources.h" |
| 46 | 46 |
| 47 #if defined(LINUX2) |
| 48 #include "chrome/browser/views/tabs/tab_overview_types.h" |
| 49 #endif |
| 50 |
| 47 namespace { | 51 namespace { |
| 48 | 52 |
| 49 // The number of milliseconds between loading animation frames. | 53 // The number of milliseconds between loading animation frames. |
| 50 const int kLoadingAnimationFrameTimeMs = 30; | 54 const int kLoadingAnimationFrameTimeMs = 30; |
| 51 | 55 |
| 52 const GdkColor kBorderColor = GDK_COLOR_RGB(0xbe, 0xc8, 0xd4); | 56 const GdkColor kBorderColor = GDK_COLOR_RGB(0xbe, 0xc8, 0xd4); |
| 53 | 57 |
| 54 const char* kBrowserWindowKey = "__BROWSER_WINDOW_GTK__"; | 58 const char* kBrowserWindowKey = "__BROWSER_WINDOW_GTK__"; |
| 55 | 59 |
| 56 // The width of the custom frame. | 60 // The width of the custom frame. |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 if (window->use_custom_frame_.GetValue()) { | 411 if (window->use_custom_frame_.GetValue()) { |
| 408 // http://code.google.com/p/chromium/issues/detail?id=13430 | 412 // http://code.google.com/p/chromium/issues/detail?id=13430 |
| 409 return FALSE; | 413 return FALSE; |
| 410 } | 414 } |
| 411 | 415 |
| 412 return FALSE; // Allow subwidgets to paint. | 416 return FALSE; // Allow subwidgets to paint. |
| 413 } | 417 } |
| 414 | 418 |
| 415 void BrowserWindowGtk::Show() { | 419 void BrowserWindowGtk::Show() { |
| 416 gtk_widget_show(GTK_WIDGET(window_)); | 420 gtk_widget_show(GTK_WIDGET(window_)); |
| 421 #if defined(LINUX2) |
| 422 TabOverviewTypes::instance()->SetWindowType( |
| 423 GTK_WIDGET(window_), TabOverviewTypes::WINDOW_TYPE_CHROME_TOPLEVEL, |
| 424 NULL); |
| 425 #endif |
| 417 } | 426 } |
| 418 | 427 |
| 419 void BrowserWindowGtk::SetBounds(const gfx::Rect& bounds) { | 428 void BrowserWindowGtk::SetBounds(const gfx::Rect& bounds) { |
| 420 gint x = static_cast<gint>(bounds.x()); | 429 gint x = static_cast<gint>(bounds.x()); |
| 421 gint y = static_cast<gint>(bounds.y()); | 430 gint y = static_cast<gint>(bounds.y()); |
| 422 gint width = static_cast<gint>(bounds.width()); | 431 gint width = static_cast<gint>(bounds.width()); |
| 423 gint height = static_cast<gint>(bounds.height()); | 432 gint height = static_cast<gint>(bounds.height()); |
| 424 | 433 |
| 425 gtk_window_move(window_, x, y); | 434 gtk_window_move(window_, x, y); |
| 426 gtk_window_resize(window_, width, height); | 435 gtk_window_resize(window_, width, height); |
| (...skipping 525 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 952 } | 961 } |
| 953 | 962 |
| 954 bool BrowserWindowGtk::IsTabStripSupported() { | 963 bool BrowserWindowGtk::IsTabStripSupported() { |
| 955 return browser_->SupportsWindowFeature(Browser::FEATURE_TABSTRIP); | 964 return browser_->SupportsWindowFeature(Browser::FEATURE_TABSTRIP); |
| 956 } | 965 } |
| 957 | 966 |
| 958 bool BrowserWindowGtk::IsToolbarSupported() { | 967 bool BrowserWindowGtk::IsToolbarSupported() { |
| 959 return browser_->SupportsWindowFeature(Browser::FEATURE_TOOLBAR) || | 968 return browser_->SupportsWindowFeature(Browser::FEATURE_TOOLBAR) || |
| 960 browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR); | 969 browser_->SupportsWindowFeature(Browser::FEATURE_LOCATIONBAR); |
| 961 } | 970 } |
| OLD | NEW |