Chromium Code Reviews| 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/panels/panel_gtk.h" | 5 #include "chrome/browser/ui/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 929 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 940 } | 940 } |
| 941 | 941 |
| 942 gfx::Size PanelGtk::ContentSizeFromWindowSize( | 942 gfx::Size PanelGtk::ContentSizeFromWindowSize( |
| 943 const gfx::Size& window_size) const { | 943 const gfx::Size& window_size) const { |
| 944 gfx::Size& frame_size = GetFrameSize(); | 944 gfx::Size& frame_size = GetFrameSize(); |
| 945 return gfx::Size(window_size.width() - frame_size.width(), | 945 return gfx::Size(window_size.width() - frame_size.width(), |
| 946 window_size.height() - frame_size.height()); | 946 window_size.height() - frame_size.height()); |
| 947 } | 947 } |
| 948 | 948 |
| 949 int PanelGtk::TitleOnlyHeight() const { | 949 int PanelGtk::TitleOnlyHeight() const { |
| 950 gfx::Size& frame_size = GetFrameSize(); | |
| 951 if (!frame_size.IsEmpty()) | |
| 952 return frame_size.height() - kFrameBorderThickness; | |
| 953 | |
| 954 LOG(WARNING) << "Checking title height before window allocated"; | |
|
jennb
2012/09/13 00:45:34
I intentionally left this log msg in to see if thi
Dmitry Titov
2012/09/13 18:19:00
Could you please move this note into a comment for
| |
| 950 GtkAllocation allocation; | 955 GtkAllocation allocation; |
|
Dmitry Titov
2012/09/13 18:19:00
Do we actually need this code? It seems it should
jennb
2012/09/13 18:40:48
Changed to NOTREACHED using the log msg.
| |
| 951 gtk_widget_get_allocation(titlebar_->widget(), &allocation); | 956 gtk_widget_get_allocation(titlebar_->widget(), &allocation); |
| 952 return allocation.height; | 957 return allocation.height; |
| 953 } | 958 } |
| 954 | 959 |
| 955 void PanelGtk::SetPanelAlwaysOnTop(bool on_top) { | 960 void PanelGtk::SetPanelAlwaysOnTop(bool on_top) { |
| 956 gtk_window_set_keep_above(window_, on_top); | 961 gtk_window_set_keep_above(window_, on_top); |
| 957 | 962 |
| 958 // Do not show an icon in the task bar for always-on-top windows. | 963 // Do not show an icon in the task bar for always-on-top windows. |
| 959 // Window operations such as close, minimize etc. can only be done | 964 // Window operations such as close, minimize etc. can only be done |
| 960 // from the panel UI. | 965 // from the panel UI. |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1114 break; | 1119 break; |
| 1115 case panel::RESTORE_BUTTON: | 1120 case panel::RESTORE_BUTTON: |
| 1116 button = titlebar->restore_button(); | 1121 button = titlebar->restore_button(); |
| 1117 break; | 1122 break; |
| 1118 default: | 1123 default: |
| 1119 NOTREACHED(); | 1124 NOTREACHED(); |
| 1120 return false; | 1125 return false; |
| 1121 } | 1126 } |
| 1122 return gtk_widget_get_visible(button->widget()); | 1127 return gtk_widget_get_visible(button->widget()); |
| 1123 } | 1128 } |
| OLD | NEW |