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

Side by Side Diff: chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc

Issue 13699002: add HideAndClose in preference to having Close sometimes magically defer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: non aura Created 7 years, 8 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
« no previous file with comments | « no previous file | ui/views/bubble/bubble_delegate.cc » ('j') | 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) 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/views/omnibox/omnibox_popup_contents_view.h" 5 #include "chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h"
6 6
7 #include "chrome/browser/search/search.h" 7 #include "chrome/browser/search/search.h"
8 #include "chrome/browser/ui/omnibox/omnibox_popup_non_view.h" 8 #include "chrome/browser/ui/omnibox/omnibox_popup_non_view.h"
9 #include "chrome/browser/ui/omnibox/omnibox_view.h" 9 #include "chrome/browser/ui/omnibox/omnibox_view.h"
10 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" 10 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 void OmniboxPopupContentsView::UpdatePopupAppearance() { 164 void OmniboxPopupContentsView::UpdatePopupAppearance() {
165 if (model_->result().empty()) { 165 if (model_->result().empty()) {
166 // No matches, close any existing popup. 166 // No matches, close any existing popup.
167 if (popup_ != NULL) { 167 if (popup_ != NULL) {
168 size_animation_.Stop(); 168 size_animation_.Stop();
169 169
170 // NOTE: Do NOT use CloseNow() here, as we may be deep in a callstack 170 // NOTE: Do NOT use CloseNow() here, as we may be deep in a callstack
171 // triggered by the popup receiving a message (e.g. LBUTTONUP), and 171 // triggered by the popup receiving a message (e.g. LBUTTONUP), and
172 // destroying the popup would cause us to read garbage when we unwind back 172 // destroying the popup would cause us to read garbage when we unwind back
173 // to that level. 173 // to that level.
174 popup_->Close(); // This will eventually delete the popup. 174 popup_->HideAndClose(); // This will eventually delete the popup.
175 popup_.reset(); 175 popup_.reset();
176 } 176 }
177 return; 177 return;
178 } 178 }
179 179
180 // Update the match cached by each row, in the process of doing so make sure 180 // Update the match cached by each row, in the process of doing so make sure
181 // we have enough row views. 181 // we have enough row views.
182 size_t child_rv_count = child_count(); 182 size_t child_rv_count = child_count();
183 const size_t result_size = model_->result().size(); 183 const size_t result_size = model_->result().size();
184 for (size_t i = 0; i < result_size; ++i) { 184 for (size_t i = 0; i < result_size; ++i) {
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
540 void OmniboxPopupContentsView::OpenSelectedLine( 540 void OmniboxPopupContentsView::OpenSelectedLine(
541 const ui::LocatedEvent& event, 541 const ui::LocatedEvent& event,
542 WindowOpenDisposition disposition) { 542 WindowOpenDisposition disposition) {
543 size_t index = GetIndexForPoint(event.location()); 543 size_t index = GetIndexForPoint(event.location());
544 OpenIndex(index, disposition); 544 OpenIndex(index, disposition);
545 } 545 }
546 546
547 OmniboxResultView* OmniboxPopupContentsView::result_view_at(size_t i) { 547 OmniboxResultView* OmniboxPopupContentsView::result_view_at(size_t i) {
548 return static_cast<OmniboxResultView*>(child_at(static_cast<int>(i))); 548 return static_cast<OmniboxResultView*>(child_at(static_cast<int>(i)));
549 } 549 }
OLDNEW
« no previous file with comments | « no previous file | ui/views/bubble/bubble_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698