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

Side by Side Diff: chrome/browser/extensions/extension_action.cc

Issue 1154283003: Change most uses of Pickle to base::Pickle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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/extensions/extension_action.h" 5 #include "chrome/browser/extensions/extension_action.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/base64.h" 9 #include "base/base64.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 if (dict.GetBinary(kIconSizes[i].size_string, &image_data)) { 150 if (dict.GetBinary(kIconSizes[i].size_string, &image_data)) {
151 pickle = IPC::Message(image_data->GetBuffer(), image_data->GetSize()); 151 pickle = IPC::Message(image_data->GetBuffer(), image_data->GetSize());
152 } else if (dict.GetString(kIconSizes[i].size_string, &binary_string64)) { 152 } else if (dict.GetString(kIconSizes[i].size_string, &binary_string64)) {
153 std::string binary_string; 153 std::string binary_string;
154 if (!base::Base64Decode(binary_string64, &binary_string)) 154 if (!base::Base64Decode(binary_string64, &binary_string))
155 return false; 155 return false;
156 pickle = IPC::Message(binary_string.c_str(), binary_string.length()); 156 pickle = IPC::Message(binary_string.c_str(), binary_string.length());
157 } else { 157 } else {
158 continue; 158 continue;
159 } 159 }
160 PickleIterator iter(pickle); 160 base::PickleIterator iter(pickle);
161 SkBitmap bitmap; 161 SkBitmap bitmap;
162 if (!IPC::ReadParam(&pickle, &iter, &bitmap)) 162 if (!IPC::ReadParam(&pickle, &iter, &bitmap))
163 return false; 163 return false;
164 CHECK(!bitmap.isNull()); 164 CHECK(!bitmap.isNull());
165 float scale = ui::GetScaleForScaleFactor(kIconSizes[i].scale); 165 float scale = ui::GetScaleForScaleFactor(kIconSizes[i].scale);
166 icon->AddRepresentation(gfx::ImageSkiaRep(bitmap, scale)); 166 icon->AddRepresentation(gfx::ImageSkiaRep(bitmap, scale));
167 } 167 }
168 return true; 168 return true;
169 } 169 }
170 170
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 // If there is a default icon, the icon width will be set depending on our 382 // If there is a default icon, the icon width will be set depending on our
383 // action type. 383 // action type.
384 if (default_icon_) 384 if (default_icon_)
385 return GetIconSizeForType(action_type()); 385 return GetIconSizeForType(action_type());
386 386
387 // If no icon has been set and there is no default icon, we need favicon 387 // If no icon has been set and there is no default icon, we need favicon
388 // width. 388 // width.
389 return ui::ResourceBundle::GetSharedInstance().GetImageNamed( 389 return ui::ResourceBundle::GetSharedInstance().GetImageNamed(
390 IDR_EXTENSIONS_FAVICON).Width(); 390 IDR_EXTENSIONS_FAVICON).Width();
391 } 391 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/page_capture/page_capture_api.cc ('k') | chrome/browser/media/webrtc_log_uploader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698