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

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

Issue 2248873002: Convert WindowOpenDisposition to an enum class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 3 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/mac/mac_util.h" 9 #include "base/mac/mac_util.h"
10 #import "base/mac/sdk_forward_declarations.h" 10 #import "base/mac/sdk_forward_declarations.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 } 155 }
156 156
157 void OmniboxPopupViewMac::OnMatrixRowClicked(OmniboxPopupMatrix* matrix, 157 void OmniboxPopupViewMac::OnMatrixRowClicked(OmniboxPopupMatrix* matrix,
158 size_t row) { 158 size_t row) {
159 OpenURLForRow(row, 159 OpenURLForRow(row,
160 ui::WindowOpenDispositionFromNSEvent([NSApp currentEvent])); 160 ui::WindowOpenDispositionFromNSEvent([NSApp currentEvent]));
161 } 161 }
162 162
163 void OmniboxPopupViewMac::OnMatrixRowMiddleClicked(OmniboxPopupMatrix* matrix, 163 void OmniboxPopupViewMac::OnMatrixRowMiddleClicked(OmniboxPopupMatrix* matrix,
164 size_t row) { 164 size_t row) {
165 OpenURLForRow(row, NEW_BACKGROUND_TAB); 165 OpenURLForRow(row, WindowOpenDisposition::NEW_BACKGROUND_TAB);
166 } 166 }
167 167
168 const AutocompleteResult& OmniboxPopupViewMac::GetResult() const { 168 const AutocompleteResult& OmniboxPopupViewMac::GetResult() const {
169 return model_->result(); 169 return model_->result();
170 } 170 }
171 171
172 void OmniboxPopupViewMac::CreatePopupIfNeeded() { 172 void OmniboxPopupViewMac::CreatePopupIfNeeded() {
173 if (!popup_) { 173 if (!popup_) {
174 popup_.reset( 174 popup_.reset(
175 [[NSWindow alloc] initWithContentRect:ui::kWindowSizeDeterminedLater 175 [[NSWindow alloc] initWithContentRect:ui::kWindowSizeDeterminedLater
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
359 return NSImageFromImageSkia( 359 return NSImageFromImageSkia(
360 gfx::CreateVectorIcon(vector_icon_id, kIconSize, icon_color)); 360 gfx::CreateVectorIcon(vector_icon_id, kIconSize, icon_color));
361 } 361 }
362 362
363 void OmniboxPopupViewMac::OpenURLForRow(size_t row, 363 void OmniboxPopupViewMac::OpenURLForRow(size_t row,
364 WindowOpenDisposition disposition) { 364 WindowOpenDisposition disposition) {
365 DCHECK_LT(row, GetResult().size()); 365 DCHECK_LT(row, GetResult().size());
366 omnibox_view_->OpenMatch(GetResult().match_at(row), disposition, GURL(), 366 omnibox_view_->OpenMatch(GetResult().match_at(row), disposition, GURL(),
367 base::string16(), row); 367 base::string16(), row);
368 } 368 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/history_menu_cocoa_controller.mm ('k') | chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698