| 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 #include <X11/XF86keysym.h> | 8 #include <X11/XF86keysym.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 #include "chrome/browser/gtk/tabs/tab_strip_gtk.h" | 61 #include "chrome/browser/gtk/tabs/tab_strip_gtk.h" |
| 62 #include "chrome/browser/gtk/task_manager_gtk.h" | 62 #include "chrome/browser/gtk/task_manager_gtk.h" |
| 63 #include "chrome/browser/gtk/theme_install_bubble_view_gtk.h" | 63 #include "chrome/browser/gtk/theme_install_bubble_view_gtk.h" |
| 64 #include "chrome/browser/gtk/toolbar_star_toggle_gtk.h" | 64 #include "chrome/browser/gtk/toolbar_star_toggle_gtk.h" |
| 65 #include "chrome/browser/location_bar.h" | 65 #include "chrome/browser/location_bar.h" |
| 66 #include "chrome/browser/page_info_window.h" | 66 #include "chrome/browser/page_info_window.h" |
| 67 #include "chrome/browser/renderer_host/render_widget_host_view_gtk.h" | 67 #include "chrome/browser/renderer_host/render_widget_host_view_gtk.h" |
| 68 #include "chrome/browser/tab_contents/tab_contents.h" | 68 #include "chrome/browser/tab_contents/tab_contents.h" |
| 69 #include "chrome/browser/tab_contents/tab_contents_view.h" | 69 #include "chrome/browser/tab_contents/tab_contents_view.h" |
| 70 #include "chrome/browser/window_sizer.h" | 70 #include "chrome/browser/window_sizer.h" |
| 71 #include "chrome/common/chrome_switches.h" |
| 71 #include "chrome/common/gtk_util.h" | 72 #include "chrome/common/gtk_util.h" |
| 72 #include "chrome/common/notification_service.h" | 73 #include "chrome/common/notification_service.h" |
| 73 #include "chrome/common/pref_names.h" | 74 #include "chrome/common/pref_names.h" |
| 74 #include "chrome/common/pref_service.h" | 75 #include "chrome/common/pref_service.h" |
| 75 #include "grit/app_resources.h" | 76 #include "grit/app_resources.h" |
| 76 #include "grit/chromium_strings.h" | 77 #include "grit/chromium_strings.h" |
| 77 #include "grit/generated_resources.h" | 78 #include "grit/generated_resources.h" |
| 78 #include "grit/theme_resources.h" | 79 #include "grit/theme_resources.h" |
| 79 #include "skia/ext/skia_utils_gtk.h" | 80 #include "skia/ext/skia_utils_gtk.h" |
| 80 | 81 |
| (...skipping 932 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1013 } else { | 1014 } else { |
| 1014 gtk_window_unfullscreen(window_); | 1015 gtk_window_unfullscreen(window_); |
| 1015 } | 1016 } |
| 1016 } | 1017 } |
| 1017 | 1018 |
| 1018 bool BrowserWindowGtk::IsFullscreen() const { | 1019 bool BrowserWindowGtk::IsFullscreen() const { |
| 1019 return (state_ & GDK_WINDOW_STATE_FULLSCREEN); | 1020 return (state_ & GDK_WINDOW_STATE_FULLSCREEN); |
| 1020 } | 1021 } |
| 1021 | 1022 |
| 1022 bool BrowserWindowGtk::IsFullscreenBubbleVisible() const { | 1023 bool BrowserWindowGtk::IsFullscreenBubbleVisible() const { |
| 1023 // There is no fullscreen bubble for Linux. | 1024 return fullscreen_exit_bubble_.get() ? true : false; |
| 1024 return false; | |
| 1025 } | 1025 } |
| 1026 | 1026 |
| 1027 LocationBar* BrowserWindowGtk::GetLocationBar() const { | 1027 LocationBar* BrowserWindowGtk::GetLocationBar() const { |
| 1028 return toolbar_->GetLocationBar(); | 1028 return toolbar_->GetLocationBar(); |
| 1029 } | 1029 } |
| 1030 | 1030 |
| 1031 void BrowserWindowGtk::SetFocusToLocationBar() { | 1031 void BrowserWindowGtk::SetFocusToLocationBar() { |
| 1032 if (!IsFullscreen()) { | 1032 if (!IsFullscreen()) { |
| 1033 #if defined(OS_CHROMEOS) | 1033 #if defined(OS_CHROMEOS) |
| 1034 if (compact_navigation_bar_) { | 1034 if (compact_navigation_bar_) { |
| (...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1428 | 1428 |
| 1429 if (changed_mask & GDK_WINDOW_STATE_FULLSCREEN) { | 1429 if (changed_mask & GDK_WINDOW_STATE_FULLSCREEN) { |
| 1430 bool is_fullscreen = state & GDK_WINDOW_STATE_FULLSCREEN; | 1430 bool is_fullscreen = state & GDK_WINDOW_STATE_FULLSCREEN; |
| 1431 browser_->UpdateCommandsForFullscreenMode(is_fullscreen); | 1431 browser_->UpdateCommandsForFullscreenMode(is_fullscreen); |
| 1432 if (is_fullscreen) { | 1432 if (is_fullscreen) { |
| 1433 UpdateCustomFrame(); | 1433 UpdateCustomFrame(); |
| 1434 toolbar_->Hide(); | 1434 toolbar_->Hide(); |
| 1435 tabstrip_->Hide(); | 1435 tabstrip_->Hide(); |
| 1436 if (IsBookmarkBarSupported()) | 1436 if (IsBookmarkBarSupported()) |
| 1437 bookmark_bar_->EnterFullscreen(); | 1437 bookmark_bar_->EnterFullscreen(); |
| 1438 fullscreen_exit_bubble_.reset(new FullscreenExitBubbleGtk( | 1438 bool is_kiosk = |
| 1439 GTK_FLOATING_CONTAINER(render_area_floating_container_))); | 1439 CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode); |
| 1440 if (!is_kiosk) { |
| 1441 fullscreen_exit_bubble_.reset(new FullscreenExitBubbleGtk( |
| 1442 GTK_FLOATING_CONTAINER(render_area_floating_container_))); |
| 1443 } |
| 1440 gtk_widget_hide(toolbar_border_); | 1444 gtk_widget_hide(toolbar_border_); |
| 1441 #if defined(OS_CHROMEOS) | 1445 #if defined(OS_CHROMEOS) |
| 1442 if (main_menu_button_) | 1446 if (main_menu_button_) |
| 1443 gtk_widget_hide(main_menu_button_->widget()); | 1447 gtk_widget_hide(main_menu_button_->widget()); |
| 1444 if (compact_navbar_hbox_) | 1448 if (compact_navbar_hbox_) |
| 1445 gtk_widget_hide(compact_navbar_hbox_); | 1449 gtk_widget_hide(compact_navbar_hbox_); |
| 1446 if (status_area_) | 1450 if (status_area_) |
| 1447 status_area_->GetWidget()->Hide(); | 1451 status_area_->GetWidget()->Hide(); |
| 1448 #endif | 1452 #endif |
| 1449 } else { | 1453 } else { |
| (...skipping 894 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2344 // are taken from the WMs' source code. | 2348 // are taken from the WMs' source code. |
| 2345 return (wm_name == "Blackbox" || | 2349 return (wm_name == "Blackbox" || |
| 2346 wm_name == "compiz" || | 2350 wm_name == "compiz" || |
| 2347 wm_name == "e16" || // Enlightenment DR16 | 2351 wm_name == "e16" || // Enlightenment DR16 |
| 2348 wm_name == "KWin" || | 2352 wm_name == "KWin" || |
| 2349 wm_name == "Metacity" || | 2353 wm_name == "Metacity" || |
| 2350 wm_name == "Mutter" || | 2354 wm_name == "Mutter" || |
| 2351 wm_name == "Openbox" || | 2355 wm_name == "Openbox" || |
| 2352 wm_name == "Xfwm4"); | 2356 wm_name == "Xfwm4"); |
| 2353 } | 2357 } |
| OLD | NEW |