| OLD | NEW |
| 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/panels/panel_gtk.h" | 5 #include "chrome/browser/ui/gtk/panels/panel_gtk.h" |
| 6 | 6 |
| 7 #include <gdk/gdk.h> | 7 #include <gdk/gdk.h> |
| 8 #include <gdk/gdkkeysyms.h> | 8 #include <gdk/gdkkeysyms.h> |
| 9 #include <X11/XF86keysym.h> | 9 #include <X11/XF86keysym.h> |
| 10 | 10 |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 gtk_container_add(GTK_CONTAINER(render_area_event_box_), | 309 gtk_container_add(GTK_CONTAINER(render_area_event_box_), |
| 310 contents_expanded_); | 310 contents_expanded_); |
| 311 gtk_widget_show(render_area_event_box_); | 311 gtk_widget_show(render_area_event_box_); |
| 312 gtk_box_pack_end(GTK_BOX(window_vbox_), render_area_event_box_, | 312 gtk_box_pack_end(GTK_BOX(window_vbox_), render_area_event_box_, |
| 313 TRUE, TRUE, 0); | 313 TRUE, TRUE, 0); |
| 314 | 314 |
| 315 gtk_container_add(GTK_CONTAINER(window_), window_container_); | 315 gtk_container_add(GTK_CONTAINER(window_), window_container_); |
| 316 gtk_widget_show(window_container_); | 316 gtk_widget_show(window_container_); |
| 317 | 317 |
| 318 ConnectAccelerators(); | 318 ConnectAccelerators(); |
| 319 SetPanelAlwaysOnTop(always_on_top_); |
| 319 } | 320 } |
| 320 | 321 |
| 321 void PanelGtk::SetWindowCornerStyle(panel::CornerStyle corner_style) { | 322 void PanelGtk::SetWindowCornerStyle(panel::CornerStyle corner_style) { |
| 322 corner_style_ = corner_style; | 323 corner_style_ = corner_style; |
| 323 UpdateWindowShape(); | 324 UpdateWindowShape(); |
| 324 } | 325 } |
| 325 | 326 |
| 326 void PanelGtk::MinimizePanelBySystem() { | 327 void PanelGtk::MinimizePanelBySystem() { |
| 327 gtk_window_iconify(window_); | 328 gtk_window_iconify(window_); |
| 328 } | 329 } |
| (...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 999 | 1000 |
| 1000 NOTREACHED() << "Checking title height before window allocated"; | 1001 NOTREACHED() << "Checking title height before window allocated"; |
| 1001 return 0; | 1002 return 0; |
| 1002 } | 1003 } |
| 1003 | 1004 |
| 1004 bool PanelGtk::IsPanelAlwaysOnTop() const { | 1005 bool PanelGtk::IsPanelAlwaysOnTop() const { |
| 1005 return always_on_top_; | 1006 return always_on_top_; |
| 1006 } | 1007 } |
| 1007 | 1008 |
| 1008 void PanelGtk::SetPanelAlwaysOnTop(bool on_top) { | 1009 void PanelGtk::SetPanelAlwaysOnTop(bool on_top) { |
| 1009 if (always_on_top_ == on_top) | |
| 1010 return; | |
| 1011 always_on_top_ = on_top; | 1010 always_on_top_ = on_top; |
| 1012 | 1011 |
| 1013 gtk_window_set_keep_above(window_, on_top); | 1012 gtk_window_set_keep_above(window_, on_top); |
| 1014 | 1013 |
| 1015 // Do not show an icon in the task bar for always-on-top windows. | 1014 // Do not show an icon in the task bar for always-on-top windows. |
| 1016 // Window operations such as close, minimize etc. can only be done | 1015 // Window operations such as close, minimize etc. can only be done |
| 1017 // from the panel UI. | 1016 // from the panel UI. |
| 1018 gtk_window_set_skip_taskbar_hint(window_, on_top); | 1017 gtk_window_set_skip_taskbar_hint(window_, on_top); |
| 1019 | 1018 |
| 1020 // Show always-on-top windows on all the virtual desktops. | 1019 // Show always-on-top windows on all the virtual desktops. |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1184 default: | 1183 default: |
| 1185 NOTREACHED(); | 1184 NOTREACHED(); |
| 1186 return false; | 1185 return false; |
| 1187 } | 1186 } |
| 1188 return gtk_widget_get_visible(button->widget()); | 1187 return gtk_widget_get_visible(button->widget()); |
| 1189 } | 1188 } |
| 1190 | 1189 |
| 1191 panel::CornerStyle GtkNativePanelTesting::GetWindowCornerStyle() const { | 1190 panel::CornerStyle GtkNativePanelTesting::GetWindowCornerStyle() const { |
| 1192 return panel_gtk_->corner_style_; | 1191 return panel_gtk_->corner_style_; |
| 1193 } | 1192 } |
| OLD | NEW |