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

Side by Side Diff: chrome/browser/renderer_host/render_widget_host_view_gtk.cc

Issue 361034: Tell the RWH about the intial window size for drop down menus. (Closed)
Patch Set: Created 11 years, 1 month 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 | « no previous file | 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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/renderer_host/render_widget_host_view_gtk.h" 5 #include "chrome/browser/renderer_host/render_widget_host_view_gtk.h"
6 6
7 // If this gets included after the gtk headers, then a bunch of compiler 7 // If this gets included after the gtk headers, then a bunch of compiler
8 // errors happen because of a "#define Status int" in Xlib.h, which interacts 8 // errors happen because of a "#define Status int" in Xlib.h, which interacts
9 // badly with URLRequestStatus::Status. 9 // badly with URLRequestStatus::Status.
10 #include "chrome/common/render_messages.h" 10 #include "chrome/common/render_messages.h"
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 NULL, 351 NULL,
352 GDK_CURRENT_TIME); 352 GDK_CURRENT_TIME);
353 // We grab keyboard events too so things like alt+tab are eaten. 353 // We grab keyboard events too so things like alt+tab are eaten.
354 gdk_keyboard_grab(parent_->window, TRUE, GDK_CURRENT_TIME); 354 gdk_keyboard_grab(parent_->window, TRUE, GDK_CURRENT_TIME);
355 355
356 // Our parent widget actually keeps GTK focus within its window, but we have 356 // Our parent widget actually keeps GTK focus within its window, but we have
357 // to make the webkit selection box disappear to maintain appearances. 357 // to make the webkit selection box disappear to maintain appearances.
358 parent_host_view->Blur(); 358 parent_host_view->Blur();
359 } 359 }
360 360
361 gtk_widget_set_size_request(view_.get(), 361 requested_size_ = gfx::Size(std::min(pos.width(), kMaxWindowWidth),
362 std::min(pos.width(), kMaxWindowWidth),
363 std::min(pos.height(), kMaxWindowHeight)); 362 std::min(pos.height(), kMaxWindowHeight));
363 host_->WasResized();
364 gtk_widget_set_size_request(view_.get(), requested_size_.width(),
365 requested_size_.height());
364 366
365 gtk_window_set_default_size(GTK_WINDOW(popup), -1, -1); 367 gtk_window_set_default_size(GTK_WINDOW(popup), -1, -1);
366 // Don't allow the window to be resized. This also forces the window to 368 // Don't allow the window to be resized. This also forces the window to
367 // shrink down to the size of its child contents. 369 // shrink down to the size of its child contents.
368 gtk_window_set_resizable(GTK_WINDOW(popup), FALSE); 370 gtk_window_set_resizable(GTK_WINDOW(popup), FALSE);
369 gtk_window_move(GTK_WINDOW(popup), pos.x(), pos.y()); 371 gtk_window_move(GTK_WINDOW(popup), pos.x(), pos.y());
370 gtk_widget_show_all(popup); 372 gtk_widget_show_all(popup);
371 } 373 }
372 374
373 void RenderWidgetHostViewGtk::DidBecomeSelected() { 375 void RenderWidgetHostViewGtk::DidBecomeSelected() {
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 const NativeWebKeyboardEvent& event) { 659 const NativeWebKeyboardEvent& event) {
658 if (!host_) 660 if (!host_)
659 return; 661 return;
660 662
661 EditCommands edit_commands; 663 EditCommands edit_commands;
662 if (key_bindings_handler_->Match(event, &edit_commands)) { 664 if (key_bindings_handler_->Match(event, &edit_commands)) {
663 host_->ForwardEditCommandsForNextKeyEvent(edit_commands); 665 host_->ForwardEditCommandsForNextKeyEvent(edit_commands);
664 } 666 }
665 host_->ForwardKeyboardEvent(event); 667 host_->ForwardKeyboardEvent(event);
666 } 668 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698