Skip to content

Commit

Permalink
Revert 140531 - Converted the rest of chrome except for extensions an…
Browse files Browse the repository at this point in the history
…d favicons to user ImageSkia

Used same conversion script as 10437006

Modified the following files afterwards:
  1 chrome/browser/background/background_application_list_model.cc
  2 chrome/browser/extensions/extension_install_ui.cc
  3 chrome/browser/extensions/extension_install_ui.h
  4 chrome/browser/speech/speech_recognition_bubble.cc
  5 chrome/browser/speech/speech_recognition_bubble_controller_unittest.cc
  6 chrome/browser/speech/speech_recognition_bubble_gtk.cc
  7 chrome/browser/speech/speech_recognition_tray_icon_controller.h
  8 chrome/browser/task_manager/task_manager_resource_providers.cc
  9 chrome/browser/ui/panels/panel_browser_frame_view.cc
 10 chrome/browser/ui/search_engines/template_url_table_model.cc
 11 chrome/browser/ui/search_engines/template_url_table_model.h
 12 chrome/browser/ui/views/autocomplete/autocomplete_result_view.cc
 13 chrome/browser/ui/views/avatar_menu_button.cc
 14 chrome/browser/ui/views/detachable_toolbar_view.cc
 15 chrome/browser/ui/views/download/download_item_view.cc
 16 chrome/browser/ui/views/extensions/extension_install_dialog_view.cc
 17 chrome/browser/ui/views/location_bar/icon_label_bubble_view.h
 18 chrome/browser/ui/views/location_bar/location_bar_view.cc
 19 chrome/browser/ui/views/tab_icon_view.cc
 20 chrome/browser/ui/views/tab_icon_view.h
 21 chrome/browser/ui/views/tabs/tab_strip.cc

Include, whitespace changes in
  1 chrome/browser/automation/automation_provider_observers.cc
  2 chrome/browser/background/background_application_list_model.h
  3 chrome/browser/background/background_mode_manager.cc
  4 chrome/browser/custom_home_pages_table_model.h
  5 chrome/browser/download/download_util.cc
  6 chrome/browser/extensions/extension_function_dispatcher.cc
  7 chrome/browser/extensions/extension_install_dialog.cc
  8 chrome/browser/extensions/extension_install_dialog.h
  9 chrome/browser/ntp_background_util.cc
 10 chrome/browser/speech/speech_recognition_bubble.h
 11 chrome/browser/task_manager/task_manager.h
 12 chrome/browser/ui/cocoa/infobars/mock_confirm_infobar_delegate.cc
 13 chrome/browser/ui/cocoa/infobars/mock_link_infobar_delegate.cc
 14 chrome/browser/ui/cocoa/task_manager_mac.h
 15 chrome/browser/ui/views/about_chrome_view.cc
 16 chrome/browser/ui/views/avatar_menu_bubble_view.cc
 17 chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.cc
 18 chrome/browser/ui/views/download/download_item_view.h
 19 chrome/browser/ui/views/find_bar_view.cc
 20 chrome/browser/ui/views/infobars/extension_infobar.cc
 21 chrome/browser/ui/views/notifications/balloon_view.cc
 22 chrome/browser/ui/views/page_info_bubble_view.cc
 23 chrome/browser/ui/views/tabs/base_tab.cc
 24 chrome/browser/ui/views/tabs/tab.cc
 25 chrome/browser/ui/views/toolbar_view.cc

Review URL: https://chromiumcodereview.appspot.com/10453101

TBR=pkotwicz@chromium.org
Review URL: https://chromiumcodereview.appspot.com/10534009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140532 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
pkotwicz@chromium.org committed Jun 5, 2012
1 parent 1dde363 commit 9938b17
Show file tree
Hide file tree
Showing 91 changed files with 500 additions and 544 deletions.
1 change: 1 addition & 0 deletions chrome/browser/automation/automation_provider_observers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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_) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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;
Expand Down Expand Up @@ -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_;
};
Expand Down Expand Up @@ -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_);
}

Expand Down Expand Up @@ -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)
Expand Down
8 changes: 2 additions & 6 deletions chrome/browser/background/background_application_list_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions chrome/browser/background/background_mode_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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();
}
Expand Down
6 changes: 3 additions & 3 deletions chrome/browser/background/background_mode_manager_win.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/chrome_browser_main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
6 changes: 2 additions & 4 deletions chrome/browser/chromeos/login/user_manager_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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_);
}
}

Expand Down Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/custom_home_pages_table_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

class GURL;
class Profile;
class SkBitmap;

namespace ui {
class TableModelObserver;
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/download/download_extension_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
44 changes: 21 additions & 23 deletions chrome/browser/download/download_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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());
Expand Down Expand Up @@ -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());
Expand All @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion chrome/browser/download/download_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/extensions/extension_function_dispatcher.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion chrome/browser/extensions/extension_install_dialog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/extensions/extension_install_dialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "chrome/browser/extensions/extension_install_ui.h"

class Profile;
class SkBitmap;

namespace base {
class DictionaryValue;
Expand Down
6 changes: 3 additions & 3 deletions chrome/browser/extensions/extension_install_ui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
3 changes: 1 addition & 2 deletions chrome/browser/extensions/extension_install_ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 3 additions & 3 deletions chrome/browser/extensions/extension_uninstall_dialog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}

Expand Down
Loading

0 comments on commit 9938b17

Please sign in to comment.