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

Side by Side Diff: ui/gfx/image/image.cc

Issue 10933083: Remove deprecated gfx::Image::operator NSImage*(). (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Comments and merge Created 8 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
« no previous file with comments | « ui/gfx/image/image.h ('k') | ui/gfx/image/image_mac_unittest.mm » ('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/gfx/image/image.h" 5 #include "ui/gfx/image/image.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after
647 return image; 647 return image;
648 } 648 }
649 #elif defined(OS_MACOSX) 649 #elif defined(OS_MACOSX)
650 NSImage* Image::CopyNSImage() const { 650 NSImage* Image::CopyNSImage() const {
651 NSImage* image = ToNSImage(); 651 NSImage* image = ToNSImage();
652 base::mac::NSObjectRetain(image); 652 base::mac::NSObjectRetain(image);
653 return image; 653 return image;
654 } 654 }
655 #endif 655 #endif
656 656
657 #if defined(OS_MACOSX) && !defined(OS_IOS)
658 Image::operator NSImage*() const {
659 return ToNSImage();
660 }
661 #endif
662
663 bool Image::HasRepresentation(RepresentationType type) const { 657 bool Image::HasRepresentation(RepresentationType type) const {
664 return storage_.get() && storage_->representations().count(type) != 0; 658 return storage_.get() && storage_->representations().count(type) != 0;
665 } 659 }
666 660
667 size_t Image::RepresentationCount() const { 661 size_t Image::RepresentationCount() const {
668 if (!storage_.get()) 662 if (!storage_.get())
669 return 0; 663 return 0;
670 664
671 return storage_->representations().size(); 665 return storage_->representations().size();
672 } 666 }
(...skipping 25 matching lines...) Expand all
698 } 692 }
699 return it->second; 693 return it->second;
700 } 694 }
701 695
702 void Image::AddRepresentation(internal::ImageRep* rep) const { 696 void Image::AddRepresentation(internal::ImageRep* rep) const {
703 CHECK(storage_.get()); 697 CHECK(storage_.get());
704 storage_->representations().insert(std::make_pair(rep->type(), rep)); 698 storage_->representations().insert(std::make_pair(rep->type(), rep));
705 } 699 }
706 700
707 } // namespace gfx 701 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/image/image.h ('k') | ui/gfx/image/image_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698