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

Side by Side Diff: chrome/browser/ui/gtk/bubble/bubble_gtk.cc

Issue 16583005: Some improvement of validation message bubble UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: renaming Created 7 years, 6 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/gtk/bubble/bubble_gtk.h" 5 #include "chrome/browser/ui/gtk/bubble/bubble_gtk.h"
6 6
7 #include <gdk/gdkkeysyms.h> 7 #include <gdk/gdkkeysyms.h>
8 8
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "chrome/browser/ui/gtk/bubble/bubble_accelerators_gtk.h" 10 #include "chrome/browser/ui/gtk/bubble/bubble_accelerators_gtk.h"
(...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 } 550 }
551 551
552 void BubbleGtk::Close() { 552 void BubbleGtk::Close() {
553 // We don't need to ungrab the pointer or keyboard here; the X server will 553 // We don't need to ungrab the pointer or keyboard here; the X server will
554 // automatically do that when we destroy our window. 554 // automatically do that when we destroy our window.
555 DCHECK(window_); 555 DCHECK(window_);
556 gtk_widget_destroy(window_); 556 gtk_widget_destroy(window_);
557 // |this| has been deleted, see OnDestroy. 557 // |this| has been deleted, see OnDestroy.
558 } 558 }
559 559
560 void BubbleGtk::SetPositionRelativeToAnchor(const gfx::Rect* rect) {
561 rect_ = rect ? *rect : gtk_util::WidgetBounds(anchor_widget_);
562 if (!UpdateFrameStyle(false)) {
Evan Stade 2013/06/10 19:30:02 nit: no curlies
tkent 2013/06/11 07:02:43 Done.
563 MoveWindow();
564 }
565 }
566
560 void BubbleGtk::GrabPointerAndKeyboard() { 567 void BubbleGtk::GrabPointerAndKeyboard() {
561 GdkWindow* gdk_window = gtk_widget_get_window(window_); 568 GdkWindow* gdk_window = gtk_widget_get_window(window_);
562 569
563 // Install X pointer and keyboard grabs to make sure that we have the focus 570 // Install X pointer and keyboard grabs to make sure that we have the focus
564 // and get all mouse and keyboard events until we're closed. As a hack, grab 571 // and get all mouse and keyboard events until we're closed. As a hack, grab
565 // the pointer even if |grab_input_| is false to prevent a weird error 572 // the pointer even if |grab_input_| is false to prevent a weird error
566 // rendering the bubble's frame. See 573 // rendering the bubble's frame. See
567 // https://code.google.com/p/chromium/issues/detail?id=130820. 574 // https://code.google.com/p/chromium/issues/detail?id=130820.
568 GdkGrabStatus pointer_grab_status = 575 GdkGrabStatus pointer_grab_status =
569 gdk_pointer_grab(gdk_window, 576 gdk_pointer_grab(gdk_window,
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
771 anchor_widget_ = NULL; 778 anchor_widget_ = NULL;
772 Close(); 779 Close();
773 // |this| is deleted. 780 // |this| is deleted.
774 } 781 }
775 782
776 void BubbleGtk::OnToplevelDestroy(GtkWidget* widget) { 783 void BubbleGtk::OnToplevelDestroy(GtkWidget* widget) {
777 toplevel_window_ = NULL; 784 toplevel_window_ = NULL;
778 Close(); 785 Close();
779 // |this| is deleted. 786 // |this| is deleted.
780 } 787 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698