Convert IconLoader and IconManager to deal with gfx::Image rather than SkBitmap.

This allows loading of icons in the platform format, avoiding unnecessary
conversions if the image is going to be used with the platform toolkit. In other
cases, this just pushes image conversion to the callsite rather than the actual
image load.

BUG=19685
TEST=unit_tests and visual inspection of icons in the download shelf

Review URL: http://codereview.chromium.org/6597043

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76743 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/ui/gfx/image.cc b/ui/gfx/image.cc
index b73b938..41c1594 100644
--- a/ui/gfx/image.cc
+++ b/ui/gfx/image.cc
@@ -4,6 +4,8 @@
 
 #include "ui/gfx/image.h"
 
+#include <algorithm>
+
 #include "base/logging.h"
 #include "third_party/skia/include/core/SkBitmap.h"
 
@@ -206,6 +208,11 @@
   return representations_.count(type) != 0;
 }
 
+void Image::SwapRepresentations(gfx::Image* other) {
+  representations_.swap(other->representations_);
+  std::swap(default_representation_, other->default_representation_);
+}
+
 internal::ImageRep* Image::DefaultRepresentation() {
   RepresentationMap::iterator it =
       representations_.find(default_representation_);