summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ui/cocoa
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/ui/cocoa')
-rw-r--r--chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm7
-rw-r--r--chrome/browser/ui/cocoa/menu_controller.mm9
-rw-r--r--chrome/browser/ui/cocoa/menu_controller_unittest.mm5
-rw-r--r--chrome/browser/ui/cocoa/toolbar/back_forward_menu_controller.mm7
4 files changed, 16 insertions, 12 deletions
diff --git a/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm b/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm
index ae379ef..879d901 100644
--- a/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm
+++ b/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm
@@ -42,6 +42,7 @@
#include "ui/base/l10n/l10n_util_mac.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image.h"
+#include "ui/gfx/image/image_skia.h"
namespace {
// Colors for the infobar.
@@ -407,12 +408,12 @@ void CollectedCookiesMac::OnSheetDidEnd(NSWindow* sheet) {
true));
// Convert the model's icons from Skia to Cocoa.
- std::vector<SkBitmap> skiaIcons;
+ std::vector<gfx::ImageSkia> skiaIcons;
allowedTreeModel_->GetIcons(&skiaIcons);
icons_.reset([[NSMutableArray alloc] init]);
- for (std::vector<SkBitmap>::iterator it = skiaIcons.begin();
+ for (std::vector<gfx::ImageSkia>::iterator it = skiaIcons.begin();
it != skiaIcons.end(); ++it) {
- [icons_ addObject:gfx::SkBitmapToNSImage(*it)];
+ [icons_ addObject:gfx::SkBitmapToNSImage(*it->bitmap())];
}
// Default icon will be the last item in the array.
diff --git a/chrome/browser/ui/cocoa/menu_controller.mm b/chrome/browser/ui/cocoa/menu_controller.mm
index 2cb6a60..8de231b 100644
--- a/chrome/browser/ui/cocoa/menu_controller.mm
+++ b/chrome/browser/ui/cocoa/menu_controller.mm
@@ -12,6 +12,7 @@
#include "ui/base/accelerators/accelerator_cocoa.h"
#include "ui/base/l10n/l10n_util_mac.h"
#include "ui/base/models/simple_menu_model.h"
+#include "ui/gfx/image/image_skia.h"
@interface MenuController (Private)
- (void)addSeparatorToMenu:(NSMenu*)menu
@@ -106,9 +107,9 @@
keyEquivalent:@""]);
// If the menu item has an icon, set it.
- SkBitmap skiaIcon;
+ gfx::ImageSkia skiaIcon;
if (model->GetIconAt(modelIndex, &skiaIcon) && !skiaIcon.isNull()) {
- NSImage* icon = gfx::SkBitmapToNSImage(skiaIcon);
+ NSImage* icon = gfx::SkBitmapToNSImage(*skiaIcon.bitmap());
if (icon) {
[item setImage:icon];
}
@@ -165,10 +166,10 @@
NSString* label =
l10n_util::FixUpWindowsStyleLabel(model->GetLabelAt(modelIndex));
[(id)item setTitle:label];
- SkBitmap skiaIcon;
+ gfx::ImageSkia skiaIcon;
NSImage* icon = nil;
if (model->GetIconAt(modelIndex, &skiaIcon) && !skiaIcon.isNull())
- icon = gfx::SkBitmapToNSImage(skiaIcon);
+ icon = gfx::SkBitmapToNSImage(*skiaIcon.bitmap());
[(id)item setImage:icon];
}
return model->IsEnabledAt(modelIndex);
diff --git a/chrome/browser/ui/cocoa/menu_controller_unittest.mm b/chrome/browser/ui/cocoa/menu_controller_unittest.mm
index d838531..6d9a792 100644
--- a/chrome/browser/ui/cocoa/menu_controller_unittest.mm
+++ b/chrome/browser/ui/cocoa/menu_controller_unittest.mm
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -14,6 +14,7 @@
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/models/simple_menu_model.h"
#include "ui/base/resource/resource_bundle.h"
+#include "ui/gfx/image/image_skia.h"
class MenuControllerTest : public CocoaTest {
};
@@ -75,7 +76,7 @@ class DynamicDelegate : public Delegate {
DynamicDelegate() : icon_(NULL) {}
virtual bool IsItemForCommandIdDynamic(int command_id) const { return true; }
virtual string16 GetLabelForCommandId(int command_id) const { return label_; }
- virtual bool GetIconForCommandId(int command_id, SkBitmap* icon) const {
+ virtual bool GetIconForCommandId(int command_id, gfx::ImageSkia* icon) const {
if (icon_) {
*icon = *icon_;
return true;
diff --git a/chrome/browser/ui/cocoa/toolbar/back_forward_menu_controller.mm b/chrome/browser/ui/cocoa/toolbar/back_forward_menu_controller.mm
index 97a6e52..396d9ab 100644
--- a/chrome/browser/ui/cocoa/toolbar/back_forward_menu_controller.mm
+++ b/chrome/browser/ui/cocoa/toolbar/back_forward_menu_controller.mm
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -12,6 +12,7 @@
#include "chrome/browser/ui/toolbar/back_forward_menu_model.h"
#include "skia/ext/skia_utils_mac.h"
#include "third_party/skia/include/core/SkBitmap.h"
+#include "ui/gfx/image/image_skia.h"
using base::SysUTF16ToNSString;
using gfx::SkBitmapToNSImage;
@@ -71,10 +72,10 @@ using gfx::SkBitmapToNSImage;
keyEquivalent:@""];
[menuItem autorelease];
- SkBitmap icon;
+ gfx::ImageSkia icon;
// Icon (if it has one).
if (model_->GetIconAt(menuID, &icon))
- [menuItem setImage:SkBitmapToNSImage(icon)];
+ [menuItem setImage:SkBitmapToNSImage(*icon.bitmap())];
// This will make it call our |-executeMenuItem:| method. We store the
// |menuID| (or |menu_id|) in the tag.