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

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

Issue 286733002: [Refactor] Consolidate the logic for whether a widget can be activated. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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/views/omnibox/omnibox_popup_contents_view.h" 5 #include "chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "chrome/browser/search/search.h" 9 #include "chrome/browser/search/search.h"
10 #include "chrome/browser/themes/theme_properties.h" 10 #include "chrome/browser/themes/theme_properties.h"
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 size_animation_.Reset(); 192 size_animation_.Reset();
193 target_bounds_ = new_target_bounds; 193 target_bounds_ = new_target_bounds;
194 194
195 if (popup_ == NULL) { 195 if (popup_ == NULL) {
196 gfx::NativeView popup_parent = 196 gfx::NativeView popup_parent =
197 location_bar_view_->GetWidget()->GetNativeView(); 197 location_bar_view_->GetWidget()->GetNativeView();
198 198
199 // If the popup is currently closed, we need to create it. 199 // If the popup is currently closed, we need to create it.
200 popup_ = (new AutocompletePopupWidget)->AsWeakPtr(); 200 popup_ = (new AutocompletePopupWidget)->AsWeakPtr();
201 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); 201 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP);
202 params.can_activate = false;
203 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 202 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
204 params.parent = popup_parent; 203 params.parent = popup_parent;
205 params.bounds = GetPopupBounds(); 204 params.bounds = GetPopupBounds();
206 params.context = popup_parent; 205 params.context = popup_parent;
207 popup_->Init(params); 206 popup_->Init(params);
208 // Third-party software such as DigitalPersona identity verification can 207 // Third-party software such as DigitalPersona identity verification can
209 // hook the underlying window creation methods and use SendMessage to 208 // hook the underlying window creation methods and use SendMessage to
210 // synchronously change focus/activation, resulting in the popup being 209 // synchronously change focus/activation, resulting in the popup being
211 // destroyed by the time control returns here. Bail out in this case to 210 // destroyed by the time control returns here. Bail out in this case to
212 // avoid a NULL dereference. 211 // avoid a NULL dereference.
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
493 size_t index = GetIndexForPoint(event.location()); 492 size_t index = GetIndexForPoint(event.location());
494 if (!HasMatchAt(index)) 493 if (!HasMatchAt(index))
495 return; 494 return;
496 omnibox_view_->OpenMatch(model_->result().match_at(index), disposition, 495 omnibox_view_->OpenMatch(model_->result().match_at(index), disposition,
497 GURL(), base::string16(), index); 496 GURL(), base::string16(), index);
498 } 497 }
499 498
500 OmniboxResultView* OmniboxPopupContentsView::result_view_at(size_t i) { 499 OmniboxResultView* OmniboxPopupContentsView::result_view_at(size_t i) {
501 return static_cast<OmniboxResultView*>(child_at(static_cast<int>(i))); 500 return static_cast<OmniboxResultView*>(child_at(static_cast<int>(i)));
502 } 501 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698