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

Side by Side Diff: chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.mm

Issue 1695563002: Media Galleries Partial Deprecation: Remove scan functionality. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/extensions/media_galleries_dialog_cocoa.h" 5 #include "chrome/browser/ui/cocoa/extensions/media_galleries_dialog_cocoa.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/mac/scoped_nsobject.h" 9 #include "base/mac/scoped_nsobject.h"
10 #include "base/strings/sys_string_conversions.h" 10 #include "base/strings/sys_string_conversions.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 CGFloat MediaGalleriesDialogCocoa::CreateCheckboxes( 180 CGFloat MediaGalleriesDialogCocoa::CreateCheckboxes(
181 CGFloat y_pos, 181 CGFloat y_pos,
182 const MediaGalleriesDialogController::Entries& entries) { 182 const MediaGalleriesDialogController::Entries& entries) {
183 for (MediaGalleriesDialogController::Entries::const_iterator iter = 183 for (MediaGalleriesDialogController::Entries::const_iterator iter =
184 entries.begin(); iter != entries.end(); ++iter) { 184 entries.begin(); iter != entries.end(); ++iter) {
185 const MediaGalleriesDialogController::Entry& entry = *iter; 185 const MediaGalleriesDialogController::Entry& entry = *iter;
186 base::scoped_nsobject<MediaGalleryListEntry> checkbox_entry( 186 base::scoped_nsobject<MediaGalleryListEntry> checkbox_entry(
187 [[MediaGalleryListEntry alloc] 187 [[MediaGalleryListEntry alloc]
188 initWithFrame:NSZeroRect 188 initWithFrame:NSZeroRect
189 controller:this 189 controller:this
190 prefInfo:entry.pref_info 190 prefInfo:entry.pref_info]);
191 showFolderViewer:controller_->ShouldShowFolderViewer(entry)]);
192 191
193 [checkbox_entry setState:entry.selected]; 192 [checkbox_entry setState:entry.selected];
194 193
195 [checkbox_entry setFrameOrigin:NSMakePoint(0, y_pos)]; 194 [checkbox_entry setFrameOrigin:NSMakePoint(0, y_pos)];
196 y_pos = NSMaxY([checkbox_entry frame]) + kCheckboxMargin; 195 y_pos = NSMaxY([checkbox_entry frame]) + kCheckboxMargin;
197 196
198 [checkbox_container_ addSubview:checkbox_entry]; 197 [checkbox_container_ addSubview:checkbox_entry];
199 } 198 }
200 199
201 return y_pos; 200 return y_pos;
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 } 260 }
262 261
263 void MediaGalleriesDialogCocoa::OnCheckboxToggled(MediaGalleryPrefId pref_id, 262 void MediaGalleriesDialogCocoa::OnCheckboxToggled(MediaGalleryPrefId pref_id,
264 bool checked) { 263 bool checked) {
265 controller_->DidToggleEntry(pref_id, checked); 264 controller_->DidToggleEntry(pref_id, checked);
266 265
267 [[[alert_ buttons] objectAtIndex:0] setEnabled: 266 [[[alert_ buttons] objectAtIndex:0] setEnabled:
268 controller_->IsAcceptAllowed()]; 267 controller_->IsAcceptAllowed()];
269 } 268 }
270 269
271 void MediaGalleriesDialogCocoa::OnFolderViewerClicked(
272 MediaGalleryPrefId prefId) {
273 controller_->DidClickOpenFolderViewer(prefId);
274 }
275
276 ui::MenuModel* MediaGalleriesDialogCocoa::GetContextMenu( 270 ui::MenuModel* MediaGalleriesDialogCocoa::GetContextMenu(
277 MediaGalleryPrefId pref_id) { 271 MediaGalleryPrefId pref_id) {
278 return controller_->GetContextMenu(pref_id); 272 return controller_->GetContextMenu(pref_id);
279 } 273 }
280 274
281 // static 275 // static
282 MediaGalleriesDialog* MediaGalleriesDialog::Create( 276 MediaGalleriesDialog* MediaGalleriesDialog::Create(
283 MediaGalleriesDialogController* controller) { 277 MediaGalleriesDialogController* controller) {
284 base::scoped_nsobject<MediaGalleriesCocoaController> cocoa_controller( 278 base::scoped_nsobject<MediaGalleriesCocoaController> cocoa_controller(
285 [[MediaGalleriesCocoaController alloc] init]); 279 [[MediaGalleriesCocoaController alloc] init]);
286 return new MediaGalleriesDialogCocoa(controller, cocoa_controller); 280 return new MediaGalleriesDialogCocoa(controller, cocoa_controller);
287 } 281 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698