| 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 930 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 941 } | 941 } |
| 942 | 942 |
| 943 gfx::Size PanelGtk::ContentSizeFromWindowSize( | 943 gfx::Size PanelGtk::ContentSizeFromWindowSize( |
| 944 const gfx::Size& window_size) const { | 944 const gfx::Size& window_size) const { |
| 945 gfx::Size& frame_size = GetFrameSize(); | 945 gfx::Size& frame_size = GetFrameSize(); |
| 946 return gfx::Size(window_size.width() - frame_size.width(), | 946 return gfx::Size(window_size.width() - frame_size.width(), |
| 947 window_size.height() - frame_size.height()); | 947 window_size.height() - frame_size.height()); |
| 948 } | 948 } |
| 949 | 949 |
| 950 int PanelGtk::TitleOnlyHeight() const { | 950 int PanelGtk::TitleOnlyHeight() const { |
| 951 GtkAllocation allocation; | 951 gfx::Size& frame_size = GetFrameSize(); |
| 952 gtk_widget_get_allocation(titlebar_->widget(), &allocation); | 952 if (!frame_size.IsEmpty()) |
| 953 return allocation.height; | 953 return frame_size.height() - kFrameBorderThickness; |
| 954 |
| 955 NOTREACHED() << "Checking title height before window allocated"; |
| 956 return 0; |
| 954 } | 957 } |
| 955 | 958 |
| 956 bool PanelGtk::IsPanelAlwaysOnTop() const { | 959 bool PanelGtk::IsPanelAlwaysOnTop() const { |
| 957 return always_on_top_; | 960 return always_on_top_; |
| 958 } | 961 } |
| 959 | 962 |
| 960 void PanelGtk::SetPanelAlwaysOnTop(bool on_top) { | 963 void PanelGtk::SetPanelAlwaysOnTop(bool on_top) { |
| 961 if (always_on_top_ == on_top) | 964 if (always_on_top_ == on_top) |
| 962 return; | 965 return; |
| 963 always_on_top_ = on_top; | 966 always_on_top_ = on_top; |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1123 break; | 1126 break; |
| 1124 case panel::RESTORE_BUTTON: | 1127 case panel::RESTORE_BUTTON: |
| 1125 button = titlebar->restore_button(); | 1128 button = titlebar->restore_button(); |
| 1126 break; | 1129 break; |
| 1127 default: | 1130 default: |
| 1128 NOTREACHED(); | 1131 NOTREACHED(); |
| 1129 return false; | 1132 return false; |
| 1130 } | 1133 } |
| 1131 return gtk_widget_get_visible(button->widget()); | 1134 return gtk_widget_get_visible(button->widget()); |
| 1132 } | 1135 } |
| OLD | NEW |