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

Unified Diff: chrome/browser/views/autocomplete/autocomplete_popup_gtk.cc

Issue 361020: Fix checkfailure on Linux Views build by actually opening the popup when it's... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/views/autocomplete/autocomplete_popup_gtk.cc
===================================================================
--- chrome/browser/views/autocomplete/autocomplete_popup_gtk.cc (revision 30908)
+++ chrome/browser/views/autocomplete/autocomplete_popup_gtk.cc (working copy)
@@ -17,13 +17,30 @@
AutocompletePopupContentsView* contents)
: WidgetGtk(WidgetGtk::TYPE_POPUP),
contents_(contents),
- edit_view_(NULL) {
+ edit_view_(NULL),
+ is_open_(false) {
set_delete_on_destroy(false);
}
AutocompletePopupGtk::~AutocompletePopupGtk() {
}
+void AutocompletePopupGtk::Show() {
+ // Move the popup to the place appropriate for the window's current position -
+ // it may have been moved since it was last shown.
+ SetBounds(contents_->GetPopupBounds());
+ if (!IsVisible()) {
+ WidgetGtk::Show();
+ StackWindow();
+ }
+ is_open_ = true;
+}
+
+void AutocompletePopupGtk::Hide() {
+ WidgetGtk::Hide();
+ is_open_ = false;
+}
+
void AutocompletePopupGtk::Init(AutocompleteEditView* edit_view,
views::View* contents) {
MakeTransparent();
@@ -35,20 +52,14 @@
SetContentsView(contents_);
edit_view_ = edit_view;
-}
-void AutocompletePopupGtk::Show() {
- // Move the popup to the place appropriate for the window's current position -
- // it may have been moved since it was last shown.
- SetBounds(contents_->GetPopupBounds());
- if (!IsVisible()) {
- WidgetGtk::Show();
- StackWindow();
- }
+ Show();
}
bool AutocompletePopupGtk::IsOpen() const {
- return IsCreated() && IsVisible();
+ const bool is_open = IsCreated() && IsVisible();
+ CHECK(is_open == is_open_);
+ return is_open;
}
bool AutocompletePopupGtk::IsCreated() const {

Powered by Google App Engine
This is Rietveld 408576698