Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(82)

Side by Side Diff: chrome/browser/ui/panels/panel_gtk.cc

Issue 10914242: Improve panel tests by properly waiting for expected conditions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: improve AutoResize test, was still flaking Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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 GtkAllocation allocation; 950 gfx::Size& frame_size = GetFrameSize();
951 gtk_widget_get_allocation(titlebar_->widget(), &allocation); 951 if (!frame_size.IsEmpty())
952 return allocation.height; 952 return frame_size.height() - kFrameBorderThickness;
953
954 NOTREACHED() << "Checking title height before window allocated";
955 return 0;
953 } 956 }
954 957
955 void PanelGtk::SetPanelAlwaysOnTop(bool on_top) { 958 void PanelGtk::SetPanelAlwaysOnTop(bool on_top) {
956 gtk_window_set_keep_above(window_, on_top); 959 gtk_window_set_keep_above(window_, on_top);
957 960
958 // Do not show an icon in the task bar for always-on-top windows. 961 // 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 962 // Window operations such as close, minimize etc. can only be done
960 // from the panel UI. 963 // from the panel UI.
961 gtk_window_set_skip_taskbar_hint(window_, on_top); 964 gtk_window_set_skip_taskbar_hint(window_, on_top);
962 965
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
1114 break; 1117 break;
1115 case panel::RESTORE_BUTTON: 1118 case panel::RESTORE_BUTTON:
1116 button = titlebar->restore_button(); 1119 button = titlebar->restore_button();
1117 break; 1120 break;
1118 default: 1121 default:
1119 NOTREACHED(); 1122 NOTREACHED();
1120 return false; 1123 return false;
1121 } 1124 }
1122 return gtk_widget_get_visible(button->widget()); 1125 return gtk_widget_get_visible(button->widget());
1123 } 1126 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698