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

Side by Side Diff: ui/base/clipboard/clipboard_gtk.cc

Issue 11878022: ui: Convert scoped_arrays to the new scoped_ptr style. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 | « ui/base/clipboard/clipboard_chromeos.cc ('k') | ui/base/dialogs/select_file_dialog_win.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 "ui/base/clipboard/clipboard.h" 5 #include "ui/base/clipboard/clipboard.h"
6 6
7 #include <gtk/gtk.h> 7 #include <gtk/gtk.h>
8 #include <X11/extensions/Xfixes.h> 8 #include <X11/extensions/Xfixes.h>
9 #include <X11/Xatom.h> 9 #include <X11/Xatom.h>
10 #include <map> 10 #include <map>
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 for (ObjectMap::const_iterator iter = objects.begin(); 224 for (ObjectMap::const_iterator iter = objects.begin();
225 iter != objects.end(); ++iter) { 225 iter != objects.end(); ++iter) {
226 DispatchObject(static_cast<ObjectType>(iter->first), iter->second); 226 DispatchObject(static_cast<ObjectType>(iter->first), iter->second);
227 } 227 }
228 228
229 SetGtkClipboard(buffer); 229 SetGtkClipboard(buffer);
230 } 230 }
231 231
232 // Take ownership of the GTK clipboard and inform it of the targets we support. 232 // Take ownership of the GTK clipboard and inform it of the targets we support.
233 void Clipboard::SetGtkClipboard(Buffer buffer) { 233 void Clipboard::SetGtkClipboard(Buffer buffer) {
234 scoped_array<GtkTargetEntry> targets( 234 scoped_ptr<GtkTargetEntry[]> targets(
235 new GtkTargetEntry[clipboard_data_->size()]); 235 new GtkTargetEntry[clipboard_data_->size()]);
236 236
237 int i = 0; 237 int i = 0;
238 for (Clipboard::TargetMap::iterator iter = clipboard_data_->begin(); 238 for (Clipboard::TargetMap::iterator iter = clipboard_data_->begin();
239 iter != clipboard_data_->end(); ++iter, ++i) { 239 iter != clipboard_data_->end(); ++iter, ++i) {
240 targets[i].target = const_cast<char*>(iter->first.c_str()); 240 targets[i].target = const_cast<char*>(iter->first.c_str());
241 targets[i].flags = 0; 241 targets[i].flags = 0;
242 targets[i].info = 0; 242 targets[i].info = 0;
243 } 243 }
244 244
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after
669 return clipboard_; 669 return clipboard_;
670 case BUFFER_SELECTION: 670 case BUFFER_SELECTION:
671 return primary_selection_; 671 return primary_selection_;
672 default: 672 default:
673 NOTREACHED(); 673 NOTREACHED();
674 return NULL; 674 return NULL;
675 } 675 }
676 } 676 }
677 677
678 } // namespace ui 678 } // namespace ui
OLDNEW
« no previous file with comments | « ui/base/clipboard/clipboard_chromeos.cc ('k') | ui/base/dialogs/select_file_dialog_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698