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

Side by Side Diff: chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.mm

Issue 10437006: Converts ui/views/controls, ui/views/examples, ui/base/models to ImageSkia (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 7 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
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 #import "chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.h" 5 #import "chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/mac/bundle_locations.h" 9 #include "base/mac/bundle_locations.h"
10 #import "base/mac/mac_util.h" 10 #import "base/mac/mac_util.h"
(...skipping 24 matching lines...) Expand all
35 #include "grit/generated_resources.h" 35 #include "grit/generated_resources.h"
36 #include "grit/theme_resources.h" 36 #include "grit/theme_resources.h"
37 #include "skia/ext/skia_utils_mac.h" 37 #include "skia/ext/skia_utils_mac.h"
38 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" 38 #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h"
39 #import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" 39 #import "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h"
40 #include "third_party/apple_sample_code/ImageAndTextCell.h" 40 #include "third_party/apple_sample_code/ImageAndTextCell.h"
41 #include "third_party/skia/include/core/SkBitmap.h" 41 #include "third_party/skia/include/core/SkBitmap.h"
42 #include "ui/base/l10n/l10n_util_mac.h" 42 #include "ui/base/l10n/l10n_util_mac.h"
43 #include "ui/base/resource/resource_bundle.h" 43 #include "ui/base/resource/resource_bundle.h"
44 #include "ui/gfx/image/image.h" 44 #include "ui/gfx/image/image.h"
45 #include "ui/gfx/image/image_skia.h"
45 46
46 namespace { 47 namespace {
47 // Colors for the infobar. 48 // Colors for the infobar.
48 const double kBannerGradientColorTop[3] = 49 const double kBannerGradientColorTop[3] =
49 {255.0 / 255.0, 242.0 / 255.0, 183.0 / 255.0}; 50 {255.0 / 255.0, 242.0 / 255.0, 183.0 / 255.0};
50 const double kBannerGradientColorBottom[3] = 51 const double kBannerGradientColorBottom[3] =
51 {250.0 / 255.0, 230.0 / 255.0, 145.0 / 255.0}; 52 {250.0 / 255.0, 230.0 / 255.0, 145.0 / 255.0};
52 const double kBannerStrokeColor = 135.0 / 255.0; 53 const double kBannerStrokeColor = 135.0 / 255.0;
53 54
54 enum TabViewItemIndices { 55 enum TabViewItemIndices {
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 blocked_lsos.local_storages()->Clone(), 401 blocked_lsos.local_storages()->Clone(),
401 blocked_lsos.session_storages()->Clone(), 402 blocked_lsos.session_storages()->Clone(),
402 blocked_lsos.appcaches()->Clone(), 403 blocked_lsos.appcaches()->Clone(),
403 blocked_lsos.indexed_dbs()->Clone(), 404 blocked_lsos.indexed_dbs()->Clone(),
404 blocked_lsos.file_systems()->Clone(), 405 blocked_lsos.file_systems()->Clone(),
405 NULL, 406 NULL,
406 blocked_lsos.server_bound_certs()->Clone(), 407 blocked_lsos.server_bound_certs()->Clone(),
407 true)); 408 true));
408 409
409 // Convert the model's icons from Skia to Cocoa. 410 // Convert the model's icons from Skia to Cocoa.
410 std::vector<SkBitmap> skiaIcons; 411 std::vector<gfx::ImageSkia> skiaIcons;
411 allowedTreeModel_->GetIcons(&skiaIcons); 412 allowedTreeModel_->GetIcons(&skiaIcons);
412 icons_.reset([[NSMutableArray alloc] init]); 413 icons_.reset([[NSMutableArray alloc] init]);
413 for (std::vector<SkBitmap>::iterator it = skiaIcons.begin(); 414 for (std::vector<gfx::ImageSkia>::iterator it = skiaIcons.begin();
414 it != skiaIcons.end(); ++it) { 415 it != skiaIcons.end(); ++it) {
415 [icons_ addObject:gfx::SkBitmapToNSImage(*it)]; 416 [icons_ addObject:gfx::SkBitmapToNSImage(*it->bitmap())];
416 } 417 }
417 418
418 // Default icon will be the last item in the array. 419 // Default icon will be the last item in the array.
419 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); 420 ResourceBundle& rb = ResourceBundle::GetSharedInstance();
420 // TODO(rsesek): Rename this resource now that it's in multiple places. 421 // TODO(rsesek): Rename this resource now that it's in multiple places.
421 [icons_ addObject:rb.GetNativeImageNamed(IDR_BOOKMARK_BAR_FOLDER)]; 422 [icons_ addObject:rb.GetNativeImageNamed(IDR_BOOKMARK_BAR_FOLDER)];
422 423
423 // Create the Cocoa model. 424 // Create the Cocoa model.
424 CookieTreeNode* root = 425 CookieTreeNode* root =
425 static_cast<CookieTreeNode*>(allowedTreeModel_->GetRoot()); 426 static_cast<CookieTreeNode*>(allowedTreeModel_->GetRoot());
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 treeController = blockedTreeController_; 554 treeController = blockedTreeController_;
554 break; 555 break;
555 default: 556 default:
556 NOTREACHED(); 557 NOTREACHED();
557 return; 558 return;
558 } 559 }
559 [detailsViewController_ configureBindingsForTreeController:treeController]; 560 [detailsViewController_ configureBindingsForTreeController:treeController];
560 } 561 }
561 562
562 @end 563 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698