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

Side by Side Diff: chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.mm

Issue 1154013009: [OSX] Don't create deferred windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
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/cocoa/omnibox/omnibox_popup_view_mac.h" 5 #include "chrome/browser/ui/cocoa/omnibox/omnibox_popup_view_mac.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 const AutocompleteResult& OmniboxPopupViewMac::GetResult() const { 190 const AutocompleteResult& OmniboxPopupViewMac::GetResult() const {
191 return model_->result(); 191 return model_->result();
192 } 192 }
193 193
194 void OmniboxPopupViewMac::CreatePopupIfNeeded() { 194 void OmniboxPopupViewMac::CreatePopupIfNeeded() {
195 if (!popup_) { 195 if (!popup_) {
196 popup_.reset( 196 popup_.reset(
197 [[NSWindow alloc] initWithContentRect:ui::kWindowSizeDeterminedLater 197 [[NSWindow alloc] initWithContentRect:ui::kWindowSizeDeterminedLater
198 styleMask:NSBorderlessWindowMask 198 styleMask:NSBorderlessWindowMask
199 backing:NSBackingStoreBuffered 199 backing:NSBackingStoreBuffered
200 defer:YES]); 200 defer:NO]);
201 [popup_ setBackgroundColor:[NSColor clearColor]]; 201 [popup_ setBackgroundColor:[NSColor clearColor]];
202 [popup_ setOpaque:NO]; 202 [popup_ setOpaque:NO];
203 203
204 // Use a flipped view to pin the matrix top the top left. This is needed 204 // Use a flipped view to pin the matrix top the top left. This is needed
205 // for animated resize. 205 // for animated resize.
206 base::scoped_nsobject<FlippedView> contentView( 206 base::scoped_nsobject<FlippedView> contentView(
207 [[FlippedView alloc] initWithFrame:NSZeroRect]); 207 [[FlippedView alloc] initWithFrame:NSZeroRect]);
208 [popup_ setContentView:contentView]; 208 [popup_ setContentView:contentView];
209 209
210 // View to draw a background beneath the matrix. 210 // View to draw a background beneath the matrix.
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
335 } 335 }
336 336
337 void OmniboxPopupViewMac::OpenURLForRow(size_t row, 337 void OmniboxPopupViewMac::OpenURLForRow(size_t row,
338 WindowOpenDisposition disposition) { 338 WindowOpenDisposition disposition) {
339 size_t start_match = model_->result().ShouldHideTopMatch() ? 1 : 0; 339 size_t start_match = model_->result().ShouldHideTopMatch() ? 1 : 0;
340 row += start_match; 340 row += start_match;
341 DCHECK_LT(row, GetResult().size()); 341 DCHECK_LT(row, GetResult().size());
342 omnibox_view_->OpenMatch(GetResult().match_at(row), disposition, GURL(), 342 omnibox_view_->OpenMatch(GetResult().match_at(row), disposition, GURL(),
343 base::string16(), row); 343 base::string16(), row);
344 } 344 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/fullscreen_window.mm ('k') | chrome/browser/ui/cocoa/status_bubble_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698