summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/automation/automation_provider_observers.cc1
-rw-r--r--chrome/browser/automation/automation_provider_observers_chromeos.cc2
-rw-r--r--chrome/browser/background/background_application_list_model.cc9
-rw-r--r--chrome/browser/background/background_application_list_model.h8
-rw-r--r--chrome/browser/background/background_mode_manager.cc8
-rw-r--r--chrome/browser/background/background_mode_manager_win.cc6
-rw-r--r--chrome/browser/chrome_browser_main.cc2
-rw-r--r--chrome/browser/chromeos/login/user_manager_impl.cc6
-rw-r--r--chrome/browser/custom_home_pages_table_model.h1
-rw-r--r--chrome/browser/download/download_extension_api.cc2
-rw-r--r--chrome/browser/download/download_util.cc44
-rw-r--r--chrome/browser/download/download_util.h2
-rw-r--r--chrome/browser/extensions/extension_function_dispatcher.cc1
-rw-r--r--chrome/browser/extensions/extension_install_dialog.cc3
-rw-r--r--chrome/browser/extensions/extension_install_dialog.h1
-rw-r--r--chrome/browser/extensions/extension_install_ui.cc6
-rw-r--r--chrome/browser/extensions/extension_install_ui.h3
-rw-r--r--chrome/browser/extensions/extension_uninstall_dialog.cc6
-rw-r--r--chrome/browser/extensions/extension_uninstall_dialog.h10
-rw-r--r--chrome/browser/media/media_stream_capture_indicator.cc4
-rw-r--r--chrome/browser/media/media_stream_capture_indicator.h8
-rw-r--r--chrome/browser/ntp_background_util.cc9
-rw-r--r--chrome/browser/speech/speech_recognition_bubble.cc46
-rw-r--r--chrome/browser/speech/speech_recognition_bubble.h13
-rw-r--r--chrome/browser/speech/speech_recognition_bubble_controller_unittest.cc2
-rw-r--r--chrome/browser/speech/speech_recognition_tray_icon_controller.cc25
-rw-r--r--chrome/browser/speech/speech_recognition_tray_icon_controller.h6
-rw-r--r--chrome/browser/status_icons/desktop_notification_balloon.cc3
-rw-r--r--chrome/browser/task_manager/task_manager.cc10
-rw-r--r--chrome/browser/task_manager/task_manager.h9
-rw-r--r--chrome/browser/task_manager/task_manager_notification_resource_provider.cc10
-rw-r--r--chrome/browser/task_manager/task_manager_resource_providers.cc35
-rw-r--r--chrome/browser/task_manager/task_manager_resource_providers.h24
-rw-r--r--chrome/browser/task_manager/task_manager_unittest.cc4
-rw-r--r--chrome/browser/task_manager/task_manager_worker_resource_provider.cc12
-rw-r--r--chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.h4
-rw-r--r--chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.h2
-rw-r--r--chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm6
-rw-r--r--chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.cc3
-rw-r--r--chrome/browser/ui/cocoa/infobars/mock_link_infobar_delegate.cc3
-rw-r--r--chrome/browser/ui/cocoa/table_row_nsimage_cache.h9
-rw-r--r--chrome/browser/ui/cocoa/table_row_nsimage_cache.mm6
-rw-r--r--chrome/browser/ui/cocoa/task_manager_mac.h9
-rw-r--r--chrome/browser/ui/cocoa/task_manager_mac.mm3
-rw-r--r--chrome/browser/ui/gtk/extensions/extension_install_dialog_gtk.cc2
-rw-r--r--chrome/browser/ui/gtk/speech_recognition_bubble_gtk.cc6
-rw-r--r--chrome/browser/ui/search_engines/template_url_table_model.cc4
-rw-r--r--chrome/browser/ui/search_engines/template_url_table_model.h1
-rw-r--r--chrome/browser/ui/toolbar/wrench_menu_model.cc8
-rw-r--r--chrome/browser/ui/views/about_chrome_view.cc19
-rw-r--r--chrome/browser/ui/views/autocomplete/autocomplete_result_view.cc5
-rw-r--r--chrome/browser/ui/views/avatar_menu_bubble_view.cc13
-rw-r--r--chrome/browser/ui/views/avatar_menu_button.cc6
-rw-r--r--chrome/browser/ui/views/avatar_menu_button.h2
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc14
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc10
-rw-r--r--chrome/browser/ui/views/constrained_window_views.cc4
-rw-r--r--chrome/browser/ui/views/detachable_toolbar_view.cc9
-rw-r--r--chrome/browser/ui/views/download/download_item_view.cc194
-rw-r--r--chrome/browser/ui/views/download/download_item_view.h38
-rw-r--r--chrome/browser/ui/views/dropdown_bar_view.cc14
-rw-r--r--chrome/browser/ui/views/dropdown_bar_view.h4
-rw-r--r--chrome/browser/ui/views/extensions/extension_install_dialog_view.cc8
-rw-r--r--chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc4
-rw-r--r--chrome/browser/ui/views/find_bar_view.cc7
-rw-r--r--chrome/browser/ui/views/find_bar_view.h4
-rw-r--r--chrome/browser/ui/views/infobars/extension_infobar.cc11
-rw-r--r--chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc6
-rw-r--r--chrome/browser/ui/views/location_bar/icon_label_bubble_view.h6
-rw-r--r--chrome/browser/ui/views/location_bar/keyword_hint_view.cc22
-rw-r--r--chrome/browser/ui/views/location_bar/location_bar_view.cc6
-rw-r--r--chrome/browser/ui/views/menu_item_view_test.cc4
-rw-r--r--chrome/browser/ui/views/notifications/balloon_view.cc8
-rw-r--r--chrome/browser/ui/views/page_info_bubble_view.cc10
-rw-r--r--chrome/browser/ui/views/speech_recognition_bubble_views.cc10
-rw-r--r--chrome/browser/ui/views/tab_icon_view.cc24
-rw-r--r--chrome/browser/ui/views/tab_icon_view.h4
-rw-r--r--chrome/browser/ui/views/tabs/base_tab.cc11
-rw-r--r--chrome/browser/ui/views/tabs/tab.cc45
-rw-r--r--chrome/browser/ui/views/tabs/tab.h6
-rw-r--r--chrome/browser/ui/views/tabs/tab_drag_controller.cc22
-rw-r--r--chrome/browser/ui/views/tabs/tab_strip.cc20
-rw-r--r--chrome/browser/ui/views/theme_background.cc10
-rw-r--r--chrome/browser/ui/views/toolbar_view.cc21
-rw-r--r--chrome/browser/ui/views/toolbar_view.h6
-rw-r--r--chrome/browser/ui/webui/ntp/ntp_login_handler.cc3
-rw-r--r--chrome/browser/ui/webui/options2/browser_options_handler2.cc6
-rw-r--r--chrome/browser/ui/webui/options2/manage_profile_handler2.cc4
-rw-r--r--chrome/browser/ui/webui/task_manager/task_manager_handler.cc2
-rw-r--r--chrome/browser/ui/webui/web_ui_util.cc5
-rw-r--r--chrome/browser/ui/webui/web_ui_util.h10
91 files changed, 500 insertions, 544 deletions
diff --git a/chrome/browser/automation/automation_provider_observers.cc b/chrome/browser/automation/automation_provider_observers.cc
index df56b7d..e7a2330 100644
--- a/chrome/browser/automation/automation_provider_observers.cc
+++ b/chrome/browser/automation/automation_provider_observers.cc
@@ -79,6 +79,7 @@
#include "content/public/browser/web_contents.h"
#include "content/public/common/process_type.h"
#include "googleurl/src/gurl.h"
+#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/codec/png_codec.h"
#include "ui/gfx/rect.h"
diff --git a/chrome/browser/automation/automation_provider_observers_chromeos.cc b/chrome/browser/automation/automation_provider_observers_chromeos.cc
index 3606436..694ff05 100644
--- a/chrome/browser/automation/automation_provider_observers_chromeos.cc
+++ b/chrome/browser/automation/automation_provider_observers_chromeos.cc
@@ -489,7 +489,7 @@ void PhotoCaptureObserver::OnCapturingStopped(
chromeos::TakePhotoDialog* take_photo_dialog,
chromeos::TakePhotoView* take_photo_view) {
take_photo_dialog->Accept();
- const gfx::ImageSkia& photo = take_photo_view->GetImage();
+ const SkBitmap& photo = take_photo_view->GetImage();
chromeos::UserManager* user_manager = chromeos::UserManager::Get();
if (!user_manager) {
if (automation_) {
diff --git a/chrome/browser/background/background_application_list_model.cc b/chrome/browser/background/background_application_list_model.cc
index 3501404..6965c6b 100644
--- a/chrome/browser/background/background_application_list_model.cc
+++ b/chrome/browser/background/background_application_list_model.cc
@@ -10,9 +10,9 @@
#include "base/stl_util.h"
#include "base/utf_string_conversions.h"
#include "chrome/app/chrome_command_ids.h"
+#include "chrome/browser/background/background_mode_manager.h"
#include "chrome/browser/background/background_contents_service.h"
#include "chrome/browser/background/background_contents_service_factory.h"
-#include "chrome/browser/background/background_mode_manager.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/extensions/extension_prefs.h"
#include "chrome/browser/extensions/extension_service.h"
@@ -26,7 +26,6 @@
#include "content/public/browser/notification_source.h"
#include "ui/base/l10n/l10n_util_collator.h"
#include "ui/gfx/image/image.h"
-#include "ui/gfx/image/image_skia.h"
using extensions::Extension;
using extensions::ExtensionList;
@@ -73,7 +72,7 @@ class BackgroundApplicationListModel::Application
void RequestIcon(ExtensionIconSet::Icons size);
const Extension* extension_;
- scoped_ptr<gfx::ImageSkia> icon_;
+ scoped_ptr<SkBitmap> icon_;
BackgroundApplicationListModel* model_;
ImageLoadingTracker tracker_;
};
@@ -147,7 +146,7 @@ void BackgroundApplicationListModel::Application::OnImageLoaded(
int index) {
if (image.IsEmpty())
return;
- icon_.reset(image.CopyImageSkia());
+ icon_.reset(image.CopySkBitmap());
model_->SendApplicationDataChangedNotifications(extension_);
}
@@ -241,7 +240,7 @@ BackgroundApplicationListModel::FindApplication(
return (found == applications_.end()) ? NULL : found->second;
}
-const gfx::ImageSkia* BackgroundApplicationListModel::GetIcon(
+const SkBitmap* BackgroundApplicationListModel::GetIcon(
const Extension* extension) {
const Application* application = FindApplication(extension);
if (application)
diff --git a/chrome/browser/background/background_application_list_model.h b/chrome/browser/background/background_application_list_model.h
index f38a767..c4f6a45 100644
--- a/chrome/browser/background/background_application_list_model.h
+++ b/chrome/browser/background/background_application_list_model.h
@@ -17,10 +17,6 @@
class Profile;
-namespace gfx {
-class ImageSkia;
-}
-
// Model for list of Background Applications associated with a Profile (i.e.
// extensions with kBackgroundPermission set, or hosted apps with a
// BackgroundContents).
@@ -59,11 +55,11 @@ class BackgroundApplicationListModel : public content::NotificationObserver {
// that there is no icon associated with the extension, or that a pending
// task to retrieve the icon has not completed. See the Observer class above.
//
- // NOTE: The model manages the ImageSkia result, that is it "owns" the memory,
+ // NOTE: The model manages the SkBitmap result, that is it "owns" the memory,
// releasing it if the associated background application is unloaded.
// NOTE: All icons are currently sized as
// ExtensionIconSet::EXTENSION_ICON_BITTY.
- const gfx::ImageSkia* GetIcon(const extensions::Extension* extension);
+ const SkBitmap* GetIcon(const extensions::Extension* extension);
// Return the position of |extension| within this list model.
int GetPosition(const extensions::Extension* extension) const;
diff --git a/chrome/browser/background/background_mode_manager.cc b/chrome/browser/background/background_mode_manager.cc
index e5c5314..76d079d 100644
--- a/chrome/browser/background/background_mode_manager.cc
+++ b/chrome/browser/background/background_mode_manager.cc
@@ -117,7 +117,7 @@ void BackgroundModeManager::BackgroundModeData::BuildProfileMenu(
applications_->begin();
cursor != applications_->end();
++cursor, ++position) {
- const gfx::ImageSkia* icon = applications_->GetIcon(*cursor);
+ const SkBitmap* icon = applications_->GetIcon(*cursor);
DCHECK(position == applications_->GetPosition(*cursor));
const std::string& name = (*cursor)->name();
menu->AddItem(position, UTF8ToUTF16(name));
@@ -663,9 +663,9 @@ void BackgroundModeManager::CreateStatusTrayIcon() {
// Set the image and add ourselves as a click observer on it.
// TODO(rlp): Status tray icon should have submenus for each profile.
- gfx::ImageSkia* image_skia = ResourceBundle::GetSharedInstance().
- GetImageSkiaNamed(IDR_STATUS_TRAY_ICON);
- status_icon_->SetImage(*image_skia);
+ SkBitmap* bitmap = ResourceBundle::GetSharedInstance().GetBitmapNamed(
+ IDR_STATUS_TRAY_ICON);
+ status_icon_->SetImage(*bitmap);
status_icon_->SetToolTip(l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
UpdateStatusTrayIconContextMenu();
}
diff --git a/chrome/browser/background/background_mode_manager_win.cc b/chrome/browser/background/background_mode_manager_win.cc
index 6c4eabf..33b79e2 100644
--- a/chrome/browser/background/background_mode_manager_win.cc
+++ b/chrome/browser/background/background_mode_manager_win.cc
@@ -11,13 +11,13 @@
#include "base/utf_string_conversions.h"
#include "base/win/registry.h"
#include "chrome/browser/background/background_mode_manager.h"
-#include "chrome/common/chrome_switches.h"
#include "chrome/installer/util/auto_launch_util.h"
+#include "chrome/common/chrome_switches.h"
#include "content/public/browser/browser_thread.h"
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
+#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/gfx/image/image_skia.h"
using content::BrowserThread;
@@ -38,7 +38,7 @@ void BackgroundModeManager::DisplayAppInstalledNotification(
// a background app has been installed.
CreateStatusTrayIcon();
status_icon_->DisplayBalloon(
- gfx::ImageSkia(),
+ SkBitmap(),
l10n_util::GetStringUTF16(IDS_BACKGROUND_APP_INSTALLED_BALLOON_TITLE),
l10n_util::GetStringFUTF16(
IDS_BACKGROUND_APP_INSTALLED_BALLOON_BODY,
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 737ca17..3b48f9c 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -392,7 +392,7 @@ Profile* CreateProfile(const content::MainFunctionParams& parameters,
if (!parameters.ui_task && browser_shutdown::delete_resources_on_shutdown) {
// Only delete the resources if we're not running tests. If we're running
// tests the resources need to be reused as many places in the UI cache
- // ImageSkias from the ResourceBundle.
+ // SkBitmaps from the ResourceBundle.
ResourceBundle::CleanupSharedInstance();
}
diff --git a/chrome/browser/chromeos/login/user_manager_impl.cc b/chrome/browser/chromeos/login/user_manager_impl.cc
index c242ef5..846790c 100644
--- a/chrome/browser/chromeos/login/user_manager_impl.cc
+++ b/chrome/browser/chromeos/login/user_manager_impl.cc
@@ -53,7 +53,6 @@
#include "skia/ext/image_operations.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/codec/png_codec.h"
-#include "ui/gfx/image/image_skia.h"
using content::BrowserThread;
@@ -1283,7 +1282,7 @@ void UserManagerImpl::InitDownloadedProfileImage() {
VLOG(1) << "Profile image initialized";
downloaded_profile_image_ = logged_in_user_->image();
downloaded_profile_image_data_url_ =
- web_ui_util::GetImageDataUrl(gfx::ImageSkia(downloaded_profile_image_));
+ web_ui_util::GetImageDataUrl(downloaded_profile_image_);
}
}
@@ -1363,8 +1362,7 @@ void UserManagerImpl::OnDownloadComplete(ProfileDownloader* downloader,
if (result == kDownloadSuccess) {
// Check if this image is not the same as already downloaded.
std::string new_image_data_url =
- web_ui_util::GetImageDataUrl(gfx::ImageSkia(
- downloader->GetProfilePicture()));
+ web_ui_util::GetImageDataUrl(downloader->GetProfilePicture());
if (!downloaded_profile_image_data_url_.empty() &&
new_image_data_url == downloaded_profile_image_data_url_)
return;
diff --git a/chrome/browser/custom_home_pages_table_model.h b/chrome/browser/custom_home_pages_table_model.h
index 0e43f69..3af68d3 100644
--- a/chrome/browser/custom_home_pages_table_model.h
+++ b/chrome/browser/custom_home_pages_table_model.h
@@ -15,6 +15,7 @@
class GURL;
class Profile;
+class SkBitmap;
namespace ui {
class TableModelObserver;
diff --git a/chrome/browser/download/download_extension_api.cc b/chrome/browser/download/download_extension_api.cc
index de5a5657..a89332d 100644
--- a/chrome/browser/download/download_extension_api.cc
+++ b/chrome/browser/download/download_extension_api.cc
@@ -249,7 +249,7 @@ void DownloadFileIconExtractorImpl::OnIconLoadComplete(
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
std::string url;
if (icon)
- url = web_ui_util::GetImageDataUrl(*icon->ToImageSkia());
+ url = web_ui_util::GetImageDataUrl(*icon->ToSkBitmap());
callback_.Run(url);
}
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc
index 1119df0..4d2e3ca 100644
--- a/chrome/browser/download/download_util.cc
+++ b/chrome/browser/download/download_util.cc
@@ -183,13 +183,13 @@ void GenerateFileNameFromRequest(const DownloadItem& download_item,
// Download progress painting --------------------------------------------------
-// Common images used for download progress animations. We load them once the
+// Common bitmaps used for download progress animations. We load them once the
// first time we do a progress paint, then reuse them as they are always the
// same.
-gfx::ImageSkia* g_foreground_16 = NULL;
-gfx::ImageSkia* g_background_16 = NULL;
-gfx::ImageSkia* g_foreground_32 = NULL;
-gfx::ImageSkia* g_background_32 = NULL;
+SkBitmap* g_foreground_16 = NULL;
+SkBitmap* g_background_16 = NULL;
+SkBitmap* g_foreground_32 = NULL;
+SkBitmap* g_background_32 = NULL;
void PaintDownloadProgress(gfx::Canvas* canvas,
#if defined(TOOLKIT_VIEWS)
@@ -200,24 +200,22 @@ void PaintDownloadProgress(gfx::Canvas* canvas,
int start_angle,
int percent_done,
PaintDownloadProgressSize size) {
- // Load up our common images
+ // Load up our common bitmaps
if (!g_background_16) {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- g_foreground_16 = rb.GetImageSkiaNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_16);
- g_background_16 = rb.GetImageSkiaNamed(IDR_DOWNLOAD_PROGRESS_BACKGROUND_16);
- g_foreground_32 = rb.GetImageSkiaNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_32);
- g_background_32 = rb.GetImageSkiaNamed(IDR_DOWNLOAD_PROGRESS_BACKGROUND_32);
+ g_foreground_16 = rb.GetBitmapNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_16);
+ g_background_16 = rb.GetBitmapNamed(IDR_DOWNLOAD_PROGRESS_BACKGROUND_16);
+ g_foreground_32 = rb.GetBitmapNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_32);
+ g_background_32 = rb.GetBitmapNamed(IDR_DOWNLOAD_PROGRESS_BACKGROUND_32);
}
- gfx::ImageSkia* background =
- (size == BIG) ? g_background_32 : g_background_16;
- gfx::ImageSkia* foreground =
- (size == BIG) ? g_foreground_32 : g_foreground_16;
+ SkBitmap* background = (size == BIG) ? g_background_32 : g_background_16;
+ SkBitmap* foreground = (size == BIG) ? g_foreground_32 : g_foreground_16;
const int kProgressIconSize = (size == BIG) ? kBigProgressIconSize :
kSmallProgressIconSize;
- // We start by storing the bounds of the background and foreground images
+ // We start by storing the bounds of the background and foreground bitmaps
// so that it is easy to mirror the bounds if the UI layout is RTL.
gfx::Rect background_bounds(origin_x, origin_y,
background->width(), background->height());
@@ -300,14 +298,14 @@ void PaintDownloadComplete(gfx::Canvas* canvas,
int origin_y,
double animation_progress,
PaintDownloadProgressSize size) {
- // Load up our common images.
+ // Load up our common bitmaps.
if (!g_foreground_16) {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- g_foreground_16 = rb.GetImageSkiaNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_16);
- g_foreground_32 = rb.GetImageSkiaNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_32);
+ g_foreground_16 = rb.GetBitmapNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_16);
+ g_foreground_32 = rb.GetBitmapNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_32);
}
- gfx::ImageSkia* complete = (size == BIG) ? g_foreground_32 : g_foreground_16;
+ SkBitmap* complete = (size == BIG) ? g_foreground_32 : g_foreground_16;
gfx::Rect complete_bounds(origin_x, origin_y,
complete->width(), complete->height());
@@ -332,14 +330,14 @@ void PaintDownloadInterrupted(gfx::Canvas* canvas,
int origin_y,
double animation_progress,
PaintDownloadProgressSize size) {
- // Load up our common images.
+ // Load up our common bitmaps.
if (!g_foreground_16) {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- g_foreground_16 = rb.GetImageSkiaNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_16);
- g_foreground_32 = rb.GetImageSkiaNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_32);
+ g_foreground_16 = rb.GetBitmapNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_16);
+ g_foreground_32 = rb.GetBitmapNamed(IDR_DOWNLOAD_PROGRESS_FOREGROUND_32);
}
- gfx::ImageSkia* complete = (size == BIG) ? g_foreground_32 : g_foreground_16;
+ SkBitmap* complete = (size == BIG) ? g_foreground_32 : g_foreground_16;
gfx::Rect complete_bounds(origin_x, origin_y,
complete->width(), complete->height());
diff --git a/chrome/browser/download/download_util.h b/chrome/browser/download/download_util.h
index 11215e6..8bd4f21 100644
--- a/chrome/browser/download/download_util.h
+++ b/chrome/browser/download/download_util.h
@@ -78,7 +78,7 @@ int GetBigProgressIconSize();
const int kSmallProgressIconSize = 39;
const int kBigProgressIconSize = 52;
-// The offset required to center the icon in the progress images.
+// The offset required to center the icon in the progress bitmaps.
int GetBigProgressIconOffset();
const int kSmallProgressIconOffset =
diff --git a/chrome/browser/extensions/extension_function_dispatcher.cc b/chrome/browser/extensions/extension_function_dispatcher.cc
index 39896f5..3bde203 100644
--- a/chrome/browser/extensions/extension_function_dispatcher.cc
+++ b/chrome/browser/extensions/extension_function_dispatcher.cc
@@ -31,6 +31,7 @@
#include "ipc/ipc_message.h"
#include "ipc/ipc_message_macros.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebSecurityOrigin.h"
+#include "third_party/skia/include/core/SkBitmap.h"
#include "webkit/glue/resource_type.h"
using extensions::Extension;
diff --git a/chrome/browser/extensions/extension_install_dialog.cc b/chrome/browser/extensions/extension_install_dialog.cc
index b404e53..46c98cb 100644
--- a/chrome/browser/extensions/extension_install_dialog.cc
+++ b/chrome/browser/extensions/extension_install_dialog.cc
@@ -7,12 +7,13 @@
#include "base/bind.h"
#include "base/command_line.h"
#include "base/file_path.h"
-#include "base/memory/scoped_ptr.h"
#include "base/message_loop.h"
+#include "base/memory/scoped_ptr.h"
#include "base/values.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_manifest_constants.h"
+#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/image/image.h"
namespace {
diff --git a/chrome/browser/extensions/extension_install_dialog.h b/chrome/browser/extensions/extension_install_dialog.h
index 7f3439e..9aabe0c 100644
--- a/chrome/browser/extensions/extension_install_dialog.h
+++ b/chrome/browser/extensions/extension_install_dialog.h
@@ -13,6 +13,7 @@
#include "chrome/browser/extensions/extension_install_ui.h"
class Profile;
+class SkBitmap;
namespace base {
class DictionaryValue;
diff --git a/chrome/browser/extensions/extension_install_ui.cc b/chrome/browser/extensions/extension_install_ui.cc
index a67c563..eddb98e 100644
--- a/chrome/browser/extensions/extension_install_ui.cc
+++ b/chrome/browser/extensions/extension_install_ui.cc
@@ -184,14 +184,14 @@ void ExtensionInstallUI::Prompt::AppendRatingStars(
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
int i;
for (i = 0; i < rating_integer; i++) {
- appender(rb.GetImageSkiaNamed(IDR_EXTENSIONS_RATING_STAR_ON), data);
+ appender(rb.GetBitmapNamed(IDR_EXTENSIONS_RATING_STAR_ON), data);
}
if (rating_fractional) {
- appender(rb.GetImageSkiaNamed(IDR_EXTENSIONS_RATING_STAR_HALF_LEFT), data);
+ appender(rb.GetBitmapNamed(IDR_EXTENSIONS_RATING_STAR_HALF_LEFT), data);
i++;
}
for (; i < kMaxExtensionRating; i++) {
- appender(rb.GetImageSkiaNamed(IDR_EXTENSIONS_RATING_STAR_OFF), data);
+ appender(rb.GetBitmapNamed(IDR_EXTENSIONS_RATING_STAR_OFF), data);
}
}
diff --git a/chrome/browser/extensions/extension_install_ui.h b/chrome/browser/extensions/extension_install_ui.h
index 1f46eec..58525e1 100644
--- a/chrome/browser/extensions/extension_install_ui.h
+++ b/chrome/browser/extensions/extension_install_ui.h
@@ -15,7 +15,6 @@
#include "chrome/common/extensions/url_pattern.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/image/image.h"
-#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/native_widget_types.h"
class Browser;
@@ -81,7 +80,7 @@ class ExtensionInstallUI : public ImageLoadingTracker::Observer {
// components.ratingutils.setFractionalYellowStars). Callers pass in an
// "appender", which will be repeatedly called back with the star images
// that they append to the star display area.
- typedef void(*StarAppender)(const gfx::ImageSkia*, void*);
+ typedef void(*StarAppender)(const SkBitmap*, void*);
void AppendRatingStars(StarAppender appender, void* data) const;
string16 GetRatingCount() const;
string16 GetUserCount() const;
diff --git a/chrome/browser/extensions/extension_uninstall_dialog.cc b/chrome/browser/extensions/extension_uninstall_dialog.cc
index 935ff92..13c718e 100644
--- a/chrome/browser/extensions/extension_uninstall_dialog.cc
+++ b/chrome/browser/extensions/extension_uninstall_dialog.cc
@@ -46,14 +46,14 @@ void ExtensionUninstallDialog::ConfirmUninstall(
void ExtensionUninstallDialog::SetIcon(const gfx::Image& image) {
if (image.IsEmpty()) {
if (extension_->is_app()) {
- icon_ = *ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
+ icon_ = *ResourceBundle::GetSharedInstance().GetBitmapNamed(
IDR_APP_DEFAULT_ICON);
} else {
- icon_ = *ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
+ icon_ = *ResourceBundle::GetSharedInstance().GetBitmapNamed(
IDR_EXTENSION_DEFAULT_ICON);
}
} else {
- icon_ = *image.ToImageSkia();
+ icon_ = *image.ToSkBitmap();
}
}
diff --git a/chrome/browser/extensions/extension_uninstall_dialog.h b/chrome/browser/extensions/extension_uninstall_dialog.h
index 6d465c8..83b4ab1 100644
--- a/chrome/browser/extensions/extension_uninstall_dialog.h
+++ b/chrome/browser/extensions/extension_uninstall_dialog.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -7,10 +7,10 @@
#pragma once
#include "base/basictypes.h"
-#include "base/compiler_specific.h"
#include "base/memory/weak_ptr.h"
+#include "base/compiler_specific.h"
#include "chrome/browser/extensions/image_loading_tracker.h"
-#include "ui/gfx/image/image_skia.h"
+#include "third_party/skia/include/core/SkBitmap.h"
class MessageLoop;
class Profile;
@@ -60,11 +60,11 @@ class ExtensionUninstallDialog
const extensions::Extension* extension_;
// The extensions icon.
- gfx::ImageSkia icon_;
+ SkBitmap icon_;
private:
// Sets the icon that will be used in the dialog. If |icon| contains an empty
- // image, then we use a default icon instead.
+ // bitmap, then we use a default icon instead.
void SetIcon(const gfx::Image& image);
// ImageLoadingTracker::Observer:
diff --git a/chrome/browser/media/media_stream_capture_indicator.cc b/chrome/browser/media/media_stream_capture_indicator.cc
index 55f6751..e3e8ad0 100644
--- a/chrome/browser/media/media_stream_capture_indicator.cc
+++ b/chrome/browser/media/media_stream_capture_indicator.cc
@@ -159,11 +159,11 @@ void MediaStreamCaptureIndicator::CreateStatusTray() {
void MediaStreamCaptureIndicator::EnsureStatusTrayIcon() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (tray_image_.empty()) {
- tray_image_ = *ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
+ tray_image_ = *ResourceBundle::GetSharedInstance().GetBitmapNamed(
IDR_MEDIA_STREAM_CAPTURE_LED);
}
if (balloon_image_.empty()) {
- balloon_image_ = *ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
+ balloon_image_ = *ResourceBundle::GetSharedInstance().GetBitmapNamed(
IDR_PRODUCT_LOGO_32);
}
}
diff --git a/chrome/browser/media/media_stream_capture_indicator.h b/chrome/browser/media/media_stream_capture_indicator.h
index 588707a..88efcda 100644
--- a/chrome/browser/media/media_stream_capture_indicator.h
+++ b/chrome/browser/media/media_stream_capture_indicator.h
@@ -6,13 +6,13 @@
#define CHROME_BROWSER_MEDIA_MEDIA_STREAM_CAPTURE_INDICATOR_H_
#pragma once
-#include <string>
#include <vector>
+#include <string>
#include "base/memory/ref_counted.h"
#include "content/public/common/media_stream_request.h"
+#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/models/simple_menu_model.h"
-#include "ui/gfx/image/image_skia.h"
class StatusIcon;
class StatusTray;
@@ -130,9 +130,9 @@ class MediaStreamCaptureIndicator
StatusIcon* status_icon_;
// Icon to be displayed on the status tray.
- gfx::ImageSkia tray_image_;
+ SkBitmap tray_image_;
- gfx::ImageSkia balloon_image_;
+ SkBitmap balloon_image_;
// A list that contains the usage information of the opened capture devices.
typedef std::vector<CaptureDeviceTab> CaptureDeviceTabs;
diff --git a/chrome/browser/ntp_background_util.cc b/chrome/browser/ntp_background_util.cc
index ddd975e..297a0f0 100644
--- a/chrome/browser/ntp_background_util.cc
+++ b/chrome/browser/ntp_background_util.cc
@@ -9,16 +9,16 @@
#include "base/logging.h"
#include "chrome/browser/themes/theme_service.h"
#include "grit/theme_resources.h"
+#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/canvas.h"
-#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/skia_util.h"
namespace {
void PaintThemeBackground(
- gfx::Canvas* canvas, gfx::ImageSkia* ntp_background, int tiling,
- int alignment, const gfx::Rect& area, int tab_contents_height) {
+ gfx::Canvas* canvas, SkBitmap* ntp_background, int tiling, int alignment,
+ const gfx::Rect& area, int tab_contents_height) {
int x_pos = 0;
int y_pos = 0;
int width = area.width() + ntp_background->width();
@@ -78,8 +78,7 @@ void NtpBackgroundUtil::PaintBackgroundDetachedMode(ui::ThemeProvider* tp,
int alignment;
if (tp->GetDisplayProperty(ThemeService::NTP_BACKGROUND_ALIGNMENT,
&alignment)) {
- gfx::ImageSkia* ntp_background =
- tp->GetImageSkiaNamed(IDR_THEME_NTP_BACKGROUND);
+ SkBitmap* ntp_background = tp->GetBitmapNamed(IDR_THEME_NTP_BACKGROUND);
PaintThemeBackground(
canvas, ntp_background, tiling, alignment, area, tab_contents_height);
diff --git a/chrome/browser/speech/speech_recognition_bubble.cc b/chrome/browser/speech/speech_recognition_bubble.cc
index a9aafba..98c3fe1 100644
--- a/chrome/browser/speech/speech_recognition_bubble.cc
+++ b/chrome/browser/speech/speech_recognition_bubble.cc
@@ -29,10 +29,10 @@ class SpeechRecognitionBubbleImages {
public:
const std::vector<SkBitmap>& spinner() { return spinner_; }
const std::vector<SkBitmap>& warm_up() { return warm_up_; }
- gfx::ImageSkia* mic_full() { return mic_full_; }
- gfx::ImageSkia* mic_empty() { return mic_empty_; }
- gfx::ImageSkia* mic_noise() { return mic_noise_; }
- gfx::ImageSkia* mic_mask() { return mic_mask_; }
+ SkBitmap* mic_full() { return mic_full_; }
+ SkBitmap* mic_empty() { return mic_empty_; }
+ SkBitmap* mic_noise() { return mic_noise_; }
+ SkBitmap* mic_mask() { return mic_mask_; }
private:
// Private constructor to enforce singleton.
@@ -42,28 +42,28 @@ class SpeechRecognitionBubbleImages {
std::vector<SkBitmap> spinner_; // Frames for the progress spinner.
std::vector<SkBitmap> warm_up_; // Frames for the warm up animation.
- // These images are owned by ResourceBundle and need not be destroyed.
- gfx::ImageSkia* mic_full_; // Mic image with full volume.
- gfx::ImageSkia* mic_noise_; // Mic image with full noise volume.
- gfx::ImageSkia* mic_empty_; // Mic image with zero volume.
- gfx::ImageSkia* mic_mask_; // Gradient mask used by the volume indicator.
+ // These bitmaps are owned by ResourceBundle and need not be destroyed.
+ SkBitmap* mic_full_; // Mic image with full volume.
+ SkBitmap* mic_noise_; // Mic image with full noise volume.
+ SkBitmap* mic_empty_; // Mic image with zero volume.
+ SkBitmap* mic_mask_; // Gradient mask used by the volume indicator.
};
SpeechRecognitionBubbleImages::SpeechRecognitionBubbleImages() {
- mic_empty_ = ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
+ mic_empty_ = ResourceBundle::GetSharedInstance().GetBitmapNamed(
IDR_SPEECH_INPUT_MIC_EMPTY);
- mic_noise_ = ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
+ mic_noise_ = ResourceBundle::GetSharedInstance().GetBitmapNamed(
IDR_SPEECH_INPUT_MIC_NOISE);
- mic_full_ = ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
+ mic_full_ = ResourceBundle::GetSharedInstance().GetBitmapNamed(
IDR_SPEECH_INPUT_MIC_FULL);
- mic_mask_ = ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
+ mic_mask_ = ResourceBundle::GetSharedInstance().GetBitmapNamed(
IDR_SPEECH_INPUT_MIC_MASK);
// The sprite image consists of all the animation frames put together in one
// horizontal/wide image. Each animation frame is square in shape within the
// sprite.
- const SkBitmap* spinner_image = ResourceBundle::GetSharedInstance().
- GetImageSkiaNamed(IDR_SPEECH_INPUT_SPINNER)->bitmap();
+ SkBitmap* spinner_image = ResourceBundle::GetSharedInstance().GetBitmapNamed(
+ IDR_SPEECH_INPUT_SPINNER);
int frame_size = spinner_image->height();
// When recording starts up, it may take a short while (few ms or even a
@@ -85,11 +85,11 @@ SpeechRecognitionBubbleImages::SpeechRecognitionBubbleImages() {
SkBitmap frame;
spinner_image->extractSubset(&frame, src_rect);
- // The image created by extractSubset just points to the same pixels as
+ // The bitmap created by extractSubset just points to the same pixels as
// the original and adjusts rowBytes accordingly. However that doesn't
// render properly and gets vertically squished in Linux due to a bug in
// Skia. Until that gets fixed we work around by taking a real copy of it
- // below as the copied image has the correct rowBytes and renders fine.
+ // below as the copied bitmap has the correct rowBytes and renders fine.
SkBitmap frame_copy;
frame.copyTo(&frame_copy, SkBitmap::kARGB_8888_Config);
spinner_.push_back(frame_copy);
@@ -199,7 +199,7 @@ void SpeechRecognitionBubbleBase::SetMessage(const string16& text) {
}
void SpeechRecognitionBubbleBase::DrawVolumeOverlay(SkCanvas* canvas,
- const gfx::ImageSkia& image,
+ const SkBitmap& bitmap,
float volume) {
buffer_image_->eraseARGB(0, 0, 0, 0);
@@ -213,7 +213,7 @@ void SpeechRecognitionBubbleBase::DrawVolumeOverlay(SkCanvas* canvas,
(((1.0f - volume) * (width * (kVolumeSteps + 1))) - width) / kVolumeSteps;
buffer_canvas.clipRect(SkRect::MakeLTRB(0, 0,
SkIntToScalar(width) - clip_right, SkIntToScalar(height)));
- buffer_canvas.drawBitmap(image, 0, 0);
+ buffer_canvas.drawBitmap(bitmap, 0, 0);
buffer_canvas.restore();
SkPaint multiply_paint;
multiply_paint.setXfermode(SkXfermode::Create(SkXfermode::kMultiply_Mode));
@@ -241,11 +241,11 @@ WebContents* SpeechRecognitionBubbleBase::GetWebContents() {
return web_contents_;
}
-void SpeechRecognitionBubbleBase::SetImage(const gfx::ImageSkia& image) {
- icon_image_.reset(new gfx::ImageSkia(image));
+void SpeechRecognitionBubbleBase::SetImage(const SkBitmap& image) {
+ icon_image_.reset(new SkBitmap(image));
UpdateImage();
}
-gfx::ImageSkia SpeechRecognitionBubbleBase::icon_image() {
- return (icon_image_ != NULL) ? *icon_image_ : gfx::ImageSkia();
+SkBitmap SpeechRecognitionBubbleBase::icon_image() {
+ return (icon_image_ != NULL) ? *icon_image_ : SkBitmap();
}
diff --git a/chrome/browser/speech/speech_recognition_bubble.h b/chrome/browser/speech/speech_recognition_bubble.h
index ecb784b..2844122 100644
--- a/chrome/browser/speech/speech_recognition_bubble.h
+++ b/chrome/browser/speech/speech_recognition_bubble.h
@@ -21,7 +21,6 @@ class WebContents;
namespace gfx {
class Canvas;
-class ImageSkia;
class Rect;
}
@@ -157,22 +156,22 @@ class SpeechRecognitionBubbleBase : public SpeechRecognitionBubble {
const string16& message_text() const { return message_text_; }
- gfx::ImageSkia icon_image();
+ SkBitmap icon_image();
private:
void DoRecognizingAnimationStep();
void DoWarmingUpAnimationStep();
- void SetImage(const gfx::ImageSkia& image);
+ void SetImage(const SkBitmap& image);
void DrawVolumeOverlay(SkCanvas* canvas,
- const gfx::ImageSkia& image_skia,
+ const SkBitmap& bitmap,
float volume);
// Task factory used for animation timer.
base::WeakPtrFactory<SpeechRecognitionBubbleBase> weak_factory_;
int animation_step_; // Current index/step of the animation.
- std::vector<gfx::ImageSkia> animation_frames_;
- std::vector<gfx::ImageSkia> warming_up_frames_;
+ std::vector<SkBitmap> animation_frames_;
+ std::vector<SkBitmap> warming_up_frames_;
DisplayMode display_mode_;
string16 message_text_; // Text displayed in DISPLAY_MODE_MESSAGE
@@ -183,7 +182,7 @@ class SpeechRecognitionBubbleBase : public SpeechRecognitionBubble {
// WebContents in which this this bubble gets displayed.
content::WebContents* web_contents_;
// The current image displayed in the bubble's icon widget.
- scoped_ptr<gfx::ImageSkia> icon_image_;
+ scoped_ptr<SkBitmap> icon_image_;
};
// This typedef is to workaround the issue with certain versions of
diff --git a/chrome/browser/speech/speech_recognition_bubble_controller_unittest.cc b/chrome/browser/speech/speech_recognition_bubble_controller_unittest.cc
index e2f1dd9..f72d123 100644
--- a/chrome/browser/speech/speech_recognition_bubble_controller_unittest.cc
+++ b/chrome/browser/speech/speech_recognition_bubble_controller_unittest.cc
@@ -16,6 +16,8 @@
using content::BrowserThread;
using content::WebContents;
+class SkBitmap;
+
namespace speech {
// A mock bubble class which fakes a focus change or recognition cancel by the
diff --git a/chrome/browser/speech/speech_recognition_tray_icon_controller.cc b/chrome/browser/speech/speech_recognition_tray_icon_controller.cc
index 47dcce7..35e8856 100644
--- a/chrome/browser/speech/speech_recognition_tray_icon_controller.cc
+++ b/chrome/browser/speech/speech_recognition_tray_icon_controller.cc
@@ -33,28 +33,27 @@ const int kVolumeSteps = 6;
// notification icon and safely destroy them on exit.
class NotificationTrayImages {
public:
- gfx::ImageSkia* mic_full() { return mic_full_; }
- gfx::ImageSkia* mic_empty() { return mic_empty_; }
- gfx::ImageSkia* balloon_icon() { return balloon_icon_; }
+ SkBitmap* mic_full() { return mic_full_; }
+ SkBitmap* mic_empty() { return mic_empty_; }
+ SkBitmap* balloon_icon() { return balloon_icon_; }
private:
// Private constructor to enforce singleton.
friend struct base::DefaultLazyInstanceTraits<NotificationTrayImages>;
NotificationTrayImages();
- // These images are owned by ResourceBundle and need not be destroyed.
- gfx::ImageSkia* mic_full_; // Tray mic image with full volume.
- gfx::ImageSkia* mic_empty_; // Tray mic image with zero volume.
- // High resolution mic for the notification balloon.
- gfx::ImageSkia* balloon_icon_;
+ // These bitmaps are owned by ResourceBundle and need not be destroyed.
+ SkBitmap* mic_full_; // Tray mic image with full volume.
+ SkBitmap* mic_empty_; // Tray mic image with zero volume.
+ SkBitmap* balloon_icon_; // High resolution mic for the notification balloon.
};
NotificationTrayImages::NotificationTrayImages() {
- mic_empty_ = ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
+ mic_empty_ = ResourceBundle::GetSharedInstance().GetBitmapNamed(
IDR_SPEECH_INPUT_TRAY_MIC_EMPTY);
- mic_full_ = ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
+ mic_full_ = ResourceBundle::GetSharedInstance().GetBitmapNamed(
IDR_SPEECH_INPUT_TRAY_MIC_FULL);
- balloon_icon_ = ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
+ balloon_icon_ = ResourceBundle::GetSharedInstance().GetBitmapNamed(
IDR_SPEECH_INPUT_TRAY_BALLOON_ICON);
}
@@ -166,7 +165,7 @@ void SpeechRecognitionTrayIconController::Initialize() {
void SpeechRecognitionTrayIconController::DrawVolume(
SkCanvas* canvas,
- const gfx::ImageSkia& image,
+ const SkBitmap& bitmap,
float volume) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
buffer_image_->eraseARGB(0, 0, 0, 0);
@@ -180,7 +179,7 @@ void SpeechRecognitionTrayIconController::DrawVolume(
kVolumeSteps;
buffer_canvas.clipRect(SkRect::MakeLTRB(0, clip_top,
SkIntToScalar(width), SkIntToScalar(height)));
- buffer_canvas.drawBitmap(image, 0, 0);
+ buffer_canvas.drawBitmap(bitmap, 0, 0);
canvas->drawBitmap(*buffer_image_.get(), 0, 0);
}
diff --git a/chrome/browser/speech/speech_recognition_tray_icon_controller.h b/chrome/browser/speech/speech_recognition_tray_icon_controller.h
index a73d981..f17ef0b 100644
--- a/chrome/browser/speech/speech_recognition_tray_icon_controller.h
+++ b/chrome/browser/speech/speech_recognition_tray_icon_controller.h
@@ -15,10 +15,6 @@ class SkBitmap;
class SkCanvas;
class StatusIcon;
-namespace gfx {
-class ImageSkia;
-}
-
// Manages the tray icon for speech recognition.
class SpeechRecognitionTrayIconController
: public base::RefCountedThreadSafe<SpeechRecognitionTrayIconController> {
@@ -34,7 +30,7 @@ class SpeechRecognitionTrayIconController
virtual ~SpeechRecognitionTrayIconController();
void Initialize();
- void DrawVolume(SkCanvas* canvas, const gfx::ImageSkia& image, float volume);
+ void DrawVolume(SkCanvas* canvas, const SkBitmap& bitmap, float volume);
void ShowNotificationBalloon(const string16& text);
scoped_ptr<SkBitmap> mic_image_;
diff --git a/chrome/browser/status_icons/desktop_notification_balloon.cc b/chrome/browser/status_icons/desktop_notification_balloon.cc
index 70d46ee..a3fc825 100644
--- a/chrome/browser/status_icons/desktop_notification_balloon.cc
+++ b/chrome/browser/status_icons/desktop_notification_balloon.cc
@@ -15,7 +15,6 @@
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/webui/web_ui_util.h"
#include "third_party/skia/include/core/SkBitmap.h"
-#include "ui/gfx/image/image_skia.h"
namespace {
@@ -73,7 +72,7 @@ void DesktopNotificationBalloon::DisplayBalloon(const SkBitmap& icon,
const string16& contents) {
GURL icon_url;
if (!icon.empty())
- icon_url = GURL(web_ui_util::GetImageDataUrl(gfx::ImageSkia(icon)));
+ icon_url = GURL(web_ui_util::GetImageDataUrl(icon));
GURL content_url(DesktopNotificationService::CreateDataUrl(
icon_url, title, contents, WebKit::WebTextDirectionDefault));
diff --git a/chrome/browser/task_manager/task_manager.cc b/chrome/browser/task_manager/task_manager.cc
index d916567..6d021c4 100644
--- a/chrome/browser/task_manager/task_manager.cc
+++ b/chrome/browser/task_manager/task_manager.cc
@@ -39,10 +39,10 @@
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "grit/ui_resources.h"
+#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/text/bytes_formatting.h"
-#include "ui/gfx/image/image_skia.h"
#include "unicode/coll.h"
using content::BrowserThread;
@@ -306,14 +306,14 @@ bool TaskManagerModel::IsBackgroundResource(int index) const {
return resources_[index]->IsBackground();
}
-gfx::ImageSkia TaskManagerModel::GetResourceIcon(int index) const {
+SkBitmap TaskManagerModel::GetResourceIcon(int index) const {
CHECK_LT(index, ResourceCount());
- gfx::ImageSkia icon = resources_[index]->GetIcon();
+ SkBitmap icon = resources_[index]->GetIcon();
if (!icon.isNull())
return icon;
- static gfx::ImageSkia* default_icon = ResourceBundle::GetSharedInstance().
- GetImageSkiaNamed(IDR_DEFAULT_FAVICON);
+ static SkBitmap* default_icon = ResourceBundle::GetSharedInstance().
+ GetBitmapNamed(IDR_DEFAULT_FAVICON);
return *default_icon;
}
diff --git a/chrome/browser/task_manager/task_manager.h b/chrome/browser/task_manager/task_manager.h
index b7cd68a..d118ba8 100644
--- a/chrome/browser/task_manager/task_manager.h
+++ b/chrome/browser/task_manager/task_manager.h
@@ -21,6 +21,7 @@
#include "chrome/browser/renderer_host/web_cache_manager.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebCache.h"
+class SkBitmap;
class TabContents;
typedef TabContents TabContentsWrapper;
class TaskManagerModel;
@@ -33,10 +34,6 @@ namespace extensions {
class Extension;
}
-namespace gfx {
-class ImageSkia;
-}
-
namespace net {
class URLRequest;
}
@@ -74,7 +71,7 @@ class TaskManager {
virtual string16 GetTitle() const = 0;
virtual string16 GetProfileName() const = 0;
- virtual gfx::ImageSkia GetIcon() const = 0;
+ virtual SkBitmap GetIcon() const = 0;
virtual base::ProcessHandle GetProcess() const = 0;
virtual int GetUniqueChildProcessId() const = 0;
virtual Type GetType() const = 0;
@@ -375,7 +372,7 @@ class TaskManagerModel : public base::RefCountedThreadSafe<TaskManagerModel> {
bool IsBackgroundResource(int index) const;
// Returns icon to be used for resource (for example a favicon).
- gfx::ImageSkia GetResourceIcon(int index) const;
+ SkBitmap GetResourceIcon(int index) const;
// Returns the group range of resource.
GroupRange GetGroupRangeForResource(int index) const;
diff --git a/chrome/browser/task_manager/task_manager_notification_resource_provider.cc b/chrome/browser/task_manager/task_manager_notification_resource_provider.cc
index 22783fe..8b0f11f 100644
--- a/chrome/browser/task_manager/task_manager_notification_resource_provider.cc
+++ b/chrome/browser/task_manager/task_manager_notification_resource_provider.cc
@@ -8,9 +8,9 @@
#include "base/stl_util.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/debugger/devtools_window.h"
-#include "chrome/browser/notifications/balloon.h"
#include "chrome/browser/notifications/balloon_collection.h"
#include "chrome/browser/notifications/balloon_host.h"
+#include "chrome/browser/notifications/balloon.h"
#include "chrome/browser/notifications/notification_ui_manager.h"
#include "chrome/common/chrome_notification_types.h"
#include "content/public/browser/notification_service.h"
@@ -20,22 +20,22 @@
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "grit/theme_resources_standard.h"
+#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
-#include "ui/gfx/image/image_skia.h"
////////////////////////////////////////////////////////////////////////////////
// TaskManagerNotificationResource class
////////////////////////////////////////////////////////////////////////////////
-gfx::ImageSkia* TaskManagerNotificationResource::default_icon_ = NULL;
+SkBitmap* TaskManagerNotificationResource::default_icon_ = NULL;
TaskManagerNotificationResource::TaskManagerNotificationResource(
BalloonHost* balloon_host)
: balloon_host_(balloon_host) {
if (!default_icon_) {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- default_icon_ = rb.GetImageSkiaNamed(IDR_PLUGIN);
+ default_icon_ = rb.GetBitmapNamed(IDR_PLUGIN);
}
process_handle_ =
balloon_host_->web_contents()->GetRenderProcessHost()->GetHandle();
@@ -57,7 +57,7 @@ string16 TaskManagerNotificationResource::GetProfileName() const {
return string16();
}
-gfx::ImageSkia TaskManagerNotificationResource::GetIcon() const {
+SkBitmap TaskManagerNotificationResource::GetIcon() const {
return *default_icon_;
}
diff --git a/chrome/browser/task_manager/task_manager_resource_providers.cc b/chrome/browser/task_manager/task_manager_resource_providers.cc
index f89b32a..b5358c3 100644
--- a/chrome/browser/task_manager/task_manager_resource_providers.cc
+++ b/chrome/browser/task_manager/task_manager_resource_providers.cc
@@ -10,7 +10,6 @@
#include "base/bind.h"
#include "base/file_version_info.h"
#include "base/i18n/rtl.h"
-#include "base/memory/scoped_ptr.h"
#include "base/process_util.h"
#include "base/stl_util.h"
#include "base/string_util.h"
@@ -59,7 +58,6 @@
#include "third_party/sqlite/sqlite3.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
-#include "ui/gfx/image/image_skia.h"
#include "v8/include/v8.h"
#if defined(OS_MACOSX)
@@ -224,7 +222,7 @@ bool TaskManagerRendererResource::SupportNetworkUsage() const {
////////////////////////////////////////////////////////////////////////////////
// static
-gfx::ImageSkia* TaskManagerTabContentsResource::prerender_icon_ = NULL;
+SkBitmap* TaskManagerTabContentsResource::prerender_icon_ = NULL;
TaskManagerTabContentsResource::TaskManagerTabContentsResource(
TabContentsWrapper* tab_contents)
@@ -235,7 +233,7 @@ TaskManagerTabContentsResource::TaskManagerTabContentsResource(
is_instant_preview_(false) {
if (!prerender_icon_) {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- prerender_icon_ = rb.GetImageSkiaNamed(IDR_PRERENDER);
+ prerender_icon_ = rb.GetBitmapNamed(IDR_PRERENDER);
}
for (BrowserList::const_iterator i = BrowserList::begin();
i != BrowserList::end(); ++i) {
@@ -324,7 +322,7 @@ string16 TaskManagerTabContentsResource::GetProfileName() const {
return cache.GetNameOfProfileAtIndex(index);
}
-gfx::ImageSkia TaskManagerTabContentsResource::GetIcon() const {
+SkBitmap TaskManagerTabContentsResource::GetIcon() const {
if (IsPrerendering())
return *prerender_icon_;
return tab_contents_->favicon_tab_helper()->GetFavicon();
@@ -530,7 +528,7 @@ void TaskManagerTabContentsResourceProvider::Observe(int type,
// TaskManagerBackgroundContentsResource class
////////////////////////////////////////////////////////////////////////////////
-gfx::ImageSkia* TaskManagerBackgroundContentsResource::default_icon_ = NULL;
+SkBitmap* TaskManagerBackgroundContentsResource::default_icon_ = NULL;
// TODO(atwilson): http://crbug.com/116893
// HACK: if the process handle is invalid, we use the current process's handle.
@@ -551,7 +549,7 @@ TaskManagerBackgroundContentsResource::TaskManagerBackgroundContentsResource(
// TODO(atwilson): Use the favicon when that's available.
if (!default_icon_) {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- default_icon_ = rb.GetImageSkiaNamed(IDR_PLUGIN);
+ default_icon_ = rb.GetBitmapNamed(IDR_PLUGIN);
}
// Ensure that the string has the appropriate direction markers (see comment
// in TaskManagerTabContentsResource::GetTitle()).
@@ -578,7 +576,7 @@ string16 TaskManagerBackgroundContentsResource::GetProfileName() const {
return string16();
}
-gfx::ImageSkia TaskManagerBackgroundContentsResource::GetIcon() const {
+SkBitmap TaskManagerBackgroundContentsResource::GetIcon() const {
return *default_icon_;
}
@@ -787,7 +785,7 @@ void TaskManagerBackgroundContentsResourceProvider::Observe(
////////////////////////////////////////////////////////////////////////////////
// TaskManagerChildProcessResource class
////////////////////////////////////////////////////////////////////////////////
-gfx::ImageSkia* TaskManagerChildProcessResource::default_icon_ = NULL;
+SkBitmap* TaskManagerChildProcessResource::default_icon_ = NULL;
TaskManagerChildProcessResource::TaskManagerChildProcessResource(
content::ProcessType type,
@@ -804,7 +802,7 @@ TaskManagerChildProcessResource::TaskManagerChildProcessResource(
pid_ = base::GetProcId(handle);
if (!default_icon_) {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- default_icon_ = rb.GetImageSkiaNamed(IDR_PLUGIN);
+ default_icon_ = rb.GetBitmapNamed(IDR_PLUGIN);
// TODO(jabdelmalek): use different icon for web workers.
}
}
@@ -824,7 +822,7 @@ string16 TaskManagerChildProcessResource::GetProfileName() const {
return string16();
}
-gfx::ImageSkia TaskManagerChildProcessResource::GetIcon() const {
+SkBitmap TaskManagerChildProcessResource::GetIcon() const {
return *default_icon_;
}
@@ -1110,14 +1108,14 @@ void TaskManagerChildProcessResourceProvider::ChildProcessDataRetreived(
// TaskManagerExtensionProcessResource class
////////////////////////////////////////////////////////////////////////////////
-gfx::ImageSkia* TaskManagerExtensionProcessResource::default_icon_ = NULL;
+SkBitmap* TaskManagerExtensionProcessResource::default_icon_ = NULL;
TaskManagerExtensionProcessResource::TaskManagerExtensionProcessResource(
content::RenderViewHost* render_view_host)
: render_view_host_(render_view_host) {
if (!default_icon_) {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- default_icon_ = rb.GetImageSkiaNamed(IDR_PLUGIN);
+ default_icon_ = rb.GetBitmapNamed(IDR_PLUGIN);
}
process_handle_ = render_view_host_->GetProcess()->GetHandle();
unique_process_id_ = render_view_host->GetProcess()->GetID();
@@ -1152,7 +1150,7 @@ string16 TaskManagerExtensionProcessResource::GetProfileName() const {
return cache.GetNameOfProfileAtIndex(index);
}
-gfx::ImageSkia TaskManagerExtensionProcessResource::GetIcon() const {
+SkBitmap TaskManagerExtensionProcessResource::GetIcon() const {
return *default_icon_;
}
@@ -1368,7 +1366,7 @@ void TaskManagerExtensionProcessResourceProvider::RemoveFromTaskManager(
// TaskManagerBrowserProcessResource class
////////////////////////////////////////////////////////////////////////////////
-gfx::ImageSkia* TaskManagerBrowserProcessResource::default_icon_ = NULL;
+SkBitmap* TaskManagerBrowserProcessResource::default_icon_ = NULL;
TaskManagerBrowserProcessResource::TaskManagerBrowserProcessResource()
: title_() {
@@ -1379,14 +1377,13 @@ TaskManagerBrowserProcessResource::TaskManagerBrowserProcessResource()
if (!default_icon_) {
HICON icon = GetAppIcon();
if (icon) {
- scoped_ptr<SkBitmap> bitmap(IconUtil::CreateSkBitmapFromHICON(icon));
- default_icon_ = new gfx::ImageSkia(*bitmap);
+ default_icon_ = IconUtil::CreateSkBitmapFromHICON(icon);
}
}
#elif defined(OS_POSIX) && !defined(OS_MACOSX)
if (!default_icon_) {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- default_icon_ = rb.GetImageSkiaNamed(IDR_PRODUCT_LOGO_16);
+ default_icon_ = rb.GetBitmapNamed(IDR_PRODUCT_LOGO_16);
}
#elif defined(OS_MACOSX)
if (!default_icon_) {
@@ -1416,7 +1413,7 @@ string16 TaskManagerBrowserProcessResource::GetProfileName() const {
return string16();
}
-gfx::ImageSkia TaskManagerBrowserProcessResource::GetIcon() const {
+SkBitmap TaskManagerBrowserProcessResource::GetIcon() const {
return *default_icon_;
}
diff --git a/chrome/browser/task_manager/task_manager_resource_providers.h b/chrome/browser/task_manager/task_manager_resource_providers.h
index b9f80a7..affe440 100644
--- a/chrome/browser/task_manager/task_manager_resource_providers.h
+++ b/chrome/browser/task_manager/task_manager_resource_providers.h
@@ -114,7 +114,7 @@ class TaskManagerTabContentsResource : public TaskManagerRendererResource {
virtual Type GetType() const OVERRIDE;
virtual string16 GetTitle() const OVERRIDE;
virtual string16 GetProfileName() const OVERRIDE;
- virtual gfx::ImageSkia GetIcon() const OVERRIDE;
+ virtual SkBitmap GetIcon() const OVERRIDE;
virtual TabContentsWrapper* GetTabContents() const OVERRIDE;
virtual const extensions::Extension* GetExtension() const OVERRIDE;
@@ -124,7 +124,7 @@ class TaskManagerTabContentsResource : public TaskManagerRendererResource {
// Returns true if contains content rendered by an extension.
bool HostsExtension() const;
- static gfx::ImageSkia* prerender_icon_;
+ static SkBitmap* prerender_icon_;
TabContentsWrapper* tab_contents_;
bool is_instant_preview_;
@@ -184,7 +184,7 @@ class TaskManagerBackgroundContentsResource
// TaskManager::Resource methods:
virtual string16 GetTitle() const OVERRIDE;
virtual string16 GetProfileName() const OVERRIDE;
- virtual gfx::ImageSkia GetIcon() const OVERRIDE;
+ virtual SkBitmap GetIcon() const OVERRIDE;
virtual bool IsBackground() const OVERRIDE;
const string16& application_name() const { return application_name_; }
@@ -196,7 +196,7 @@ class TaskManagerBackgroundContentsResource
// The icon painted for BackgroundContents.
// TODO(atwilson): Use the favicon when there's a way to get the favicon for
// BackgroundContents.
- static gfx::ImageSkia* default_icon_;
+ static SkBitmap* default_icon_;
DISALLOW_COPY_AND_ASSIGN(TaskManagerBackgroundContentsResource);
};
@@ -257,7 +257,7 @@ class TaskManagerChildProcessResource : public TaskManager::Resource {
// TaskManager::Resource methods:
virtual string16 GetTitle() const OVERRIDE;
virtual string16 GetProfileName() const OVERRIDE;
- virtual gfx::ImageSkia GetIcon() const OVERRIDE;
+ virtual SkBitmap GetIcon() const OVERRIDE;
virtual base::ProcessHandle GetProcess() const OVERRIDE;
virtual int GetUniqueChildProcessId() const OVERRIDE;
virtual Type GetType() const OVERRIDE;
@@ -283,7 +283,7 @@ class TaskManagerChildProcessResource : public TaskManager::Resource {
// The icon painted for the child processs.
// TODO(jcampan): we should have plugin specific icons for well-known
// plugins.
- static gfx::ImageSkia* default_icon_;
+ static SkBitmap* default_icon_;
DISALLOW_COPY_AND_ASSIGN(TaskManagerChildProcessResource);
};
@@ -354,7 +354,7 @@ class TaskManagerExtensionProcessResource : public TaskManager::Resource {
// TaskManager::Resource methods:
virtual string16 GetTitle() const OVERRIDE;
virtual string16 GetProfileName() const OVERRIDE;
- virtual gfx::ImageSkia GetIcon() const OVERRIDE;
+ virtual SkBitmap GetIcon() const OVERRIDE;
virtual base::ProcessHandle GetProcess() const OVERRIDE;
virtual int GetUniqueChildProcessId() const OVERRIDE;
virtual Type GetType() const OVERRIDE;
@@ -372,7 +372,7 @@ class TaskManagerExtensionProcessResource : public TaskManager::Resource {
private:
// The icon painted for the extension process.
- static gfx::ImageSkia* default_icon_;
+ static SkBitmap* default_icon_;
content::RenderViewHost* render_view_host_;
@@ -437,7 +437,7 @@ class TaskManagerNotificationResource : public TaskManager::Resource {
// TaskManager::Resource interface
virtual string16 GetTitle() const OVERRIDE;
virtual string16 GetProfileName() const OVERRIDE;
- virtual gfx::ImageSkia GetIcon() const OVERRIDE;
+ virtual SkBitmap GetIcon() const OVERRIDE;
virtual base::ProcessHandle GetProcess() const OVERRIDE;
virtual int GetUniqueChildProcessId() const OVERRIDE;
virtual Type GetType() const OVERRIDE;
@@ -448,7 +448,7 @@ class TaskManagerNotificationResource : public TaskManager::Resource {
private:
// The icon painted for notifications. .
- static gfx::ImageSkia* default_icon_;
+ static SkBitmap* default_icon_;
// Non-owned pointer to the balloon host.
BalloonHost* balloon_host_;
@@ -509,7 +509,7 @@ class TaskManagerBrowserProcessResource : public TaskManager::Resource {
// TaskManager::Resource methods:
virtual string16 GetTitle() const OVERRIDE;
virtual string16 GetProfileName() const OVERRIDE;
- virtual gfx::ImageSkia GetIcon() const OVERRIDE;
+ virtual SkBitmap GetIcon() const OVERRIDE;
virtual base::ProcessHandle GetProcess() const OVERRIDE;
virtual int GetUniqueChildProcessId() const OVERRIDE;
virtual Type GetType() const OVERRIDE;
@@ -528,7 +528,7 @@ class TaskManagerBrowserProcessResource : public TaskManager::Resource {
base::ProcessHandle process_;
mutable string16 title_;
- static gfx::ImageSkia* default_icon_;
+ static SkBitmap* default_icon_;
DISALLOW_COPY_AND_ASSIGN(TaskManagerBrowserProcessResource);
};
diff --git a/chrome/browser/task_manager/task_manager_unittest.cc b/chrome/browser/task_manager/task_manager_unittest.cc
index c313db6..c5e286d 100644
--- a/chrome/browser/task_manager/task_manager_unittest.cc
+++ b/chrome/browser/task_manager/task_manager_unittest.cc
@@ -12,8 +12,8 @@
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "testing/gtest/include/gtest/gtest.h"
+#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/gfx/image/image_skia.h"
namespace {
@@ -36,7 +36,7 @@ class TestResource : public TaskManager::Resource {
virtual string16 GetProfileName() const OVERRIDE {
return ASCIIToUTF16("test profile");
}
- virtual gfx::ImageSkia GetIcon() const { return gfx::ImageSkia(); }
+ virtual SkBitmap GetIcon() const { return SkBitmap(); }
virtual base::ProcessHandle GetProcess() const {
return base::GetCurrentProcessHandle();
}
diff --git a/chrome/browser/task_manager/task_manager_worker_resource_provider.cc b/chrome/browser/task_manager/task_manager_worker_resource_provider.cc
index 0b72af4..1102174 100644
--- a/chrome/browser/task_manager/task_manager_worker_resource_provider.cc
+++ b/chrome/browser/task_manager/task_manager_worker_resource_provider.cc
@@ -19,9 +19,9 @@
#include "content/public/browser/worker_service.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources_standard.h"
+#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
-#include "ui/gfx/image/image_skia.h"
using content::BrowserThread;
using content::DevToolsAgentHost;
@@ -50,7 +50,7 @@ class TaskManagerSharedWorkerResource : public TaskManager::Resource {
// TaskManager::Resource methods:
virtual string16 GetTitle() const OVERRIDE;
virtual string16 GetProfileName() const OVERRIDE;
- virtual gfx::ImageSkia GetIcon() const OVERRIDE;
+ virtual SkBitmap GetIcon() const OVERRIDE;
virtual base::ProcessHandle GetProcess() const OVERRIDE;
virtual int GetUniqueChildProcessId() const OVERRIDE;
virtual Type GetType() const OVERRIDE;
@@ -65,12 +65,12 @@ class TaskManagerSharedWorkerResource : public TaskManager::Resource {
string16 title_;
base::ProcessHandle handle_;
- static gfx::ImageSkia* default_icon_;
+ static SkBitmap* default_icon_;
DISALLOW_COPY_AND_ASSIGN(TaskManagerSharedWorkerResource);
};
-gfx::ImageSkia* TaskManagerSharedWorkerResource::default_icon_ = NULL;
+SkBitmap* TaskManagerSharedWorkerResource::default_icon_ = NULL;
TaskManagerSharedWorkerResource::TaskManagerSharedWorkerResource(
const GURL& url,
@@ -107,10 +107,10 @@ string16 TaskManagerSharedWorkerResource::GetProfileName() const {
return string16();
}
-gfx::ImageSkia TaskManagerSharedWorkerResource::GetIcon() const {
+SkBitmap TaskManagerSharedWorkerResource::GetIcon() const {
if (!default_icon_) {
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
- default_icon_ = rb.GetImageSkiaNamed(IDR_PLUGIN);
+ default_icon_ = rb.GetBitmapNamed(IDR_PLUGIN);
// TODO(jabdelmalek): use different icon for web workers.
}
return *default_icon_;
diff --git a/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.h b/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.h
index de78a12..ea71fe0 100644
--- a/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.h
+++ b/chrome/browser/ui/cocoa/content_settings/collected_cookies_mac.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -50,7 +50,7 @@ class CollectedCookiesMac : public ConstrainedWindowMacDelegateCustomSheet,
// Controller for the collected cookies dialog. This class stores an internal
// copy of the CookiesTreeModel but with Cocoa-converted values (NSStrings and
-// NSImages instead of std::strings and ImageSkias). Doing this allows us to use
+// NSImages instead of std::strings and SkBitmaps). Doing this allows us to use
// bindings for the interface. Changes are pushed to this internal model via a
// very thin bridge (see cookies_window_controller.h).
@interface CollectedCookiesWindowController : NSWindowController
diff --git a/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.h b/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.h
index 0ac16b0..9cab254 100644
--- a/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.h
+++ b/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.h
@@ -13,7 +13,7 @@
#include "base/memory/scoped_ptr.h"
#include "base/string16.h"
#include "chrome/browser/extensions/extension_install_ui.h"
-#include "ui/gfx/image/image_skia.h"
+#include "third_party/skia/include/core/SkBitmap.h"
class Profile;
diff --git a/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm b/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm
index 809c575..504edb9 100644
--- a/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm
+++ b/chrome/browser/ui/cocoa/extensions/extension_install_dialog_controller.mm
@@ -30,7 +30,7 @@ using extensions::BundleInstaller;
@interface ExtensionInstallDialogController ()
- (BOOL)isBundleInstall;
- (BOOL)isInlineInstall;
-- (void)appendRatingStar:(const gfx::ImageSkia*)skiaImage;
+- (void)appendRatingStar:(const SkBitmap*)skiaImage;
@end
namespace {
@@ -66,7 +66,7 @@ void OffsetControlVerticallyToFitContent(NSControl* control,
[control setFrameOrigin:origin];
}
-void AppendRatingStarsShim(const gfx::ImageSkia* skiaImage, void* data) {
+void AppendRatingStarsShim(const SkBitmap* skiaImage, void* data) {
ExtensionInstallDialogController* controller =
static_cast<ExtensionInstallDialogController*>(data);
[controller appendRatingStar:skiaImage];
@@ -297,7 +297,7 @@ void AppendRatingStarsShim(const gfx::ImageSkia* skiaImage, void* data) {
return prompt_->type() == ExtensionInstallUI::INLINE_INSTALL_PROMPT;
}
-- (void)appendRatingStar:(const gfx::ImageSkia*)skiaImage {
+- (void)appendRatingStar:(const SkBitmap*)skiaImage {
NSImage* image = gfx::SkBitmapToNSImageWithColorSpace(
*skiaImage, base::mac::GetSystemColorSpace());
NSRect frame = NSMakeRect(0, 0, skiaImage->width(), skiaImage->height());
diff --git a/chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.cc b/chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.cc
index a73b325..11577fc 100644
--- a/chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.cc
+++ b/chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.cc
@@ -1,10 +1,11 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
#include "chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.h"
#include "base/utf_string_conversions.h"
+#include "third_party/skia/include/core/SkBitmap.h"
const char MockConfirmInfoBarDelegate::kMessage[] = "MockConfirmInfoBarMessage";
diff --git a/chrome/browser/ui/cocoa/infobars/mock_link_infobar_delegate.cc b/chrome/browser/ui/cocoa/infobars/mock_link_infobar_delegate.cc
index 7fe8f89..f0070d0 100644
--- a/chrome/browser/ui/cocoa/infobars/mock_link_infobar_delegate.cc
+++ b/chrome/browser/ui/cocoa/infobars/mock_link_infobar_delegate.cc
@@ -1,10 +1,11 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
#include "chrome/browser/ui/cocoa/infobars/mock_link_infobar_delegate.h"
#include "base/utf_string_conversions.h"
+#include "third_party/skia/include/core/SkBitmap.h"
const char MockLinkInfoBarDelegate::kMessage[] = "MockLinkInfoBarMessage ";
const char MockLinkInfoBarDelegate::kLink[] = "http://dev.chromium.org";
diff --git a/chrome/browser/ui/cocoa/table_row_nsimage_cache.h b/chrome/browser/ui/cocoa/table_row_nsimage_cache.h
index 377b639..f6713fe 100644
--- a/chrome/browser/ui/cocoa/table_row_nsimage_cache.h
+++ b/chrome/browser/ui/cocoa/table_row_nsimage_cache.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -10,9 +10,7 @@
#include "base/memory/scoped_nsobject.h"
-namespace gfx {
-class ImageSkia;
-}
+class SkBitmap;
// There are several dialogs that display tabular data with one SkBitmap
// per row. This class converts these SkBitmaps to NSImages on demand, and
@@ -26,7 +24,7 @@ class TableRowNSImageCache {
virtual int RowCount() const = 0;
// Returns the icon of the |row|th row.
- virtual gfx::ImageSkia GetIcon(int row) const = 0;
+ virtual SkBitmap GetIcon(int row) const = 0;
protected:
virtual ~Table() {}
@@ -55,3 +53,4 @@ class TableRowNSImageCache {
};
#endif // CHROME_BROWSER_UI_COCOA_TABLE_ROW_NSIMAGE_CACHE_H_
+
diff --git a/chrome/browser/ui/cocoa/table_row_nsimage_cache.mm b/chrome/browser/ui/cocoa/table_row_nsimage_cache.mm
index 4a97811..ff36a50 100644
--- a/chrome/browser/ui/cocoa/table_row_nsimage_cache.mm
+++ b/chrome/browser/ui/cocoa/table_row_nsimage_cache.mm
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 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.
@@ -6,7 +6,7 @@
#include "base/logging.h"
#include "skia/ext/skia_utils_mac.h"
-#include "ui/gfx/image/image_skia.h"
+#include "third_party/skia/include/core/SkBitmap.h"
TableRowNSImageCache::TableRowNSImageCache(Table* model)
: model_(model),
@@ -66,7 +66,7 @@ NSImage* TableRowNSImageCache::GetImageForRow(int row) {
DCHECK_LT(row, static_cast<int>([icon_images_ count]));
NSImage* image = static_cast<NSImage*>([icon_images_ pointerAtIndex:row]);
if (!image) {
- const gfx::ImageSkia bitmap_icon =
+ const SkBitmap bitmap_icon =
model_->GetIcon(row);
// This means GetIcon() will get called until it returns a non-empty bitmap.
// Empty bitmaps are intentionally not cached.
diff --git a/chrome/browser/ui/cocoa/task_manager_mac.h b/chrome/browser/ui/cocoa/task_manager_mac.h
index bd83c13..067e14e 100644
--- a/chrome/browser/ui/cocoa/task_manager_mac.h
+++ b/chrome/browser/ui/cocoa/task_manager_mac.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -15,12 +15,9 @@
#include "chrome/browser/ui/cocoa/table_row_nsimage_cache.h"
@class WindowSizeAutosaver;
+class SkBitmap;
class TaskManagerMac;
-namespace gfx {
-class ImageSkia;
-}
-
// This class is responsible for loading the task manager window and for
// managing it.
@interface TaskManagerWindowController :
@@ -88,7 +85,7 @@ class TaskManagerMac : public TaskManagerModelObserver,
// TableRowNSImageCache::Table
virtual int RowCount() const OVERRIDE;
- virtual gfx::ImageSkia GetIcon(int r) const OVERRIDE;
+ virtual SkBitmap GetIcon(int r) const OVERRIDE;
// Creates the task manager if it doesn't exist; otherwise, it activates the
// existing task manager window. Highlights background resources if
diff --git a/chrome/browser/ui/cocoa/task_manager_mac.mm b/chrome/browser/ui/cocoa/task_manager_mac.mm
index 94d3d3d..cc31e27 100644
--- a/chrome/browser/ui/cocoa/task_manager_mac.mm
+++ b/chrome/browser/ui/cocoa/task_manager_mac.mm
@@ -16,7 +16,6 @@
#include "grit/generated_resources.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/l10n/l10n_util_mac.h"
-#include "ui/gfx/image/image_skia.h"
namespace {
@@ -625,7 +624,7 @@ int TaskManagerMac::RowCount() const {
return model_->ResourceCount();
}
-gfx::ImageSkia TaskManagerMac::GetIcon(int r) const {
+SkBitmap TaskManagerMac::GetIcon(int r) const {
return model_->GetResourceIcon(r);
}
diff --git a/chrome/browser/ui/gtk/extensions/extension_install_dialog_gtk.cc b/chrome/browser/ui/gtk/extensions/extension_install_dialog_gtk.cc
index 49caddb..865e3cc 100644
--- a/chrome/browser/ui/gtk/extensions/extension_install_dialog_gtk.cc
+++ b/chrome/browser/ui/gtk/extensions/extension_install_dialog_gtk.cc
@@ -40,7 +40,7 @@ const int kExtensionsPadding = kPermissionsPadding;
const double kRatingTextSize = 12.1; // 12.1px = 9pt @ 96dpi
// Adds a Skia image as an icon control to the given container.
-void AddResourceIcon(const gfx::ImageSkia* icon, void* data) {
+void AddResourceIcon(const SkBitmap* icon, void* data) {
GtkWidget* container = static_cast<GtkWidget*>(data);
GdkPixbuf* icon_pixbuf = gfx::GdkPixbufFromSkBitmap(*icon);
GtkWidget* icon_widget = gtk_image_new_from_pixbuf(icon_pixbuf);
diff --git a/chrome/browser/ui/gtk/speech_recognition_bubble_gtk.cc b/chrome/browser/ui/gtk/speech_recognition_bubble_gtk.cc
index 4099503..5161ac7 100644
--- a/chrome/browser/ui/gtk/speech_recognition_bubble_gtk.cc
+++ b/chrome/browser/ui/gtk/speech_recognition_bubble_gtk.cc
@@ -252,8 +252,8 @@ void SpeechRecognitionBubbleGtk::UpdateLayout() {
gtk_widget_get_child_requisition(cancel_button_, &cancel_size);
GtkRequisition label_size;
gtk_widget_get_child_requisition(label_, &label_size);
- gfx::ImageSkia* volume = ResourceBundle::GetSharedInstance().
- GetImageSkiaNamed(IDR_SPEECH_INPUT_MIC_EMPTY);
+ SkBitmap* volume = ResourceBundle::GetSharedInstance().GetBitmapNamed(
+ IDR_SPEECH_INPUT_MIC_EMPTY);
int desired_width = std::max(volume->width(), cancel_size.width) +
kIconHorizontalPadding * 2;
int desired_height = volume->height() + label_size.height +
@@ -274,7 +274,7 @@ void SpeechRecognitionBubbleGtk::UpdateLayout() {
}
void SpeechRecognitionBubbleGtk::UpdateImage() {
- gfx::ImageSkia image = icon_image();
+ SkBitmap image = icon_image();
if (image.isNull() || !bubble_)
return;
diff --git a/chrome/browser/ui/search_engines/template_url_table_model.cc b/chrome/browser/ui/search_engines/template_url_table_model.cc
index 280f386..662c910c 100644
--- a/chrome/browser/ui/search_engines/template_url_table_model.cc
+++ b/chrome/browser/ui/search_engines/template_url_table_model.cc
@@ -32,7 +32,7 @@ static const int kOtherGroupID = 1;
// ModelEntry also tracks state information about the URL.
// Icon used while loading, or if a specific favicon can't be found.
-static gfx::ImageSkia* default_icon = NULL;
+static SkBitmap* default_icon = NULL;
class ModelEntry {
public:
@@ -42,7 +42,7 @@ class ModelEntry {
model_(model) {
if (!default_icon) {
default_icon = ResourceBundle::GetSharedInstance().
- GetImageSkiaNamed(IDR_DEFAULT_FAVICON);
+ GetBitmapNamed(IDR_DEFAULT_FAVICON);
}
}
diff --git a/chrome/browser/ui/search_engines/template_url_table_model.h b/chrome/browser/ui/search_engines/template_url_table_model.h
index 5af66d4..78dcb43 100644
--- a/chrome/browser/ui/search_engines/template_url_table_model.h
+++ b/chrome/browser/ui/search_engines/template_url_table_model.h
@@ -15,6 +15,7 @@
#include "ui/base/models/table_model.h"
class ModelEntry;
+class SkBitmap;
class TemplateURL;
class TemplateURLService;
diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.cc b/chrome/browser/ui/toolbar/wrench_menu_model.cc
index a49787b..6862298 100644
--- a/chrome/browser/ui/toolbar/wrench_menu_model.cc
+++ b/chrome/browser/ui/toolbar/wrench_menu_model.cc
@@ -46,12 +46,12 @@
#include "grit/chromium_strings.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
+#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/layout.h"
#include "ui/base/models/button_menu_item_model.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image.h"
-#include "ui/gfx/image/image_skia.h"
#if defined(TOOLKIT_GTK)
#include <gtk/gtk.h>
@@ -494,7 +494,7 @@ void WrenchMenuModel::Build() {
#if defined(OS_WIN)
SetIcon(GetIndexOfCommandId(IDC_VIEW_INCOMPATIBILITIES),
*ui::ResourceBundle::GetSharedInstance().
- GetImageSkiaNamed(IDR_CONFLICT_MENU));
+ GetBitmapNamed(IDR_CONFLICT_MENU));
#endif
if (!is_touch_menu) {
@@ -503,7 +503,7 @@ void WrenchMenuModel::Build() {
if (browser_defaults::kShowHelpMenuItemIcon) {
ui::ResourceBundle& rb = ResourceBundle::GetSharedInstance();
SetIcon(GetIndexOfCommandId(IDC_HELP_PAGE),
- *rb.GetImageSkiaNamed(IDR_HELP_MENU));
+ *rb.GetBitmapNamed(IDR_HELP_MENU));
}
}
@@ -535,7 +535,7 @@ void WrenchMenuModel::AddGlobalErrorMenuItems() {
if (icon_id) {
gfx::Image& image = rb.GetImageNamed(icon_id);
SetIcon(GetIndexOfCommandId(error->MenuItemCommandID()),
- *image.ToImageSkia());
+ *image.ToSkBitmap());
}
}
}
diff --git a/chrome/browser/ui/views/about_chrome_view.cc b/chrome/browser/ui/views/about_chrome_view.cc
index 8108e9b..bd4c96d 100644
--- a/chrome/browser/ui/views/about_chrome_view.cc
+++ b/chrome/browser/ui/views/about_chrome_view.cc
@@ -148,16 +148,15 @@ void AboutChromeView::Init() {
throbber_->set_owned_by_client();
throbber_->SetVisible(false);
- gfx::ImageSkia* success_image = rb.GetImageSkiaNamed(IDR_UPDATE_UPTODATE);
+ SkBitmap* success_image = rb.GetBitmapNamed(IDR_UPDATE_UPTODATE);
success_indicator_.SetImage(*success_image);
success_indicator_.set_owned_by_client();
- gfx::ImageSkia* update_available_image = rb.GetImageSkiaNamed(
- IDR_UPDATE_AVAILABLE);
+ SkBitmap* update_available_image = rb.GetBitmapNamed(IDR_UPDATE_AVAILABLE);
update_available_indicator_.SetImage(*update_available_image);
update_available_indicator_.set_owned_by_client();
- gfx::ImageSkia* timeout_image = rb.GetImageSkiaNamed(IDR_UPDATE_FAIL);
+ SkBitmap* timeout_image = rb.GetBitmapNamed(IDR_UPDATE_FAIL);
timeout_indicator_.SetImage(*timeout_image);
timeout_indicator_.set_owned_by_client();
@@ -165,12 +164,12 @@ void AboutChromeView::Init() {
update_label_.set_owned_by_client();
// Regular view controls we draw by ourself. First, we add the background
- // image for the dialog. We have two different background images, one for
- // LTR UIs and one for RTL UIs. We load the correct image based on the UI
+ // image for the dialog. We have two different background bitmaps, one for
+ // LTR UIs and one for RTL UIs. We load the correct bitmap based on the UI
// layout of the view.
about_dlg_background_logo_ = new views::ImageView();
- gfx::ImageSkia* about_background_logo = rb.GetImageSkiaNamed(
- base::i18n::IsRTL() ? IDR_ABOUT_BACKGROUND_RTL : IDR_ABOUT_BACKGROUND);
+ SkBitmap* about_background_logo = rb.GetBitmapNamed(base::i18n::IsRTL() ?
+ IDR_ABOUT_BACKGROUND_RTL : IDR_ABOUT_BACKGROUND);
about_dlg_background_logo_->SetImage(*about_background_logo);
AddChildView(about_dlg_background_logo_);
@@ -426,8 +425,8 @@ void AboutChromeView::OnPaint(gfx::Canvas* canvas) {
// Draw the background image color (and the separator) across the dialog.
// This will become the background for the logo image at the top of the
// dialog.
- gfx::ImageSkia* background = ui::ResourceBundle::GetSharedInstance().
- GetImageSkiaNamed(IDR_ABOUT_BACKGROUND_COLOR);
+ SkBitmap* background = ui::ResourceBundle::GetSharedInstance().GetBitmapNamed(
+ IDR_ABOUT_BACKGROUND_COLOR);
canvas->TileImageInt(*background, 0, 0, dialog_dimensions_.width(),
background->height());
diff --git a/chrome/browser/ui/views/autocomplete/autocomplete_result_view.cc b/chrome/browser/ui/views/autocomplete/autocomplete_result_view.cc
index 46f50f2..9a6c508 100644
--- a/chrome/browser/ui/views/autocomplete/autocomplete_result_view.cc
+++ b/chrome/browser/ui/views/autocomplete/autocomplete_result_view.cc
@@ -20,11 +20,11 @@
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
#include "ui/base/l10n/l10n_util.h"
-#include "ui/base/native_theme/native_theme.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/base/text/text_elider.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/color_utils.h"
+#include "ui/base/native_theme/native_theme.h"
namespace {
@@ -117,8 +117,7 @@ AutocompleteResultView::AutocompleteResultView(
animation_(new ui::SlideAnimation(this))) {
CHECK_GE(model_index, 0);
if (default_icon_size_ == 0) {
- default_icon_size_ =
- ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
+ default_icon_size_ = ui::ResourceBundle::GetSharedInstance().GetBitmapNamed(
AutocompleteMatch::TypeToIcon(AutocompleteMatch::URL_WHAT_YOU_TYPED))->
width();
}
diff --git a/chrome/browser/ui/views/avatar_menu_bubble_view.cc b/chrome/browser/ui/views/avatar_menu_bubble_view.cc
index f78fdb2..fbcf0e0 100644
--- a/chrome/browser/ui/views/avatar_menu_bubble_view.cc
+++ b/chrome/browser/ui/views/avatar_menu_bubble_view.cc
@@ -163,7 +163,7 @@ class ProfileItemView : public views::CustomButton,
const AvatarMenuModel::Item& item() { return item_; }
private:
- static gfx::ImageSkia GetBadgedIcon(const gfx::ImageSkia& icon);
+ static SkBitmap GetBadgedIcon(const SkBitmap& icon);
bool IsHighlighted();
@@ -180,9 +180,9 @@ ProfileItemView::ProfileItemView(const AvatarMenuModel::Item& item,
: views::CustomButton(switch_profile_listener),
item_(item) {
image_view_ = new ProfileImageView();
- gfx::ImageSkia profile_icon = *item_.icon.ToImageSkia();
+ SkBitmap profile_icon = *item_.icon.ToSkBitmap();
if (item_.active) {
- gfx::ImageSkia badged_icon(GetBadgedIcon(profile_icon));
+ SkBitmap badged_icon(GetBadgedIcon(profile_icon));
image_view_->SetImage(badged_icon);
} else {
image_view_->SetImage(profile_icon);
@@ -241,7 +241,7 @@ void ProfileItemView::Layout() {
icon_rect.set_size(image_view_->GetPreferredSize());
icon_rect.set_y((height() - icon_rect.height()) / 2);
} else {
- const gfx::ImageSkia& icon = image_view_->GetImage();
+ const SkBitmap& icon = image_view_->GetImage();
icon_rect = GetCenteredAndScaledRect(icon.width(), icon.height(), 0, 0,
profiles::kAvatarIconWidth, height());
}
@@ -312,13 +312,12 @@ void ProfileItemView::OnFocusStateChanged(bool has_focus) {
}
// static
-gfx::ImageSkia ProfileItemView::GetBadgedIcon(const gfx::ImageSkia& icon) {
+SkBitmap ProfileItemView::GetBadgedIcon(const SkBitmap& icon) {
gfx::Rect icon_rect = GetCenteredAndScaledRect(icon.width(), icon.height(),
0, 0, profiles::kAvatarIconWidth, kItemHeight);
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- const gfx::ImageSkia* badge = rb.GetImageNamed(
- IDR_PROFILE_SELECTED).ToImageSkia();
+ const SkBitmap* badge = rb.GetImageNamed(IDR_PROFILE_SELECTED).ToSkBitmap();
const float kBadgeOverlapRatioX = 1.0f / 5.0f;
int width = icon_rect.width() + badge->width() * kBadgeOverlapRatioX;
const float kBadgeOverlapRatioY = 1.0f / 3.0f;
diff --git a/chrome/browser/ui/views/avatar_menu_button.cc b/chrome/browser/ui/views/avatar_menu_button.cc
index 154c97f..532f795 100644
--- a/chrome/browser/ui/views/avatar_menu_button.cc
+++ b/chrome/browser/ui/views/avatar_menu_button.cc
@@ -69,7 +69,7 @@ void DrawTaskBarDecoration(gfx::NativeWindow window, const gfx::Image* image) {
profiles::kAvatarIconWidth - x * 2, profiles::kAvatarIconHeight));
source_bitmap = &squarer_bitmap;
} else {
- // The image's size has changed. Resize what we have.
+ // The bitmaps size has changed. Resize what we have.
source_bitmap = bitmap;
}
// Since the target size is so small, we use our best resizer. Never pass
@@ -108,7 +108,7 @@ void AvatarMenuButton::OnPaint(gfx::Canvas* canvas) {
if (old_height_ != height() || button_icon_.isNull()) {
old_height_ = height();
button_icon_ = *profiles::GetAvatarIconForTitleBar(
- *icon_, is_gaia_picture_, width(), height()).ToImageSkia();
+ *icon_, is_gaia_picture_, width(), height()).ToSkBitmap();
}
// Scale the image to fit the width of the button.
@@ -141,7 +141,7 @@ bool AvatarMenuButton::HitTest(const gfx::Point& point) const {
void AvatarMenuButton::SetAvatarIcon(const gfx::Image& icon,
bool is_gaia_picture) {
icon_.reset(new gfx::Image(icon));
- button_icon_ = gfx::ImageSkia();
+ button_icon_ = SkBitmap();
is_gaia_picture_ = is_gaia_picture;
SchedulePaint();
}
diff --git a/chrome/browser/ui/views/avatar_menu_button.h b/chrome/browser/ui/views/avatar_menu_button.h
index 502cbb7..dbd8ffe 100644
--- a/chrome/browser/ui/views/avatar_menu_button.h
+++ b/chrome/browser/ui/views/avatar_menu_button.h
@@ -60,7 +60,7 @@ class AvatarMenuButton : public views::MenuButton,
// Use a scoped ptr because gfx::Image doesn't have a default constructor.
scoped_ptr<gfx::Image> icon_;
- gfx::ImageSkia button_icon_;
+ SkBitmap button_icon_;
bool is_gaia_picture_;
int old_height_;
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
index b23a163..2c1c0c1 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
@@ -94,10 +94,10 @@ const char BookmarkBarView::kViewClassName[] =
static const int kButtonPadding = 0;
// Icon to display when one isn't found for the page.
-static gfx::ImageSkia* kDefaultFavicon = NULL;
+static SkBitmap* kDefaultFavicon = NULL;
// Icon used for folders.
-static gfx::ImageSkia* kFolderIcon = NULL;
+static SkBitmap* kFolderIcon = NULL;
// Offset for where the menu is shown relative to the bottom of the
// BookmarkBarView.
@@ -358,11 +358,11 @@ const int BookmarkBarView::kNewtabVerticalPadding = 12;
// static
bool BookmarkBarView::testing_ = false;
-// Returns the image to use for starred folders.
-static const gfx::ImageSkia& GetFolderIcon() {
+// Returns the bitmap to use for starred folders.
+static const SkBitmap& GetFolderIcon() {
if (!kFolderIcon) {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- kFolderIcon = rb.GetImageSkiaNamed(IDR_BOOKMARK_BAR_FOLDER);
+ kFolderIcon = rb.GetBitmapNamed(IDR_BOOKMARK_BAR_FOLDER);
}
return *kFolderIcon;
}
@@ -1120,7 +1120,7 @@ void BookmarkBarView::Init() {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
if (!kDefaultFavicon)
- kDefaultFavicon = rb.GetImageSkiaNamed(IDR_DEFAULT_FAVICON);
+ kDefaultFavicon = rb.GetBitmapNamed(IDR_DEFAULT_FAVICON);
// Child views are traversed in the order they are added. Make sure the order
// they are added matches the visual order.
@@ -1195,7 +1195,7 @@ MenuButton* BookmarkBarView::CreateOtherBookmarkedButton() {
MenuButton* BookmarkBarView::CreateOverflowButton() {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
MenuButton* button = new OverFlowButton(this);
- button->SetIcon(*rb.GetImageSkiaNamed(IDR_BOOKMARK_BAR_CHEVRONS));
+ button->SetIcon(*rb.GetBitmapNamed(IDR_BOOKMARK_BAR_CHEVRONS));
// The overflow button's image contains an arrow and therefore it is a
// direction sensitive image and we need to flip it if the UI layout is
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
index 882479c..371c6e9 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
@@ -436,7 +436,7 @@ void BookmarkMenuDelegate::BuildMenuForPermanentNode(
int id = *next_menu_id;
(*next_menu_id)++;
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- gfx::ImageSkia* folder_icon = rb.GetImageSkiaNamed(IDR_BOOKMARK_BAR_FOLDER);
+ SkBitmap* folder_icon = rb.GetBitmapNamed(IDR_BOOKMARK_BAR_FOLDER);
MenuItemView* submenu = menu->AppendSubMenuWithIcon(
id, node->GetTitle(), *folder_icon);
BuildMenu(node, 0, submenu, next_menu_id);
@@ -455,16 +455,14 @@ void BookmarkMenuDelegate::BuildMenu(const BookmarkNode* parent,
(*next_menu_id)++;
if (node->is_url()) {
- gfx::ImageSkia icon = gfx::ImageSkia(
- profile_->GetBookmarkModel()->GetFavicon(node));
+ SkBitmap icon = profile_->GetBookmarkModel()->GetFavicon(node);
if (icon.width() == 0) {
- icon = *rb.GetImageSkiaNamed(IDR_DEFAULT_FAVICON);
+ icon = *rb.GetBitmapNamed(IDR_DEFAULT_FAVICON);
}
menu->AppendMenuItemWithIcon(id, node->GetTitle(), icon);
node_to_menu_id_map_[node] = id;
} else if (node->is_folder()) {
- gfx::ImageSkia* folder_icon =
- rb.GetImageSkiaNamed(IDR_BOOKMARK_BAR_FOLDER);
+ SkBitmap* folder_icon = rb.GetBitmapNamed(IDR_BOOKMARK_BAR_FOLDER);
MenuItemView* submenu = menu->AppendSubMenuWithIcon(
id, node->GetTitle(), *folder_icon);
node_to_menu_id_map_[node] = id;
diff --git a/chrome/browser/ui/views/constrained_window_views.cc b/chrome/browser/ui/views/constrained_window_views.cc
index 7f23ba6..0bb36ff 100644
--- a/chrome/browser/ui/views/constrained_window_views.cc
+++ b/chrome/browser/ui/views/constrained_window_views.cc
@@ -61,7 +61,7 @@ namespace views {
class ClientView;
}
-// An enumeration of image resources used by this window.
+// An enumeration of bitmap resources used by this window.
enum {
FRAME_PART_IMAGE_FIRST = 0, // Must be first.
@@ -291,7 +291,7 @@ ConstrainedWindowFrameView::ConstrainedWindowFrameView(
InitWindowResources();
// Constrained windows always use the custom frame - they just have a
- // different set of images.
+ // different set of bitmaps.
container->set_frame_type(views::Widget::FRAME_TYPE_FORCE_CUSTOM);
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
diff --git a/chrome/browser/ui/views/detachable_toolbar_view.cc b/chrome/browser/ui/views/detachable_toolbar_view.cc
index c0a0e47..026b7ea 100644
--- a/chrome/browser/ui/views/detachable_toolbar_view.cc
+++ b/chrome/browser/ui/views/detachable_toolbar_view.cc
@@ -7,10 +7,10 @@
#include "chrome/browser/themes/theme_service.h"
#include "grit/theme_resources.h"
#include "grit/theme_resources_standard.h"
+#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkShader.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
-#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/skia_util.h"
#include "ui/views/window/non_client_view.h"
@@ -30,18 +30,17 @@ void DetachableToolbarView::PaintBackgroundAttachedMode(
ui::ThemeProvider* tp = view->GetThemeProvider();
canvas->FillRect(view->GetLocalBounds(),
tp->GetColor(ThemeService::COLOR_TOOLBAR));
- canvas->TileImageInt(*tp->GetImageSkiaNamed(IDR_THEME_TOOLBAR),
+ canvas->TileImageInt(*tp->GetBitmapNamed(IDR_THEME_TOOLBAR),
background_origin.x(), background_origin.y(), 0, 0,
view->width(), view->height());
#if defined(USE_ASH)
// Ash provides additional lightening at the edges of the toolbar.
- gfx::ImageSkia* toolbar_left = tp->GetImageSkiaNamed(IDR_TOOLBAR_SHADE_LEFT);
+ SkBitmap* toolbar_left = tp->GetBitmapNamed(IDR_TOOLBAR_SHADE_LEFT);
canvas->TileImageInt(*toolbar_left,
0, 0,
0, 0,
toolbar_left->width(), view->height());
- gfx::ImageSkia* toolbar_right =
- tp->GetImageSkiaNamed(IDR_TOOLBAR_SHADE_RIGHT);
+ SkBitmap* toolbar_right = tp->GetBitmapNamed(IDR_TOOLBAR_SHADE_RIGHT);
canvas->TileImageInt(*toolbar_right,
0, 0,
view->width() - toolbar_right->width(), 0,
diff --git a/chrome/browser/ui/views/download/download_item_view.cc b/chrome/browser/ui/views/download/download_item_view.cc
index 1dba4ef..d0894f6 100644
--- a/chrome/browser/ui/views/download/download_item_view.cc
+++ b/chrome/browser/ui/views/download/download_item_view.cc
@@ -109,75 +109,75 @@ DownloadItemView::DownloadItemView(DownloadItem* download,
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
BodyImageSet normal_body_image_set = {
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_LEFT_TOP),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_LEFT_MIDDLE),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_LEFT_BOTTOM),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_CENTER_TOP),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_CENTER_MIDDLE),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_CENTER_BOTTOM),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_RIGHT_TOP),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_RIGHT_MIDDLE),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_RIGHT_BOTTOM)
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_LEFT_TOP),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_LEFT_MIDDLE),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_LEFT_BOTTOM),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_CENTER_TOP),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_CENTER_MIDDLE),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_CENTER_BOTTOM),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_RIGHT_TOP),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_RIGHT_MIDDLE),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_RIGHT_BOTTOM)
};
normal_body_image_set_ = normal_body_image_set;
DropDownImageSet normal_drop_down_image_set = {
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_MENU_TOP),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_MENU_MIDDLE),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_MENU_BOTTOM)
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_MENU_TOP),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_MENU_MIDDLE),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_MENU_BOTTOM)
};
normal_drop_down_image_set_ = normal_drop_down_image_set;
BodyImageSet hot_body_image_set = {
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_LEFT_TOP_H),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_LEFT_MIDDLE_H),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_LEFT_BOTTOM_H),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_CENTER_TOP_H),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_CENTER_MIDDLE_H),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_CENTER_BOTTOM_H),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_RIGHT_TOP_H),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_RIGHT_MIDDLE_H),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_RIGHT_BOTTOM_H)
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_LEFT_TOP_H),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_LEFT_MIDDLE_H),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_LEFT_BOTTOM_H),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_CENTER_TOP_H),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_CENTER_MIDDLE_H),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_CENTER_BOTTOM_H),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_RIGHT_TOP_H),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_RIGHT_MIDDLE_H),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_RIGHT_BOTTOM_H)
};
hot_body_image_set_ = hot_body_image_set;
DropDownImageSet hot_drop_down_image_set = {
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_MENU_TOP_H),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_MENU_MIDDLE_H),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_MENU_BOTTOM_H)
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_MENU_TOP_H),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_MENU_MIDDLE_H),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_MENU_BOTTOM_H)
};
hot_drop_down_image_set_ = hot_drop_down_image_set;
BodyImageSet pushed_body_image_set = {
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_LEFT_TOP_P),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_LEFT_MIDDLE_P),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_LEFT_BOTTOM_P),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_CENTER_TOP_P),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_CENTER_MIDDLE_P),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_CENTER_BOTTOM_P),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_RIGHT_TOP_P),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_RIGHT_MIDDLE_P),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_RIGHT_BOTTOM_P)
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_LEFT_TOP_P),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_LEFT_MIDDLE_P),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_LEFT_BOTTOM_P),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_CENTER_TOP_P),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_CENTER_MIDDLE_P),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_CENTER_BOTTOM_P),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_RIGHT_TOP_P),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_RIGHT_MIDDLE_P),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_RIGHT_BOTTOM_P)
};
pushed_body_image_set_ = pushed_body_image_set;
DropDownImageSet pushed_drop_down_image_set = {
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_MENU_TOP_P),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_MENU_MIDDLE_P),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_MENU_BOTTOM_P)
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_MENU_TOP_P),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_MENU_MIDDLE_P),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_MENU_BOTTOM_P)
};
pushed_drop_down_image_set_ = pushed_drop_down_image_set;
BodyImageSet dangerous_mode_body_image_set = {
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_LEFT_TOP),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_LEFT_MIDDLE),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_LEFT_BOTTOM),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_CENTER_TOP),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_CENTER_MIDDLE),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_CENTER_BOTTOM),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_RIGHT_TOP_NO_DD),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_RIGHT_MIDDLE_NO_DD),
- rb.GetImageSkiaNamed(IDR_DOWNLOAD_BUTTON_RIGHT_BOTTOM_NO_DD)
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_LEFT_TOP),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_LEFT_MIDDLE),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_LEFT_BOTTOM),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_CENTER_TOP),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_CENTER_MIDDLE),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_CENTER_BOTTOM),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_RIGHT_TOP_NO_DD),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_RIGHT_MIDDLE_NO_DD),
+ rb.GetBitmapNamed(IDR_DOWNLOAD_BUTTON_RIGHT_BOTTOM_NO_DD)
};
dangerous_mode_body_image_set_ = dangerous_mode_body_image_set;
@@ -738,20 +738,20 @@ void DownloadItemView::OnPaint(gfx::Canvas* canvas) {
canvas->Translate(gfx::Point(width(), 0));
canvas->Scale(-1, 1);
}
- PaintImages(canvas,
- body_image_set->top_left, body_image_set->left,
- body_image_set->bottom_left,
- x, box_y_, box_height_, body_image_set->top_left->width());
+ PaintBitmaps(canvas,
+ body_image_set->top_left, body_image_set->left,
+ body_image_set->bottom_left,
+ x, box_y_, box_height_, body_image_set->top_left->width());
x += body_image_set->top_left->width();
- PaintImages(canvas,
- body_image_set->top, body_image_set->center,
- body_image_set->bottom,
- x, box_y_, box_height_, center_width);
+ PaintBitmaps(canvas,
+ body_image_set->top, body_image_set->center,
+ body_image_set->bottom,
+ x, box_y_, box_height_, center_width);
x += center_width;
- PaintImages(canvas,
- body_image_set->top_right, body_image_set->right,
- body_image_set->bottom_right,
- x, box_y_, box_height_, body_image_set->top_right->width());
+ PaintBitmaps(canvas,
+ body_image_set->top_right, body_image_set->right,
+ body_image_set->bottom_right,
+ x, box_y_, box_height_, body_image_set->top_right->width());
// Overlay our body hot state. Warning dialogs don't display body a hot state.
if (!IsShowingWarningDialog() &&
@@ -761,21 +761,21 @@ void DownloadItemView::OnPaint(gfx::Canvas* canvas) {
canvas->sk_canvas()->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode);
int x = kLeftPadding;
- PaintImages(canvas,
- hot_body_image_set_.top_left, hot_body_image_set_.left,
- hot_body_image_set_.bottom_left,
- x, box_y_, box_height_, hot_body_image_set_.top_left->width());
+ PaintBitmaps(canvas,
+ hot_body_image_set_.top_left, hot_body_image_set_.left,
+ hot_body_image_set_.bottom_left,
+ x, box_y_, box_height_, hot_body_image_set_.top_left->width());
x += body_image_set->top_left->width();
- PaintImages(canvas,
- hot_body_image_set_.top, hot_body_image_set_.center,
- hot_body_image_set_.bottom,
- x, box_y_, box_height_, center_width);
+ PaintBitmaps(canvas,
+ hot_body_image_set_.top, hot_body_image_set_.center,
+ hot_body_image_set_.bottom,
+ x, box_y_, box_height_, center_width);
x += center_width;
- PaintImages(canvas,
- hot_body_image_set_.top_right, hot_body_image_set_.right,
- hot_body_image_set_.bottom_right,
- x, box_y_, box_height_,
- hot_body_image_set_.top_right->width());
+ PaintBitmaps(canvas,
+ hot_body_image_set_.top_right, hot_body_image_set_.right,
+ hot_body_image_set_.bottom_right,
+ x, box_y_, box_height_,
+ hot_body_image_set_.top_right->width());
canvas->Restore();
}
@@ -783,10 +783,10 @@ void DownloadItemView::OnPaint(gfx::Canvas* canvas) {
// Paint the drop-down.
if (drop_down_image_set) {
- PaintImages(canvas,
- drop_down_image_set->top, drop_down_image_set->center,
- drop_down_image_set->bottom,
- x, box_y_, box_height_, drop_down_image_set->top->width());
+ PaintBitmaps(canvas,
+ drop_down_image_set->top, drop_down_image_set->center,
+ drop_down_image_set->bottom,
+ x, box_y_, box_height_, drop_down_image_set->top->width());
// Overlay our drop-down hot state.
if (drop_hover_animation_->GetCurrentValue() > 0) {
@@ -794,10 +794,10 @@ void DownloadItemView::OnPaint(gfx::Canvas* canvas) {
static_cast<int>(drop_hover_animation_->GetCurrentValue() * 255));
canvas->sk_canvas()->drawARGB(0, 255, 255, 255, SkXfermode::kClear_Mode);
- PaintImages(canvas,
- drop_down_image_set->top, drop_down_image_set->center,
- drop_down_image_set->bottom,
- x, box_y_, box_height_, drop_down_image_set->top->width());
+ PaintBitmaps(canvas,
+ drop_down_image_set->top, drop_down_image_set->center,
+ drop_down_image_set->bottom,
+ x, box_y_, box_height_, drop_down_image_set->top->width());
canvas->Restore();
}
@@ -849,11 +849,11 @@ void DownloadItemView::OnPaint(gfx::Canvas* canvas) {
IconManager* im = g_browser_process->icon_manager();
gfx::Image* image = im->LookupIcon(download_->GetUserVerifiedFilePath(),
IconLoader::SMALL);
- const gfx::ImageSkia* icon = NULL;
+ const SkBitmap* icon = NULL;
if (IsShowingWarningDialog())
icon = warning_icon_;
else if (image)
- icon = image->ToImageSkia();
+ icon = image->ToSkBitmap();
// We count on the fact that the icon manager will cache the icons and if one
// is available, it will be cached here. We *don't* want to request the icon
@@ -933,26 +933,26 @@ void DownloadItemView::LoadIconIfItemPathChanged() {
// Load an icon for the file type we're downloading, and animate any in progress
// download state.
-void DownloadItemView::PaintImages(gfx::Canvas* canvas,
- const gfx::ImageSkia* top_image,
- const gfx::ImageSkia* center_image,
- const gfx::ImageSkia* bottom_image,
- int x, int y, int height, int width) {
- int middle_height = height - top_image->height() - bottom_image->height();
+void DownloadItemView::PaintBitmaps(gfx::Canvas* canvas,
+ const SkBitmap* top_bitmap,
+ const SkBitmap* center_bitmap,
+ const SkBitmap* bottom_bitmap,
+ int x, int y, int height, int width) {
+ int middle_height = height - top_bitmap->height() - bottom_bitmap->height();
// Draw the top.
- canvas->DrawBitmapInt(*top_image,
- 0, 0, top_image->width(), top_image->height(),
- x, y, width, top_image->height(), false);
- y += top_image->height();
+ canvas->DrawBitmapInt(*top_bitmap,
+ 0, 0, top_bitmap->width(), top_bitmap->height(),
+ x, y, width, top_bitmap->height(), false);
+ y += top_bitmap->height();
// Draw the center.
- canvas->DrawBitmapInt(*center_image,
- 0, 0, center_image->width(), center_image->height(),
+ canvas->DrawBitmapInt(*center_bitmap,
+ 0, 0, center_bitmap->width(), center_bitmap->height(),
x, y, width, middle_height, false);
y += middle_height;
// Draw the bottom.
- canvas->DrawBitmapInt(*bottom_image,
- 0, 0, bottom_image->width(), bottom_image->height(),
- x, y, width, bottom_image->height(), false);
+ canvas->DrawBitmapInt(*bottom_bitmap,
+ 0, 0, bottom_bitmap->width(), bottom_bitmap->height(),
+ x, y, width, bottom_bitmap->height(), false);
}
void DownloadItemView::SetState(State body_state, State drop_down_state) {
@@ -1033,10 +1033,10 @@ void DownloadItemView::ShowWarningDialog() {
// The dangerous download label text and icon are different under
// different cases.
if (mode_ == MALICIOUS_MODE) {
- warning_icon_ = rb.GetImageSkiaNamed(IDR_SAFEBROWSING_WARNING);
+ warning_icon_ = rb.GetBitmapNamed(IDR_SAFEBROWSING_WARNING);
} else {
// The download file has dangerous file type (e.g.: an executable).
- warning_icon_ = rb.GetImageSkiaNamed(IDR_WARNING);
+ warning_icon_ = rb.GetBitmapNamed(IDR_WARNING);
}
string16 dangerous_label = model_->GetWarningText(font_, kTextWidth);
dangerous_download_label_ = new views::Label(dangerous_label);
diff --git a/chrome/browser/ui/views/download/download_item_view.h b/chrome/browser/ui/views/download/download_item_view.h
index 342f538..387ab47 100644
--- a/chrome/browser/ui/views/download/download_item_view.h
+++ b/chrome/browser/ui/views/download/download_item_view.h
@@ -37,11 +37,11 @@
class BaseDownloadItemModel;
class DownloadShelfView;
+class SkBitmap;
class DownloadShelfContextMenuView;
namespace gfx {
class Image;
-class ImageSkia;
}
namespace ui {
@@ -120,22 +120,22 @@ class DownloadItemView : public views::ButtonListener,
// The image set associated with the part containing the icon and text.
struct BodyImageSet {
- gfx::ImageSkia* top_left;
- gfx::ImageSkia* left;
- gfx::ImageSkia* bottom_left;
- gfx::ImageSkia* top;
- gfx::ImageSkia* center;
- gfx::ImageSkia* bottom;
- gfx::ImageSkia* top_right;
- gfx::ImageSkia* right;
- gfx::ImageSkia* bottom_right;
+ SkBitmap* top_left;
+ SkBitmap* left;
+ SkBitmap* bottom_left;
+ SkBitmap* top;
+ SkBitmap* center;
+ SkBitmap* bottom;
+ SkBitmap* top_right;
+ SkBitmap* right;
+ SkBitmap* bottom_right;
};
// The image set associated with the drop-down button on the right.
struct DropDownImageSet {
- gfx::ImageSkia* top;
- gfx::ImageSkia* center;
- gfx::ImageSkia* bottom;
+ SkBitmap* top;
+ SkBitmap* center;
+ SkBitmap* bottom;
};
void OpenDownload();
@@ -143,12 +143,12 @@ class DownloadItemView : public views::ButtonListener,
void LoadIcon();
void LoadIconIfItemPathChanged();
- // Convenience method to paint the 3 vertical images (bottom, middle, top)
+ // Convenience method to paint the 3 vertical bitmaps (bottom, middle, top)
// that form the background.
- void PaintImages(gfx::Canvas* canvas,
- const gfx::ImageSkia* top_image,
- const gfx::ImageSkia* center_image,
- const gfx::ImageSkia* bottom_image,
+ void PaintBitmaps(gfx::Canvas* canvas,
+ const SkBitmap* top_bitmap,
+ const SkBitmap* center_bitmap,
+ const SkBitmap* bottom_bitmap,
int x,
int y,
int height,
@@ -208,7 +208,7 @@ class DownloadItemView : public views::ButtonListener,
DropDownImageSet pushed_drop_down_image_set_;
// The warning icon showns for dangerous downloads.
- const gfx::ImageSkia* warning_icon_;
+ const SkBitmap* warning_icon_;
// The model we query for display information
content::DownloadItem* download_;
diff --git a/chrome/browser/ui/views/dropdown_bar_view.cc b/chrome/browser/ui/views/dropdown_bar_view.cc
index 4ef555b..42e1f3b 100644
--- a/chrome/browser/ui/views/dropdown_bar_view.cc
+++ b/chrome/browser/ui/views/dropdown_bar_view.cc
@@ -63,7 +63,7 @@ void DropdownBackground::Paint(gfx::Canvas* canvas, views::View* view) const {
origin = browser_view_->OffsetPointForToolbarBackgroundImage(origin);
ui::ThemeProvider* tp = view->GetThemeProvider();
- gfx::ImageSkia background = *tp->GetImageSkiaNamed(IDR_THEME_TOOLBAR);
+ SkBitmap background = *tp->GetBitmapNamed(IDR_THEME_TOOLBAR);
int left_edge_width = left_alpha_mask_->width();
int right_edge_width = right_alpha_mask_->width();
@@ -129,11 +129,11 @@ void DropdownBarView::SetBackground(const gfx::ImageSkia* left_alpha_mask,
right_alpha_mask));
}
-void DropdownBarView::SetBorder(int left_border_image_id,
- int middle_border_image_id,
- int right_border_image_id) {
- int border_image_ids[3] = {left_border_image_id, middle_border_image_id,
- right_border_image_id};
+void DropdownBarView::SetBorder(int left_border_bitmap_id,
+ int middle_border_bitmap_id,
+ int right_border_bitmap_id) {
+ int border_bitmap_ids[3] = {left_border_bitmap_id, middle_border_bitmap_id,
+ right_border_bitmap_id};
set_border(views::Border::CreateBorderPainter(
- new views::HorizontalPainter(border_image_ids)));
+ new views::HorizontalPainter(border_bitmap_ids)));
}
diff --git a/chrome/browser/ui/views/dropdown_bar_view.h b/chrome/browser/ui/views/dropdown_bar_view.h
index 25257a0..a8b7c01 100644
--- a/chrome/browser/ui/views/dropdown_bar_view.h
+++ b/chrome/browser/ui/views/dropdown_bar_view.h
@@ -43,8 +43,8 @@ class DropdownBarView : public views::AccessiblePaneView,
void SetBackground(const gfx::ImageSkia* left_alpha_mask,
const gfx::ImageSkia* right_alpha_mask);
- void SetBorder(int left_border_image_id, int middle_border_image_id,
- int right_border_image_id);
+ void SetBorder(int left_border_bitmap_id, int middle_border_bitmap_id,
+ int right_border_bitmap_id);
private:
// The dropdown bar host that controls this view.
diff --git a/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc b/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc
index 9b51512..6b348bd 100644
--- a/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc
+++ b/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc
@@ -62,7 +62,7 @@ const int kHeadingFontSizeDelta = 1;
const int kRatingFontSizeDelta = -1;
-void AddResourceIcon(const gfx::ImageSkia* skia_image, void* data) {
+void AddResourceIcon(const SkBitmap* skia_image, void* data) {
views::View* parent = static_cast<views::View*>(data);
views::ImageView* image_view = new views::ImageView();
image_view->SetImage(*skia_image);
@@ -184,13 +184,13 @@ ExtensionInstallDialogView::ExtensionInstallDialogView(
if (!is_bundle_install()) {
// Scale down to icon size, but allow smaller icons (don't scale up).
- const gfx::ImageSkia* image = prompt.icon().ToImageSkia();
- gfx::Size size(image->width(), image->height());
+ const SkBitmap* bitmap = prompt.icon().ToSkBitmap();
+ gfx::Size size(bitmap->width(), bitmap->height());
if (size.width() > kIconSize || size.height() > kIconSize)
size = gfx::Size(kIconSize, kIconSize);
views::ImageView* icon = new views::ImageView();
icon->SetImageSize(size);
- icon->SetImage(*image);
+ icon->SetImage(*bitmap);
icon->SetHorizontalAlignment(views::ImageView::CENTER);
icon->SetVerticalAlignment(views::ImageView::CENTER);
int icon_row_span = 1;
diff --git a/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc b/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc
index 0da9d4a..75d0fed 100644
--- a/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc
+++ b/chrome/browser/ui/views/extensions/extension_uninstall_dialog_view.cc
@@ -81,7 +81,7 @@ class ExtensionUninstallDialogDelegateView : public views::DialogDelegateView {
ExtensionUninstallDialogDelegateView(
ExtensionUninstallDialogViews* dialog_view,
const extensions::Extension* extension,
- gfx::ImageSkia* icon);
+ SkBitmap* icon);
virtual ~ExtensionUninstallDialogDelegateView();
// Called when the ExtensionUninstallDialog has been destroyed to make sure
@@ -157,7 +157,7 @@ void ExtensionUninstallDialogViews::ExtensionUninstallCanceled() {
ExtensionUninstallDialogDelegateView::ExtensionUninstallDialogDelegateView(
ExtensionUninstallDialogViews* dialog_view,
const extensions::Extension* extension,
- gfx::ImageSkia* icon)
+ SkBitmap* icon)
: dialog_(dialog_view) {
// Scale down to icon size, but allow smaller icons (don't scale up).
gfx::Size size(icon->width(), icon->height());
diff --git a/chrome/browser/ui/views/find_bar_view.cc b/chrome/browser/ui/views/find_bar_view.cc
index dd92b6c..34695e0 100644
--- a/chrome/browser/ui/views/find_bar_view.cc
+++ b/chrome/browser/ui/views/find_bar_view.cc
@@ -147,12 +147,11 @@ FindBarView::FindBarView(FindBarHost* host)
SetBorder(IDR_FIND_DIALOG_LEFT, IDR_FIND_DIALOG_MIDDLE,
IDR_FIND_DIALOG_RIGHT);
- preferred_height_ = rb.GetImageSkiaNamed(IDR_FIND_DIALOG_MIDDLE)->height();
+ preferred_height_ = rb.GetBitmapNamed(IDR_FIND_DIALOG_MIDDLE)->height();
// Background images for the Find edit box.
- text_box_background_ = rb.GetImageSkiaNamed(IDR_FIND_BOX_BACKGROUND);
- text_box_background_left_ =
- rb.GetImageSkiaNamed(IDR_FIND_BOX_BACKGROUND_LEFT);
+ text_box_background_ = rb.GetBitmapNamed(IDR_FIND_BOX_BACKGROUND);
+ text_box_background_left_ = rb.GetBitmapNamed(IDR_FIND_BOX_BACKGROUND_LEFT);
EnableCanvasFlippingForRTLUI(true);
}
diff --git a/chrome/browser/ui/views/find_bar_view.h b/chrome/browser/ui/views/find_bar_view.h
index fcc704f..5ccfedb 100644
--- a/chrome/browser/ui/views/find_bar_view.h
+++ b/chrome/browser/ui/views/find_bar_view.h
@@ -140,10 +140,10 @@ class FindBarView : public DropdownBarView,
// The background image for the Find text box, which we draw behind the Find
// box to provide the Chrome look to the edge of the text box.
- const gfx::ImageSkia* text_box_background_;
+ const SkBitmap* text_box_background_;
// The rounded edge on the left side of the Find text box.
- const gfx::ImageSkia* text_box_background_left_;
+ const SkBitmap* text_box_background_left_;
DISALLOW_COPY_AND_ASSIGN(FindBarView);
};
diff --git a/chrome/browser/ui/views/infobars/extension_infobar.cc b/chrome/browser/ui/views/infobars/extension_infobar.cc
index 0811dd7..646ec46 100644
--- a/chrome/browser/ui/views/infobars/extension_infobar.cc
+++ b/chrome/browser/ui/views/infobars/extension_infobar.cc
@@ -108,19 +108,18 @@ void ExtensionInfoBar::OnImageLoaded(const gfx::Image& image,
if (!GetDelegate())
return; // The delegate can go away while we asynchronously load images.
- const gfx::ImageSkia* icon = NULL;
+ const SkBitmap* icon = NULL;
// Fall back on the default extension icon on failure.
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
if (image.IsEmpty())
- icon = rb.GetImageNamed(IDR_EXTENSIONS_SECTION).ToImageSkia();
+ icon = rb.GetImageNamed(IDR_EXTENSIONS_SECTION).ToSkBitmap();
else
- icon = image.ToImageSkia();
+ icon = image.ToSkBitmap();
- const gfx::ImageSkia* drop_image =
- rb.GetImageNamed(IDR_APP_DROPARROW).ToImageSkia();
+ const SkBitmap* drop_image = rb.GetImageNamed(IDR_APP_DROPARROW).ToSkBitmap();
int image_size = ExtensionIconSet::EXTENSION_ICON_BITTY;
- // The margin between the extension icon and the drop-down arrow image.
+ // The margin between the extension icon and the drop-down arrow bitmap.
static const int kDropArrowLeftMargin = 3;
scoped_ptr<gfx::Canvas> canvas(new gfx::Canvas(
gfx::Size(image_size + kDropArrowLeftMargin + drop_image->width(),
diff --git a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
index 540180c..2df74e6 100644
--- a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
+++ b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.cc
@@ -58,8 +58,8 @@ void IconLabelBubbleView::SetLabel(const string16& label) {
label_->SetText(label);
}
-void IconLabelBubbleView::SetImage(const gfx::ImageSkia& image_skia) {
- image_->SetImage(image_skia);
+void IconLabelBubbleView::SetImage(const SkBitmap& bitmap) {
+ image_->SetImage(bitmap);
}
void IconLabelBubbleView::OnPaint(gfx::Canvas* canvas) {
@@ -92,7 +92,7 @@ gfx::Size IconLabelBubbleView::GetNonLabelSize() const {
int IconLabelBubbleView::GetPreLabelWidth() const {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
return GetBubbleOuterPadding() +
- rb.GetImageSkiaNamed(IDR_OMNIBOX_SEARCH)->width() +
+ rb.GetBitmapNamed(IDR_OMNIBOX_SEARCH)->width() +
LocationBarView::GetItemPadding();
}
diff --git a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.h b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.h
index 55f03f1..0764c85 100644
--- a/chrome/browser/ui/views/location_bar/icon_label_bubble_view.h
+++ b/chrome/browser/ui/views/location_bar/icon_label_bubble_view.h
@@ -16,14 +16,14 @@
namespace gfx {
class Canvas;
class Font;
-class ImageSkia;
}
-
namespace views {
class ImageView;
class Label;
}
+class SkBitmap;
+
// View used to draw a bubble to the left of the address, containing an icon and
// a label. We use this as a base for the classes that handle the EV bubble and
// tab-to-search UI.
@@ -36,7 +36,7 @@ class IconLabelBubbleView : public views::View {
void SetFont(const gfx::Font& font);
void SetLabel(const string16& label);
- void SetImage(const gfx::ImageSkia& image);
+ void SetImage(const SkBitmap& bitmap);
void set_is_extension_icon(bool is_extension_icon) {
is_extension_icon_ = is_extension_icon;
}
diff --git a/chrome/browser/ui/views/location_bar/keyword_hint_view.cc b/chrome/browser/ui/views/location_bar/keyword_hint_view.cc
index 686cc62..d514f94 100644
--- a/chrome/browser/ui/views/location_bar/keyword_hint_view.cc
+++ b/chrome/browser/ui/views/location_bar/keyword_hint_view.cc
@@ -15,25 +15,25 @@
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "grit/generated_resources.h"
#include "grit/theme_resources.h"
+#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
-#include "ui/gfx/image/image_skia.h"
#include "ui/views/controls/label.h"
// Amount of space to offset the tab image from the top of the view by.
static const int kTabImageYOffset = 4;
// The tab key image.
-static const gfx::ImageSkia* kTabButtonImage = NULL;
+static const SkBitmap* kTabButtonBitmap = NULL;
KeywordHintView::KeywordHintView(Profile* profile) : profile_(profile) {
leading_label_ = CreateLabel();
trailing_label_ = CreateLabel();
- if (!kTabButtonImage) {
+ if (!kTabButtonBitmap) {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- kTabButtonImage = rb.GetImageSkiaNamed(IDR_LOCATION_BAR_KEYWORD_HINT_TAB);
+ kTabButtonBitmap = rb.GetBitmapNamed(IDR_LOCATION_BAR_KEYWORD_HINT_TAB);
}
}
@@ -85,10 +85,10 @@ void KeywordHintView::OnPaint(gfx::Canvas* canvas) {
// is right-to-left.
gfx::Rect tab_button_bounds(image_x,
kTabImageYOffset,
- kTabButtonImage->width(),
- kTabButtonImage->height());
+ kTabButtonBitmap->width(),
+ kTabButtonBitmap->height());
tab_button_bounds.set_x(GetMirroredXForRect(tab_button_bounds));
- canvas->DrawBitmapInt(*kTabButtonImage,
+ canvas->DrawBitmapInt(*kTabButtonBitmap,
tab_button_bounds.x(),
tab_button_bounds.y());
}
@@ -98,7 +98,7 @@ gfx::Size KeywordHintView::GetPreferredSize() {
// added this should check baselines.
gfx::Size prefsize = leading_label_->GetPreferredSize();
int width = prefsize.width();
- width += kTabButtonImage->width();
+ width += kTabButtonBitmap->width();
prefsize = trailing_label_->GetPreferredSize();
width += prefsize.width();
return gfx::Size(width, prefsize.height());
@@ -107,12 +107,12 @@ gfx::Size KeywordHintView::GetPreferredSize() {
gfx::Size KeywordHintView::GetMinimumSize() {
// TODO(sky): currently height doesn't matter, once baseline support is
// added this should check baselines.
- return gfx::Size(kTabButtonImage->width(), 0);
+ return gfx::Size(kTabButtonBitmap->width(), 0);
}
void KeywordHintView::Layout() {
// TODO(sky): baseline layout.
- bool show_labels = (width() != kTabButtonImage->width());
+ bool show_labels = (width() != kTabButtonBitmap->width());
leading_label_->SetVisible(show_labels);
trailing_label_->SetVisible(show_labels);
@@ -123,7 +123,7 @@ void KeywordHintView::Layout() {
pref = leading_label_->GetPreferredSize();
leading_label_->SetBounds(x, 0, pref.width(), height());
- x += pref.width() + kTabButtonImage->width();
+ x += pref.width() + kTabButtonBitmap->width();
pref = trailing_label_->GetPreferredSize();
trailing_label_->SetBounds(x, 0, pref.width(), height());
}
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
index 96b3072..0a5408f 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -160,7 +160,7 @@ LocationBarView::LocationBarView(Profile* profile,
painter_.reset(
views::Painter::CreateImagePainter(
*ui::ResourceBundle::GetSharedInstance().GetImageNamed(
- IDR_LOCATION_BAR_BORDER).ToImageSkia(),
+ IDR_LOCATION_BAR_BORDER).ToSkBitmap(),
gfx::Insets(kBorderRoundCornerHeight, kBorderRoundCornerWidth,
kBorderRoundCornerHeight, kBorderRoundCornerWidth),
true));
@@ -518,7 +518,7 @@ bool LocationBarView::IsLocationEntryFocusableInRootView() const {
}
gfx::Size LocationBarView::GetPreferredSize() {
- return gfx::Size(0, GetThemeProvider()->GetImageSkiaNamed(mode_ == POPUP ?
+ return gfx::Size(0, GetThemeProvider()->GetBitmapNamed(mode_ == POPUP ?
IDR_LOCATIONBG_POPUPMODE_CENTER : IDR_LOCATIONBG_C)->height());
}
@@ -781,7 +781,7 @@ void LocationBarView::OnPaint(gfx::Canvas* canvas) {
if (painter_.get()) {
painter_->Paint(canvas, size());
} else if (mode_ == POPUP) {
- canvas->TileImageInt(*GetThemeProvider()->GetImageSkiaNamed(
+ canvas->TileImageInt(*GetThemeProvider()->GetBitmapNamed(
IDR_LOCATIONBG_POPUPMODE_CENTER), 0, 0, 0, 0, width(), height());
}
// When used in the app launcher, don't draw a border, the LocationBarView has
diff --git a/chrome/browser/ui/views/menu_item_view_test.cc b/chrome/browser/ui/views/menu_item_view_test.cc
index d2f6c19..352f27f 100644
--- a/chrome/browser/ui/views/menu_item_view_test.cc
+++ b/chrome/browser/ui/views/menu_item_view_test.cc
@@ -215,7 +215,7 @@ class MenuItemViewTestInsert : public MenuItemViewTestBase {
inserted_item_ = menu_->AddMenuItemAt(INSERT_INDEX,
1000,
ASCIIToUTF16("inserted item"),
- gfx::ImageSkia(),
+ SkBitmap(),
views::MenuItemView::NORMAL);
ASSERT_TRUE(inserted_item_);
menu_->ChildrenChanged();
@@ -325,7 +325,7 @@ class MenuItemViewTestInsertWithSubmenu : public MenuItemViewTestBase {
inserted_item_ = menu_->AddMenuItemAt(INSERT_INDEX,
1000,
ASCIIToUTF16("inserted item"),
- gfx::ImageSkia(),
+ SkBitmap(),
views::MenuItemView::NORMAL);
ASSERT_TRUE(inserted_item_);
menu_->ChildrenChanged();
diff --git a/chrome/browser/ui/views/notifications/balloon_view.cc b/chrome/browser/ui/views/notifications/balloon_view.cc
index dc97e9b..9644487 100644
--- a/chrome/browser/ui/views/notifications/balloon_view.cc
+++ b/chrome/browser/ui/views/notifications/balloon_view.cc
@@ -390,11 +390,9 @@ void BalloonViewImpl::Show(Balloon* balloon) {
rb.GetImageSkiaNamed(IDR_TAB_CLOSE),
rb.GetImageSkiaNamed(IDR_TAB_CLOSE_MASK));
- options_menu_button_->SetIcon(*rb.GetImageSkiaNamed(IDR_BALLOON_WRENCH));
- options_menu_button_->SetHoverIcon(
- *rb.GetImageSkiaNamed(IDR_BALLOON_WRENCH_H));
- options_menu_button_->SetPushedIcon(*rb.GetImageSkiaNamed(
- IDR_BALLOON_WRENCH_P));
+ options_menu_button_->SetIcon(*rb.GetBitmapNamed(IDR_BALLOON_WRENCH));
+ options_menu_button_->SetHoverIcon(*rb.GetBitmapNamed(IDR_BALLOON_WRENCH_H));
+ options_menu_button_->SetPushedIcon(*rb.GetBitmapNamed(IDR_BALLOON_WRENCH_P));
options_menu_button_->set_alignment(views::TextButton::ALIGN_CENTER);
options_menu_button_->set_border(NULL);
options_menu_button_->SetBoundsRect(GetOptionsButtonBounds());
diff --git a/chrome/browser/ui/views/page_info_bubble_view.cc b/chrome/browser/ui/views/page_info_bubble_view.cc
index c4e0bc7..5456668 100644
--- a/chrome/browser/ui/views/page_info_bubble_view.cc
+++ b/chrome/browser/ui/views/page_info_bubble_view.cc
@@ -55,7 +55,7 @@ class Section : public views::View,
public:
Section(PageInfoBubbleView* owner,
const PageInfoModel::SectionInfo& section_info,
- const gfx::ImageSkia* status_icon,
+ const SkBitmap* status_icon,
bool show_cert);
virtual ~Section();
@@ -191,8 +191,7 @@ void PageInfoBubbleView::LayoutSections() {
if (count == 1 && info.type == PageInfoModel::SECTION_INFO_INTERNAL_PAGE)
only_internal_section = true;
layout->StartRow(0, 0);
- const gfx::ImageSkia* icon = model_.GetIconImage(
- info.icon_id)->ToImageSkia();
+ const SkBitmap* icon = model_.GetIconImage(info.icon_id)->ToSkBitmap();
Section* section = new Section(this, info, icon, cert_id_ > 0);
if (info.type == PageInfoModel::SECTION_INFO_FIRST_VISIT) {
// This section is animated into view, so we need to set the height of it
@@ -240,8 +239,7 @@ gfx::Size PageInfoBubbleView::GetPreferredSize() {
int count = model_.GetSectionCount();
for (int i = 0; i < count; ++i) {
PageInfoModel::SectionInfo info = model_.GetSectionInfo(i);
- const gfx::ImageSkia* icon = model_.GetIconImage(
- info.icon_id)->ToImageSkia();
+ const SkBitmap* icon = model_.GetIconImage(info.icon_id)->ToSkBitmap();
Section section(this, info, icon, cert_id_ > 0);
size.Enlarge(0, section.GetHeightForWidth(size.width()));
}
@@ -315,7 +313,7 @@ void PageInfoBubbleView::AnimationProgressed(const ui::Animation* animation) {
Section::Section(PageInfoBubbleView* owner,
const PageInfoModel::SectionInfo& section_info,
- const gfx::ImageSkia* state_icon,
+ const SkBitmap* state_icon,
bool show_cert)
: owner_(owner),
info_(section_info),
diff --git a/chrome/browser/ui/views/speech_recognition_bubble_views.cc b/chrome/browser/ui/views/speech_recognition_bubble_views.cc
index 1a6f738..913b4ea 100644
--- a/chrome/browser/ui/views/speech_recognition_bubble_views.cc
+++ b/chrome/browser/ui/views/speech_recognition_bubble_views.cc
@@ -51,8 +51,8 @@ class SpeechRecognitionBubbleView
void UpdateLayout(SpeechRecognitionBubbleBase::DisplayMode mode,
const string16& message_text,
- const gfx::ImageSkia& image);
- void SetImage(const gfx::ImageSkia& image);
+ const SkBitmap& image);
+ void SetImage(const SkBitmap& image);
// views::BubbleDelegateView methods.
virtual void OnWidgetActivationChanged(views::Widget* widget,
@@ -109,7 +109,7 @@ SpeechRecognitionBubbleView::SpeechRecognitionBubbleView(
cancel_(NULL),
mic_settings_(NULL),
display_mode_(SpeechRecognitionBubbleBase::DISPLAY_MODE_WARM_UP),
- kIconLayoutMinWidth(ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
+ kIconLayoutMinWidth(ResourceBundle::GetSharedInstance().GetBitmapNamed(
IDR_SPEECH_INPUT_MIC_EMPTY)->width()) {
// The bubble lifetime is managed by its controller; closing on escape or
// explicitly closing on deactivation will cause unexpected behavior.
@@ -175,7 +175,7 @@ void SpeechRecognitionBubbleView::Init() {
void SpeechRecognitionBubbleView::UpdateLayout(
SpeechRecognitionBubbleBase::DisplayMode mode,
const string16& message_text,
- const gfx::ImageSkia& image) {
+ const SkBitmap& image) {
display_mode_ = mode;
bool is_message = (mode == SpeechRecognitionBubbleBase::DISPLAY_MODE_MESSAGE);
icon_->SetVisible(!is_message);
@@ -210,7 +210,7 @@ void SpeechRecognitionBubbleView::UpdateLayout(
SizeToContents();
}
-void SpeechRecognitionBubbleView::SetImage(const gfx::ImageSkia& image) {
+void SpeechRecognitionBubbleView::SetImage(const SkBitmap& image) {
icon_->SetImage(image);
}
diff --git a/chrome/browser/ui/views/tab_icon_view.cc b/chrome/browser/ui/views/tab_icon_view.cc
index 800a163..748b3aa 100644
--- a/chrome/browser/ui/views/tab_icon_view.cc
+++ b/chrome/browser/ui/views/tab_icon_view.cc
@@ -11,7 +11,6 @@
#include "base/file_util.h"
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
#include "chrome/app/chrome_command_ids.h"
#include "grit/theme_resources.h"
#include "grit/ui_resources.h"
@@ -27,7 +26,7 @@
#endif
static bool g_initialized = false;
-static gfx::ImageSkia* g_default_favicon = NULL;
+static SkBitmap* g_default_favicon = NULL;
// static
void TabIconView::InitializeIfNeeded() {
@@ -38,13 +37,12 @@ void TabIconView::InitializeIfNeeded() {
// The default window icon is the application icon, not the default
// favicon.
HICON app_icon = GetAppIcon();
- scoped_ptr<SkBitmap> bitmap(
- IconUtil::CreateSkBitmapFromHICON(app_icon, gfx::Size(16, 16)));
- g_default_favicon = new gfx::ImageSkia(*bitmap);
+ g_default_favicon =
+ IconUtil::CreateSkBitmapFromHICON(app_icon, gfx::Size(16, 16));
DestroyIcon(app_icon);
#else
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- g_default_favicon = rb.GetImageSkiaNamed(IDR_PRODUCT_LOGO_16);
+ g_default_favicon = rb.GetBitmapNamed(IDR_PRODUCT_LOGO_16);
#endif
}
}
@@ -65,8 +63,8 @@ void TabIconView::Update() {
static int throbber_frame_count = 0;
if (!initialized) {
initialized = true;
- gfx::ImageSkia throbber(*ui::ResourceBundle::GetSharedInstance().
- GetImageSkiaNamed(IDR_THROBBER));
+ SkBitmap throbber(
+ *ui::ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_THROBBER));
throbber_frame_count = throbber.width() / throbber.height();
}
@@ -92,19 +90,19 @@ void TabIconView::Update() {
}
void TabIconView::PaintThrobber(gfx::Canvas* canvas) {
- gfx::ImageSkia throbber(*GetThemeProvider()->GetImageSkiaNamed(
+ SkBitmap throbber(*GetThemeProvider()->GetBitmapNamed(
is_light_ ? IDR_THROBBER_LIGHT : IDR_THROBBER));
int image_size = throbber.height();
PaintIcon(canvas, throbber, throbber_frame_ * image_size, 0, image_size,
image_size, false);
}
-void TabIconView::PaintFavicon(gfx::Canvas* canvas, const SkBitmap& image) {
- PaintIcon(canvas, image, 0, 0, image.width(), image.height(), true);
+void TabIconView::PaintFavicon(gfx::Canvas* canvas, const SkBitmap& bitmap) {
+ PaintIcon(canvas, bitmap, 0, 0, bitmap.width(), bitmap.height(), true);
}
void TabIconView::PaintIcon(gfx::Canvas* canvas,
- const gfx::ImageSkia& image,
+ const SkBitmap& bitmap,
int src_x,
int src_y,
int src_w,
@@ -130,7 +128,7 @@ void TabIconView::PaintIcon(gfx::Canvas* canvas,
int dest_h = static_cast<int>(float_src_h * scale);
// Center the scaled image.
- canvas->DrawBitmapInt(image, src_x, src_y, src_w, src_h,
+ canvas->DrawBitmapInt(bitmap, src_x, src_y, src_w, src_h,
(width() - dest_w) / 2, (height() - dest_h) / 2, dest_w,
dest_h, filter);
}
diff --git a/chrome/browser/ui/views/tab_icon_view.h b/chrome/browser/ui/views/tab_icon_view.h
index b807790..ffbc8c5 100644
--- a/chrome/browser/ui/views/tab_icon_view.h
+++ b/chrome/browser/ui/views/tab_icon_view.h
@@ -9,8 +9,6 @@
#include "base/compiler_specific.h"
#include "ui/views/view.h"
-class SkBitmap;
-
namespace gfx {
class ImageSkia;
}
@@ -51,7 +49,7 @@ class TabIconView : public views::View {
void PaintThrobber(gfx::Canvas* canvas);
void PaintFavicon(gfx::Canvas* canvas, const SkBitmap& bitmap);
void PaintIcon(gfx::Canvas* canvas,
- const gfx::ImageSkia& image,
+ const SkBitmap& bitmap,
int src_x,
int src_y,
int src_w,
diff --git a/chrome/browser/ui/views/tabs/base_tab.cc b/chrome/browser/ui/views/tabs/base_tab.cc
index 34d7dca..7f87bae 100644
--- a/chrome/browser/ui/views/tabs/base_tab.cc
+++ b/chrome/browser/ui/views/tabs/base_tab.cc
@@ -93,7 +93,7 @@ namespace {
// Draws the icon image at the center of |bounds|.
void DrawIconCenter(gfx::Canvas* canvas,
- const gfx::ImageSkia& image,
+ const SkBitmap& image,
int image_offset,
int icon_width,
int icon_height,
@@ -422,11 +422,10 @@ void BaseTab::AdvanceLoadingAnimation(TabRendererData::NetworkState old_state,
if (!initialized) {
initialized = true;
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- gfx::ImageSkia loading_animation(*rb.GetImageSkiaNamed(IDR_THROBBER));
+ SkBitmap loading_animation(*rb.GetBitmapNamed(IDR_THROBBER));
loading_animation_frame_count =
loading_animation.width() / loading_animation.height();
- gfx::ImageSkia waiting_animation(*rb.GetImageSkiaNamed(
- IDR_THROBBER_WAITING));
+ SkBitmap waiting_animation(*rb.GetBitmapNamed(IDR_THROBBER_WAITING));
waiting_animation_frame_count =
waiting_animation.width() / waiting_animation.height();
waiting_to_loading_frame_count_ratio =
@@ -461,7 +460,7 @@ void BaseTab::PaintIcon(gfx::Canvas* canvas) {
if (data().network_state != TabRendererData::NETWORK_STATE_NONE) {
ui::ThemeProvider* tp = GetThemeProvider();
- gfx::ImageSkia frames(*tp->GetImageSkiaNamed(
+ SkBitmap frames(*tp->GetBitmapNamed(
(data().network_state == TabRendererData::NETWORK_STATE_WAITING) ?
IDR_THROBBER_WAITING : IDR_THROBBER));
@@ -474,7 +473,7 @@ void BaseTab::PaintIcon(gfx::Canvas* canvas) {
canvas->ClipRect(GetLocalBounds());
if (should_display_crashed_favicon_) {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- gfx::ImageSkia crashed_favicon(*rb.GetImageSkiaNamed(IDR_SAD_FAVICON));
+ SkBitmap crashed_favicon(*rb.GetBitmapNamed(IDR_SAD_FAVICON));
bounds.set_y(bounds.y() + favicon_hiding_offset_);
DrawIconCenter(canvas, crashed_favicon, 0,
crashed_favicon.width(),
diff --git a/chrome/browser/ui/views/tabs/tab.cc b/chrome/browser/ui/views/tabs/tab.cc
index f95563f..6cfd088 100644
--- a/chrome/browser/ui/views/tabs/tab.cc
+++ b/chrome/browser/ui/views/tabs/tab.cc
@@ -244,7 +244,7 @@ gfx::Size Tab::GetBasicMinimumUnselectedSize() {
gfx::Size minimum_size;
minimum_size.set_width(left_padding() + right_padding());
- // Since we use image images, the real minimum height of the image is
+ // Since we use bitmap images, the real minimum height of the image is
// defined most accurately by the height of the end cap images.
minimum_size.set_height(tab_active_.image_l->height());
return minimum_size;
@@ -500,7 +500,7 @@ void Tab::PaintInactiveTabBackgroundWithTitleChange(gfx::Canvas* canvas) {
gfx::Canvas background_canvas(size(), false);
PaintInactiveTabBackground(&background_canvas);
- gfx::ImageSkia background_image = background_canvas.ExtractBitmap();
+ SkBitmap background_image = background_canvas.ExtractBitmap();
// Draw a radial gradient to hover_canvas.
gfx::Canvas hover_canvas(size(), false);
@@ -529,7 +529,7 @@ void Tab::PaintInactiveTabBackgroundWithTitleChange(gfx::Canvas* canvas) {
paint);
// Draw the radial gradient clipped to the background into hover_image.
- gfx::ImageSkia hover_image = SkBitmapOperations::CreateMaskedBitmap(
+ SkBitmap hover_image = SkBitmapOperations::CreateMaskedBitmap(
hover_canvas.ExtractBitmap(), background_image);
// Draw the tab background to the canvas.
@@ -559,7 +559,7 @@ void Tab::PaintInactiveTabBackground(gfx::Canvas* canvas) {
IDR_THEME_TAB_BACKGROUND;
}
- gfx::ImageSkia* tab_bg = GetThemeProvider()->GetImageSkiaNamed(tab_id);
+ SkBitmap* tab_bg = GetThemeProvider()->GetBitmapNamed(tab_id);
TabImage* tab_image = &tab_active_;
TabImage* tab_inactive_image = &tab_inactive_;
@@ -571,16 +571,16 @@ void Tab::PaintInactiveTabBackground(gfx::Canvas* canvas) {
int bg_offset_y = GetThemeProvider()->HasCustomImage(tab_id) ?
0 : background_offset_.y();
- // We need a gfx::Canvas object to be able to extract the image from.
+ // We need a gfx::Canvas object to be able to extract the bitmap from.
// We draw everything to this canvas and then output it to the canvas
// parameter in addition to using it to mask the hover glow if needed.
gfx::Canvas background_canvas(size(), false);
// Draw left edge. Don't draw over the toolbar, as we're not the foreground
// tab.
- gfx::ImageSkia tab_l = SkBitmapOperations::CreateTiledBitmap(
+ SkBitmap tab_l = SkBitmapOperations::CreateTiledBitmap(
*tab_bg, offset, bg_offset_y, tab_image->l_width, height());
- gfx::ImageSkia theme_l =
+ SkBitmap theme_l =
SkBitmapOperations::CreateMaskedBitmap(tab_l, *alpha->image_l);
background_canvas.DrawBitmapInt(theme_l,
0, 0, theme_l.width(), theme_l.height() - kToolbarOverlap,
@@ -588,10 +588,10 @@ void Tab::PaintInactiveTabBackground(gfx::Canvas* canvas) {
false);
// Draw right edge. Again, don't draw over the toolbar.
- gfx::ImageSkia tab_r = SkBitmapOperations::CreateTiledBitmap(*tab_bg,
+ SkBitmap tab_r = SkBitmapOperations::CreateTiledBitmap(*tab_bg,
offset + width() - tab_image->r_width, bg_offset_y,
tab_image->r_width, height());
- gfx::ImageSkia theme_r =
+ SkBitmap theme_r =
SkBitmapOperations::CreateMaskedBitmap(tab_r, *alpha->image_r);
background_canvas.DrawBitmapInt(theme_r,
0, 0, theme_r.width(), theme_r.height() - kToolbarOverlap,
@@ -632,23 +632,22 @@ void Tab::PaintActiveTabBackground(gfx::Canvas* canvas) {
ui::ThemeProvider* tp = GetThemeProvider();
DCHECK(tp) << "Unable to get theme provider";
- gfx::ImageSkia* tab_bg =
- GetThemeProvider()->GetImageSkiaNamed(IDR_THEME_TOOLBAR);
+ SkBitmap* tab_bg = GetThemeProvider()->GetBitmapNamed(IDR_THEME_TOOLBAR);
TabImage* tab_image = &tab_active_;
TabImage* alpha = &tab_alpha_;
// Draw left edge.
- gfx::ImageSkia tab_l = SkBitmapOperations::CreateTiledBitmap(
+ SkBitmap tab_l = SkBitmapOperations::CreateTiledBitmap(
*tab_bg, offset, 0, tab_image->l_width, height());
- gfx::ImageSkia theme_l =
+ SkBitmap theme_l =
SkBitmapOperations::CreateMaskedBitmap(tab_l, *alpha->image_l);
canvas->DrawBitmapInt(theme_l, 0, 0);
// Draw right edge.
- gfx::ImageSkia tab_r = SkBitmapOperations::CreateTiledBitmap(*tab_bg,
+ SkBitmap tab_r = SkBitmapOperations::CreateTiledBitmap(*tab_bg,
offset + width() - tab_image->r_width, 0, tab_image->r_width, height());
- gfx::ImageSkia theme_r =
+ SkBitmap theme_r =
SkBitmapOperations::CreateMaskedBitmap(tab_r, *alpha->image_r);
canvas->DrawBitmapInt(theme_r, width() - tab_image->r_width, 0);
@@ -729,18 +728,18 @@ void Tab::LoadTabImages() {
// We're not letting people override tab images just yet.
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- tab_alpha_.image_l = rb.GetImageSkiaNamed(IDR_TAB_ALPHA_LEFT);
- tab_alpha_.image_r = rb.GetImageSkiaNamed(IDR_TAB_ALPHA_RIGHT);
+ tab_alpha_.image_l = rb.GetBitmapNamed(IDR_TAB_ALPHA_LEFT);
+ tab_alpha_.image_r = rb.GetBitmapNamed(IDR_TAB_ALPHA_RIGHT);
- tab_active_.image_l = rb.GetImageSkiaNamed(IDR_TAB_ACTIVE_LEFT);
- tab_active_.image_c = rb.GetImageSkiaNamed(IDR_TAB_ACTIVE_CENTER);
- tab_active_.image_r = rb.GetImageSkiaNamed(IDR_TAB_ACTIVE_RIGHT);
+ tab_active_.image_l = rb.GetBitmapNamed(IDR_TAB_ACTIVE_LEFT);
+ tab_active_.image_c = rb.GetBitmapNamed(IDR_TAB_ACTIVE_CENTER);
+ tab_active_.image_r = rb.GetBitmapNamed(IDR_TAB_ACTIVE_RIGHT);
tab_active_.l_width = tab_active_.image_l->width();
tab_active_.r_width = tab_active_.image_r->width();
- tab_inactive_.image_l = rb.GetImageSkiaNamed(IDR_TAB_INACTIVE_LEFT);
- tab_inactive_.image_c = rb.GetImageSkiaNamed(IDR_TAB_INACTIVE_CENTER);
- tab_inactive_.image_r = rb.GetImageSkiaNamed(IDR_TAB_INACTIVE_RIGHT);
+ tab_inactive_.image_l = rb.GetBitmapNamed(IDR_TAB_INACTIVE_LEFT);
+ tab_inactive_.image_c = rb.GetBitmapNamed(IDR_TAB_INACTIVE_CENTER);
+ tab_inactive_.image_r = rb.GetBitmapNamed(IDR_TAB_INACTIVE_RIGHT);
tab_inactive_.l_width = tab_inactive_.image_l->width();
tab_inactive_.r_width = tab_inactive_.image_r->width();
}
diff --git a/chrome/browser/ui/views/tabs/tab.h b/chrome/browser/ui/views/tabs/tab.h
index 85787fc..15f5831 100644
--- a/chrome/browser/ui/views/tabs/tab.h
+++ b/chrome/browser/ui/views/tabs/tab.h
@@ -117,9 +117,9 @@ class Tab : public BaseTab {
scoped_ptr<ui::MultiAnimation> mini_title_animation_;
struct TabImage {
- gfx::ImageSkia* image_l;
- gfx::ImageSkia* image_c;
- gfx::ImageSkia* image_r;
+ SkBitmap* image_l;
+ SkBitmap* image_c;
+ SkBitmap* image_r;
int l_width;
int r_width;
int y_offset;
diff --git a/chrome/browser/ui/views/tabs/tab_drag_controller.cc b/chrome/browser/ui/views/tabs/tab_drag_controller.cc
index dce441c..c3e7ea9 100644
--- a/chrome/browser/ui/views/tabs/tab_drag_controller.cc
+++ b/chrome/browser/ui/views/tabs/tab_drag_controller.cc
@@ -31,13 +31,13 @@
#include "content/public/browser/user_metrics.h"
#include "content/public/browser/web_contents.h"
#include "grit/theme_resources.h"
+#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/base/animation/animation.h"
#include "ui/base/animation/animation_delegate.h"
#include "ui/base/animation/slide_animation.h"
#include "ui/base/events.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
-#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/screen.h"
#include "ui/views/events/event.h"
#include "ui/views/widget/root_view.h"
@@ -106,8 +106,8 @@ class DockView : public views::View {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- gfx::ImageSkia* high_icon = rb.GetImageSkiaNamed(IDR_DOCK_HIGH);
- gfx::ImageSkia* wide_icon = rb.GetImageSkiaNamed(IDR_DOCK_WIDE);
+ SkBitmap* high_icon = rb.GetBitmapNamed(IDR_DOCK_HIGH);
+ SkBitmap* wide_icon = rb.GetBitmapNamed(IDR_DOCK_WIDE);
canvas->Save();
bool rtl_ui = base::i18n::IsRTL();
@@ -126,8 +126,8 @@ class DockView : public views::View {
canvas->DrawBitmapInt(*high_icon, x_of_active_tab,
(height() - high_icon->height()) / 2);
if (type_ == DockInfo::LEFT_OF_WINDOW) {
- DrawImageWithAlpha(canvas, *high_icon, x_of_inactive_tab,
- (height() - high_icon->height()) / 2);
+ DrawBitmapWithAlpha(canvas, *high_icon, x_of_inactive_tab,
+ (height() - high_icon->height()) / 2);
}
break;
@@ -139,8 +139,8 @@ class DockView : public views::View {
canvas->DrawBitmapInt(*high_icon, x_of_active_tab,
(height() - high_icon->height()) / 2);
if (type_ == DockInfo::RIGHT_OF_WINDOW) {
- DrawImageWithAlpha(canvas, *high_icon, x_of_inactive_tab,
- (height() - high_icon->height()) / 2);
+ DrawBitmapWithAlpha(canvas, *high_icon, x_of_inactive_tab,
+ (height() - high_icon->height()) / 2);
}
break;
@@ -150,7 +150,7 @@ class DockView : public views::View {
break;
case DockInfo::MAXIMIZE: {
- gfx::ImageSkia* max_icon = rb.GetImageSkiaNamed(IDR_DOCK_MAX);
+ SkBitmap* max_icon = rb.GetBitmapNamed(IDR_DOCK_MAX);
canvas->DrawBitmapInt(*max_icon, (width() - max_icon->width()) / 2,
(height() - max_icon->height()) / 2);
break;
@@ -161,7 +161,7 @@ class DockView : public views::View {
canvas->DrawBitmapInt(*wide_icon, (width() - wide_icon->width()) / 2,
height() / 2 + kTabSpacing / 2);
if (type_ == DockInfo::BOTTOM_OF_WINDOW) {
- DrawImageWithAlpha(canvas, *wide_icon,
+ DrawBitmapWithAlpha(canvas, *wide_icon,
(width() - wide_icon->width()) / 2,
height() / 2 - kTabSpacing / 2 - wide_icon->height());
}
@@ -175,8 +175,8 @@ class DockView : public views::View {
}
private:
- void DrawImageWithAlpha(gfx::Canvas* canvas, const gfx::ImageSkia& image,
- int x, int y) {
+ void DrawBitmapWithAlpha(gfx::Canvas* canvas, const SkBitmap& image,
+ int x, int y) {
SkPaint paint;
paint.setAlpha(128);
canvas->DrawBitmapInt(image, x, y, paint);
diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc
index 610db93..9b09e1e 100644
--- a/chrome/browser/ui/views/tabs/tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/tab_strip.cc
@@ -32,13 +32,13 @@
#include "ui/base/dragdrop/drag_drop_types.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/layout.h"
-#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/path.h"
#include "ui/gfx/screen.h"
#include "ui/gfx/size.h"
#include "ui/gfx/skbitmap_operations.h"
+#include "ui/base/layout.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/mouse_watcher_view_host.h"
#include "ui/views/view_model_utils.h"
@@ -324,10 +324,10 @@ void NewTabButton::GetHitTestMask(gfx::Path* path) const {
SkScalar w = SkIntToScalar(width());
- // These values are defined by the shape of the new tab image. Should that
- // image ever change, these values will need to be updated. They're so
+ // These values are defined by the shape of the new tab bitmap. Should that
+ // bitmap ever change, these values will need to be updated. They're so
// custom it's not really worth defining constants for.
- // These values are correct for regular and USE_ASH versions of the image.
+ // These values are correct for regular and USE_ASH versions of the bitmap.
path->moveTo(0, 1);
path->lineTo(w - 7, 1);
path->lineTo(w - 4, 4);
@@ -353,8 +353,8 @@ void NewTabButton::OnMouseReleased(const views::MouseEvent& event) {
#endif
void NewTabButton::OnPaint(gfx::Canvas* canvas) {
- SkBitmap image = GetBitmap();
- canvas->DrawBitmapInt(image, 0, height() - image.height());
+ SkBitmap bitmap = GetBitmap();
+ canvas->DrawBitmapInt(bitmap, 0, height() - bitmap.height());
}
bool NewTabButton::ShouldUseNativeFrame() const {
@@ -386,16 +386,14 @@ SkBitmap NewTabButton::GetBackgroundBitmap(
break;
}
- gfx::ImageSkia* mask =
- GetThemeProvider()->GetImageSkiaNamed(IDR_NEWTAB_BUTTON_MASK);
+ SkBitmap* mask = GetThemeProvider()->GetBitmapNamed(IDR_NEWTAB_BUTTON_MASK);
int height = mask->height();
int width = mask->width();
gfx::Canvas canvas(gfx::Size(width, height), false);
// For custom images the background starts at the top of the tab strip.
// Otherwise the background starts at the top of the frame.
- gfx::ImageSkia* background =
- GetThemeProvider()->GetImageSkiaNamed(background_id);
+ SkBitmap* background = GetThemeProvider()->GetBitmapNamed(background_id);
int offset_y = GetThemeProvider()->HasCustomImage(background_id) ?
0 : background_offset_.y();
canvas.TileImageInt(*background, GetMirroredX() + background_offset_.x(),
@@ -420,7 +418,7 @@ SkBitmap NewTabButton::GetBitmapForState(
views::CustomButton::ButtonState state) const {
int overlay_id = state == views::CustomButton::BS_PUSHED ?
IDR_NEWTAB_BUTTON_P : IDR_NEWTAB_BUTTON;
- gfx::ImageSkia* overlay = GetThemeProvider()->GetImageSkiaNamed(overlay_id);
+ SkBitmap* overlay = GetThemeProvider()->GetBitmapNamed(overlay_id);
gfx::Canvas canvas(gfx::Size(overlay->width(), overlay->height()), false);
canvas.DrawBitmapInt(GetBackgroundBitmap(state), 0, 0);
diff --git a/chrome/browser/ui/views/theme_background.cc b/chrome/browser/ui/views/theme_background.cc
index 6cb8404..52f3f1d 100644
--- a/chrome/browser/ui/views/theme_background.cc
+++ b/chrome/browser/ui/views/theme_background.cc
@@ -21,25 +21,25 @@ ThemeBackground::ThemeBackground(BrowserView* browser_view)
}
void ThemeBackground::Paint(gfx::Canvas* canvas, views::View* view) const {
- gfx::ImageSkia* background;
+ SkBitmap* background;
// Never theme app and popup windows.
if (!browser_view_->IsBrowserTypeNormal()) {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
if (browser_view_->IsActive())
- background = rb.GetImageSkiaNamed(IDR_FRAME);
+ background = rb.GetBitmapNamed(IDR_FRAME);
else
- background = rb.GetImageSkiaNamed(IDR_THEME_FRAME_INACTIVE);
+ background = rb.GetBitmapNamed(IDR_THEME_FRAME_INACTIVE);
} else {
Profile* profile = browser_view_->browser()->profile();
ui::ThemeProvider* theme = ThemeServiceFactory::GetForProfile(profile);
if (browser_view_->IsActive()) {
- background = theme->GetImageSkiaNamed(
+ background = theme->GetBitmapNamed(
profile->IsOffTheRecord() ?
IDR_THEME_FRAME_INCOGNITO : IDR_THEME_FRAME);
} else {
- background = theme->GetImageSkiaNamed(
+ background = theme->GetBitmapNamed(
profile->IsOffTheRecord() ?
IDR_THEME_FRAME_INCOGNITO_INACTIVE : IDR_THEME_FRAME_INACTIVE);
}
diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc
index b53dab9..8c9a979 100644
--- a/chrome/browser/ui/views/toolbar_view.cc
+++ b/chrome/browser/ui/views/toolbar_view.cc
@@ -80,7 +80,7 @@ const int kPopupBottomSpacingGlass = 1;
// corner of the wrench menu).
const int kBadgeTopMargin = 2;
-gfx::ImageSkia* kPopupBackgroundEdge = NULL;
+SkBitmap* kPopupBackgroundEdge = NULL;
// The omnibox border has some additional shadow, so we use less vertical
// spacing than ToolbarView::kVertSpacing.
@@ -137,7 +137,7 @@ ToolbarView::ToolbarView(Browser* browser)
if (!kPopupBackgroundEdge) {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- kPopupBackgroundEdge = rb.GetImageSkiaNamed(IDR_LOCATIONBG_POPUPMODE_EDGE);
+ kPopupBackgroundEdge = rb.GetBitmapNamed(IDR_LOCATIONBG_POPUPMODE_EDGE);
}
registrar_.Add(this, chrome::NOTIFICATION_UPGRADE_RECOMMENDED,
@@ -275,8 +275,7 @@ void ToolbarView::RemoveMenuListener(views::MenuListener* listener) {
menu_listeners_.RemoveObserver(listener);
}
-gfx::ImageSkia ToolbarView::GetAppMenuIcon(
- views::CustomButton::ButtonState state) {
+SkBitmap ToolbarView::GetAppMenuIcon(views::CustomButton::ButtonState state) {
ui::ThemeProvider* tp = GetThemeProvider();
int id = 0;
@@ -286,7 +285,7 @@ gfx::ImageSkia ToolbarView::GetAppMenuIcon(
case views::CustomButton::BS_PUSHED: id = IDR_TOOLS_P; break;
default: NOTREACHED(); break;
}
- gfx::ImageSkia icon = *tp->GetImageSkiaNamed(id);
+ SkBitmap icon = *tp->GetBitmapNamed(id);
#if defined(OS_WIN)
// Keep track of whether we were showing the badge before, so we don't send
@@ -308,24 +307,24 @@ gfx::ImageSkia ToolbarView::GetAppMenuIcon(
// Draw the chrome app menu icon onto the canvas.
scoped_ptr<gfx::Canvas> canvas(new gfx::Canvas(icon, false));
- gfx::ImageSkia badge;
+ SkBitmap badge;
// Only one badge can be active at any given time. The Upgrade notification
// is deemed most important, then the DLL conflict badge.
if (ShouldShowUpgradeRecommended()) {
- badge = *tp->GetImageSkiaNamed(
+ badge = *tp->GetBitmapNamed(
UpgradeDetector::GetInstance()->GetIconResourceID(
UpgradeDetector::UPGRADE_ICON_TYPE_BADGE));
} else if (ShouldShowIncompatibilityWarning()) {
#if defined(OS_WIN)
if (!was_showing)
content::RecordAction(UserMetricsAction("ConflictBadge"));
- badge = *tp->GetImageSkiaNamed(IDR_CONFLICT_BADGE);
+ badge = *tp->GetBitmapNamed(IDR_CONFLICT_BADGE);
incompatibility_badge_showing = true;
#else
NOTREACHED();
#endif
} else if (error_badge_id) {
- badge = *tp->GetImageSkiaNamed(error_badge_id);
+ badge = *tp->GetBitmapNamed(error_badge_id);
} else {
NOTREACHED();
}
@@ -542,10 +541,10 @@ gfx::Size ToolbarView::GetPreferredSize() {
browser_actions_->GetPreferredSize().width() +
app_menu_->GetPreferredSize().width() + kRightEdgeSpacing;
- CR_DEFINE_STATIC_LOCAL(gfx::ImageSkia, normal_background, ());
+ CR_DEFINE_STATIC_LOCAL(SkBitmap, normal_background, ());
if (normal_background.isNull()) {
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- normal_background = *rb.GetImageSkiaNamed(IDR_CONTENT_TOP_CENTER);
+ normal_background = *rb.GetBitmapNamed(IDR_CONTENT_TOP_CENTER);
}
return gfx::Size(min_width,
diff --git a/chrome/browser/ui/views/toolbar_view.h b/chrome/browser/ui/views/toolbar_view.h
index d3e67bc..d77f4e1 100644
--- a/chrome/browser/ui/views/toolbar_view.h
+++ b/chrome/browser/ui/views/toolbar_view.h
@@ -69,9 +69,9 @@ class ToolbarView : public views::AccessiblePaneView,
// Remove a menu listener.
void RemoveMenuListener(views::MenuListener* listener);
- // Gets an image with the icon for the app menu and any overlaid notification
+ // Gets a bitmap with the icon for the app menu and any overlaid notification
// badge.
- gfx::ImageSkia GetAppMenuIcon(views::CustomButton::ButtonState state);
+ SkBitmap GetAppMenuIcon(views::CustomButton::ButtonState state);
virtual bool GetAcceleratorInfo(int id, ui::Accelerator* accel);
@@ -182,7 +182,7 @@ class ToolbarView : public views::AccessiblePaneView,
// Gets a badge for the wrench icon corresponding to the number of
// unacknowledged background pages in the system.
- gfx::ImageSkia GetBackgroundPageBadge();
+ SkBitmap GetBackgroundPageBadge();
scoped_ptr<BackForwardMenuModel> back_menu_model_;
scoped_ptr<BackForwardMenuModel> forward_menu_model_;
diff --git a/chrome/browser/ui/webui/ntp/ntp_login_handler.cc b/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
index df4118a..2f79470 100644
--- a/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_login_handler.cc
@@ -212,8 +212,7 @@ void NTPLoginHandler::UpdateLogin() {
const gfx::Image* image =
cache.GetGAIAPictureOfProfileAtIndex(profile_index);
if (image)
- icon_url = web_ui_util::GetImageDataUrl(gfx::ImageSkia(
- GetGAIAPictureForNTP(*image)));
+ icon_url = web_ui_util::GetImageDataUrl(GetGAIAPictureForNTP(*image));
}
if (header.empty())
header = CreateSpanWithClass(UTF8ToUTF16(username), "profile-name");
diff --git a/chrome/browser/ui/webui/options2/browser_options_handler2.cc b/chrome/browser/ui/webui/options2/browser_options_handler2.cc
index 195f8a2..511af7d 100644
--- a/chrome/browser/ui/webui/options2/browser_options_handler2.cc
+++ b/chrome/browser/ui/webui/options2/browser_options_handler2.cc
@@ -16,8 +16,8 @@
#include "base/stl_util.h"
#include "base/string_number_conversions.h"
#include "base/utf_string_conversions.h"
-#include "base/value_conversions.h"
#include "base/values.h"
+#include "base/value_conversions.h"
#include "chrome/browser/auto_launch_trial.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/chrome_page_zoom.h"
@@ -87,7 +87,7 @@
#include "chrome/browser/chromeos/options/take_photo_dialog.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/webui/options2/chromeos/system_settings_provider2.h"
-#include "ui/gfx/image/image_skia.h"
+#include "third_party/skia/include/core/SkBitmap.h"
#endif // defined(OS_CHROMEOS)
#if defined(OS_WIN)
@@ -912,7 +912,7 @@ scoped_ptr<ListValue> BrowserOptionsHandler::GetProfilesInfoList() {
gfx::Image icon = profiles::GetAvatarIconForWebUI(
cache.GetAvatarIconOfProfileAtIndex(i), true);
profile_value->SetString("iconURL",
- web_ui_util::GetImageDataUrl(*icon.ToImageSkia()));
+ web_ui_util::GetImageDataUrl(*icon.ToSkBitmap()));
} else {
size_t icon_index = cache.GetAvatarIconIndexOfProfileAtIndex(i);
profile_value->SetString("iconURL",
diff --git a/chrome/browser/ui/webui/options2/manage_profile_handler2.cc b/chrome/browser/ui/webui/options2/manage_profile_handler2.cc
index 3ede790..ade3ca7 100644
--- a/chrome/browser/ui/webui/options2/manage_profile_handler2.cc
+++ b/chrome/browser/ui/webui/options2/manage_profile_handler2.cc
@@ -108,7 +108,7 @@ void ManageProfileHandler::SendProfileIcons() {
cache.GetGAIAPictureOfProfileAtIndex(profile_index);
if (icon) {
gfx::Image icon2 = profiles::GetAvatarIconForWebUI(*icon, true);
- gaia_picture_url_ = web_ui_util::GetImageDataUrl(*icon2.ToImageSkia());
+ gaia_picture_url_ = web_ui_util::GetImageDataUrl(*icon2.ToSkBitmap());
image_url_list.Append(Value::CreateStringValue(gaia_picture_url_));
}
}
@@ -268,7 +268,7 @@ void ManageProfileHandler::RequestProfileInfo(const ListValue* args) {
gfx::Image icon = profiles::GetAvatarIconForWebUI(
cache.GetAvatarIconOfProfileAtIndex(index), true);
profile_value.SetString("iconURL",
- web_ui_util::GetImageDataUrl(*icon.ToImageSkia()));
+ web_ui_util::GetImageDataUrl(*icon.ToSkBitmap()));
} else {
size_t icon_index = cache.GetAvatarIconIndexOfProfileAtIndex(index);
profile_value.SetString("iconURL",
diff --git a/chrome/browser/ui/webui/task_manager/task_manager_handler.cc b/chrome/browser/ui/webui/task_manager/task_manager_handler.cc
index 35e0ce5..8c3404b 100644
--- a/chrome/browser/ui/webui/task_manager/task_manager_handler.cc
+++ b/chrome/browser/ui/webui/task_manager/task_manager_handler.cc
@@ -20,7 +20,7 @@
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui.h"
-#include "ui/gfx/image/image_skia.h"
+#include "third_party/skia/include/core/SkBitmap.h"
#include "webkit/glue/webpreferences.h"
namespace {
diff --git a/chrome/browser/ui/webui/web_ui_util.cc b/chrome/browser/ui/webui/web_ui_util.cc
index 160ba0a..46d2824 100644
--- a/chrome/browser/ui/webui/web_ui_util.cc
+++ b/chrome/browser/ui/webui/web_ui_util.cc
@@ -14,13 +14,12 @@
#include "ui/base/layout.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/codec/png_codec.h"
-#include "ui/gfx/image/image_skia.h"
namespace web_ui_util {
-std::string GetImageDataUrl(const gfx::ImageSkia& image) {
+std::string GetImageDataUrl(const SkBitmap& bitmap) {
std::vector<unsigned char> output;
- gfx::PNGCodec::EncodeBGRASkBitmap(*image.bitmap(), false, &output);
+ gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, false, &output);
std::string str_url;
str_url.insert(str_url.end(), output.begin(), output.end());
diff --git a/chrome/browser/ui/webui/web_ui_util.h b/chrome/browser/ui/webui/web_ui_util.h
index 5a5e6d2..99a2b46 100644
--- a/chrome/browser/ui/webui/web_ui_util.h
+++ b/chrome/browser/ui/webui/web_ui_util.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 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.
@@ -11,15 +11,13 @@
#include "base/values.h"
#include "webkit/glue/window_open_disposition.h"
-namespace gfx {
-class ImageSkia;
-}
+class SkBitmap;
namespace web_ui_util {
-// Convenience routine to convert ImageSkia object to data url
+// Convenience routine to convert SkBitmap object to data url
// so that it can be used in WebUI.
-std::string GetImageDataUrl(const gfx::ImageSkia& image);
+std::string GetImageDataUrl(const SkBitmap& bitmap);
// Convenience routine to get data url that corresponds to given
// resource_id as an image. This function does not check if the