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

Side by Side Diff: webkit/tools/test_shell/test_shell_gtk.cc

Issue 9030029: GTK: A bunch more removal of deprecated raw GtkWidget access, focusing on GtkWidget->window (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: tony nits Created 8 years, 11 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
« no previous file with comments | « webkit/plugins/npapi/gtk_plugin_container_manager.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "webkit/tools/test_shell/test_shell.h" 5 #include "webkit/tools/test_shell/test_shell.h"
6 6
7 #include <errno.h> 7 #include <errno.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <fontconfig/fontconfig.h> 9 #include <fontconfig/fontconfig.h>
10 #include <gtk/gtk.h> 10 #include <gtk/gtk.h>
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
369 void TestShell::TestFinished() { 369 void TestShell::TestFinished() {
370 if(!test_is_pending_) 370 if(!test_is_pending_)
371 return; 371 return;
372 372
373 test_is_pending_ = false; 373 test_is_pending_ = false;
374 MessageLoop::current()->Quit(); 374 MessageLoop::current()->Quit();
375 } 375 }
376 376
377 void TestShell::SizeTo(int width, int height) { 377 void TestShell::SizeTo(int width, int height) {
378 GtkWidget* widget = m_webViewHost->view_handle(); 378 GtkWidget* widget = m_webViewHost->view_handle();
379 if (widget->allocation.width == width && 379
380 widget->allocation.height == height) { 380 GtkAllocation allocation;
381 gtk_widget_get_allocation(widget, &allocation);
382 if (allocation.width == width && allocation.height == height) {
381 // Nothing to do. 383 // Nothing to do.
382 return; 384 return;
383 } 385 }
384 386
385 gtk_widget_set_size_request(widget, width, height); 387 gtk_widget_set_size_request(widget, width, height);
386 if (widget->allocation.width > width || 388 if (allocation.width > width || allocation.height > height) {
387 widget->allocation.height > height) {
388 // We've been sized smaller. Shrink the window so it snaps back to the 389 // We've been sized smaller. Shrink the window so it snaps back to the
389 // appropriate size. 390 // appropriate size.
390 gtk_window_resize(GTK_WINDOW(m_mainWnd), 1, 1); 391 gtk_window_resize(GTK_WINDOW(m_mainWnd), 1, 1);
391 } 392 }
392 393
393 // We've been asked to size the content area to a particular size. 394 // We've been asked to size the content area to a particular size.
394 // GTK works asynchronously: you request a size and then it 395 // GTK works asynchronously: you request a size and then it
395 // eventually becomes that size. But layout tests need to be sure 396 // eventually becomes that size. But layout tests need to be sure
396 // the resize has gone into WebKit by the time SizeTo() returns. 397 // the resize has gone into WebKit by the time SizeTo() returns.
397 // Force the webkit resize to happen now. 398 // Force the webkit resize to happen now.
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 switch (resource_id) { 572 switch (resource_id) {
572 case IDR_BROKENIMAGE: 573 case IDR_BROKENIMAGE:
573 resource_id = IDR_BROKENIMAGE_TESTSHELL; 574 resource_id = IDR_BROKENIMAGE_TESTSHELL;
574 break; 575 break;
575 case IDR_TEXTAREA_RESIZER: 576 case IDR_TEXTAREA_RESIZER:
576 resource_id = IDR_TEXTAREA_RESIZER_TESTSHELL; 577 resource_id = IDR_TEXTAREA_RESIZER_TESTSHELL;
577 break; 578 break;
578 } 579 }
579 return TestShell::ResourceProvider(resource_id); 580 return TestShell::ResourceProvider(resource_id);
580 } 581 }
OLDNEW
« no previous file with comments | « webkit/plugins/npapi/gtk_plugin_container_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698