Skip to content

Commit

Permalink
Convert ash and chromeos parts of chrome/ to ImageSkia
Browse files Browse the repository at this point in the history
Used same conversion script as 10437006

Changed by hand afterwards:
  1 ash/shell/app_list.cc
  2 ash/shell/content_client/shell_content_browser_client.h
  3 ash/shell/window_watcher.cc
  4 ash/system/tray/tray_views.h
  5 ash/system/user/tray_user.cc
  6 ash/test/test_launcher_delegate.cc
  7 ash/wm/frame_painter.cc
  8 ash/wm/image_grid_unittest.cc
  9 chrome/browser/chrome_content_browser_client.cc
 10 chrome/browser/chrome_content_browser_client.h
 11 chrome/browser/chromeos/extensions/file_manager_util.cc
 12 chrome/browser/chromeos/login/message_bubble.h
 13 chrome/browser/chromeos/login/take_photo_view.cc
 14 chrome/browser/chromeos/login/take_photo_view.h
 15 chrome/browser/chromeos/login/user.h
 16 chrome/browser/chromeos/login/user_image_screen.cc
 17 chrome/browser/chromeos/login/user_image_screen_actor.h
 18 chrome/browser/chromeos/login/webui_login_view.cc
 19 chrome/browser/chromeos/options/take_photo_dialog.cc
 20 chrome/browser/chromeos/status/data_promo_notification.cc
 21 chrome/browser/chromeos/status/network_menu_icon.cc
 22 chrome/browser/chromeos/status/network_menu_icon.h
 23 chrome/browser/chromeos/status/network_menu_icon_unittest.cc
 24 chrome/browser/debugger/devtools_window.cc
 25 chrome/browser/favicon/favicon_handler.cc
 26 chrome/browser/favicon/favicon_tab_helper.cc
 27 chrome/browser/instant/instant_loader.cc
 28 chrome/browser/ui/toolbar/back_forward_menu_model.cc
 29 chrome/browser/ui/views/ash/browser_non_client_frame_view_ash.cc
 30 chrome/browser/ui/webui/chromeos/login/user_image_screen_handler.cc
 31 chrome/browser/ui/webui/chromeos/login/user_image_screen_handler.h
 32 chrome/browser/ui/webui/options2/chromeos/change_picture_options_handler2.cc
 33 chrome/browser/ui/webui/options2/chromeos/change_picture_options_handler2.h
 34 chrome/browser/ui/webui/options2/chromeos/internet_options_handler2.h
 35 chrome/browser/ui/webui/options2/chromeos/user_image_source2.cc
 36 chrome/browser/ui/webui/options2/chromeos/wallpaper_thumbnail_source2.cc
 37 content/browser/mock_content_browser_client.cc
 38 content/browser/mock_content_browser_client.h
 39 content/public/browser/content_browser_client.h
 40 content/public/browser/favicon_status.cc
 41 content/public/browser/favicon_status.h
 42 content/shell/shell_content_browser_client.cc
 43 content/shell/shell_content_browser_client.h
 44 ui/views/examples/content_client/examples_content_browser_client.cc
 45 ui/views/examples/content_client/examples_content_browser_client.h

Fixed headers and spacing
 1 ash/desktop_background/desktop_background_controller.cc
 2 ash/desktop_background/desktop_background_controller.h
 3 ash/desktop_background/desktop_background_resources.cc
 4 ash/desktop_background/desktop_background_resources.h
 5 ash/shell.h
 6 ash/shell_factory.h
 7 ash/system/tray/system_tray_delegate.h
 8 ash/wm/frame_painter.h
 9 chrome/browser/chromeos/login/default_user_images.h
 10 chrome/browser/chromeos/status/network_menu.cc

Test=Compiles
Bug=124566

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

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139776 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
pkotwicz@chromium.org committed May 31, 2012
1 parent e6c896f commit 5443f29
Show file tree
Hide file tree
Showing 61 changed files with 492 additions and 449 deletions.
13 changes: 7 additions & 6 deletions ash/desktop_background/desktop_background_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class DesktopBackgroundController::WallpaperOperation
if (cancel_flag_.IsSet())
return;
wallpaper_ = ui::ResourceBundle::GetSharedInstance().GetImageNamed(
GetWallpaperInfo(index_).id).ToSkBitmap();
GetWallpaperInfo(index_).id).ToImageSkia();
if (cancel_flag_.IsSet())
return;
layout_ = GetWallpaperInfo(index_).layout;
Expand All @@ -52,7 +52,7 @@ class DesktopBackgroundController::WallpaperOperation
cancel_flag_.Set();
}

const SkBitmap* wallpaper() {
const gfx::ImageSkia* wallpaper() {
return wallpaper_;
}

Expand All @@ -70,7 +70,7 @@ class DesktopBackgroundController::WallpaperOperation

base::CancellationFlag cancel_flag_;

const SkBitmap* wallpaper_;
const gfx::ImageSkia* wallpaper_;
WallpaperLayout layout_;
int index_;

Expand Down Expand Up @@ -103,8 +103,9 @@ void DesktopBackgroundController::SetDefaultWallpaper(int index) {
true /* task_is_slow */);
}

void DesktopBackgroundController::SetCustomWallpaper(const SkBitmap& wallpaper,
WallpaperLayout layout) {
void DesktopBackgroundController::SetCustomWallpaper(
const gfx::ImageSkia& wallpaper,
WallpaperLayout layout) {
internal::RootWindowLayoutManager* root_window_layout =
Shell::GetInstance()->root_window_layout();
root_window_layout->SetBackgroundLayer(NULL);
Expand Down Expand Up @@ -170,7 +171,7 @@ void DesktopBackgroundController::OnWallpaperLoadCompleted(
}

void DesktopBackgroundController::CreateEmptyWallpaper() {
SkBitmap dummy;
gfx::ImageSkia dummy;
internal::CreateDesktopBackground(dummy, CENTER);
desktop_background_mode_ = BACKGROUND_IMAGE;
}
Expand Down
7 changes: 5 additions & 2 deletions ash/desktop_background/desktop_background_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
#include "base/basictypes.h"
#include "base/memory/weak_ptr.h"

class SkBitmap;
namespace gfx {
class ImageSkia;
}

namespace ash {

Expand Down Expand Up @@ -53,7 +55,8 @@ class ASH_EXPORT DesktopBackgroundController {

// Sets the user selected custom wallpaper. Called when user selected a file
// from file system or changed the layout of wallpaper.
void SetCustomWallpaper(const SkBitmap& wallpaper, WallpaperLayout layout);
void SetCustomWallpaper(const gfx::ImageSkia& wallpaper,
WallpaperLayout layout);

// Cancels the current wallpaper loading operation.
void CancelPendingWallpaperOperation();
Expand Down
1 change: 0 additions & 1 deletion ash/desktop_background/desktop_background_resources.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "grit/ui_resources.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image.h"
#include "third_party/skia/include/core/SkBitmap.h"

namespace {

Expand Down
2 changes: 0 additions & 2 deletions ash/desktop_background/desktop_background_resources.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@

#include "ash/ash_export.h"

class SkBitmap;

namespace ash {

enum WallpaperLayout {
Expand Down
5 changes: 2 additions & 3 deletions ash/desktop_background/desktop_background_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,10 @@ static int RoundPositive(double x) {
////////////////////////////////////////////////////////////////////////////////
// DesktopBackgroundView, public:

DesktopBackgroundView::DesktopBackgroundView(const SkBitmap& wallpaper,
DesktopBackgroundView::DesktopBackgroundView(const gfx::ImageSkia& wallpaper,
WallpaperLayout wallpaper_layout) {
wallpaper_ = wallpaper;
wallpaper_layout_ = wallpaper_layout;
wallpaper_.buildMipMap(false);
}

DesktopBackgroundView::~DesktopBackgroundView() {
Expand Down Expand Up @@ -127,7 +126,7 @@ void DesktopBackgroundView::OnMouseReleased(const views::MouseEvent& event) {
Shell::GetInstance()->ShowBackgroundMenu(GetWidget(), event.location());
}

void CreateDesktopBackground(const SkBitmap& wallpaper,
void CreateDesktopBackground(const gfx::ImageSkia& wallpaper,
WallpaperLayout wallpaper_layout) {
views::Widget* desktop_widget = new views::Widget;
views::Widget::InitParams params(
Expand Down
6 changes: 3 additions & 3 deletions ash/desktop_background/desktop_background_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#pragma once

#include "ash/desktop_background/desktop_background_resources.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/views/view.h"
#include "ui/views/widget/widget_delegate.h"

Expand All @@ -16,7 +16,7 @@ namespace internal {

class DesktopBackgroundView : public views::WidgetDelegateView {
public:
DesktopBackgroundView(const SkBitmap& wallpaper,
DesktopBackgroundView(const gfx::ImageSkia& wallpaper,
WallpaperLayout wallpaper_layout);
virtual ~DesktopBackgroundView();

Expand All @@ -26,7 +26,7 @@ class DesktopBackgroundView : public views::WidgetDelegateView {
virtual bool OnMousePressed(const views::MouseEvent& event) OVERRIDE;
virtual void OnMouseReleased(const views::MouseEvent& event) OVERRIDE;

SkBitmap wallpaper_;
gfx::ImageSkia wallpaper_;
WallpaperLayout wallpaper_layout_;

DISALLOW_COPY_AND_ASSIGN(DesktopBackgroundView);
Expand Down
6 changes: 3 additions & 3 deletions ash/shell.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
#include "base/bind.h"
#include "base/command_line.h"
#include "grit/ui_resources.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/env.h"
#include "ui/aura/focus_manager.h"
Expand All @@ -78,6 +77,7 @@
#include "ui/aura/window.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_animator.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/monitor.h"
#include "ui/gfx/screen.h"
#include "ui/gfx/size.h"
Expand Down Expand Up @@ -276,7 +276,7 @@ class DummySystemTrayDelegate : public SystemTrayDelegate {
return "über@tray";
}

virtual const SkBitmap& GetUserImage() const OVERRIDE {
virtual const gfx::ImageSkia& GetUserImage() const OVERRIDE {
return null_image_;
}

Expand Down Expand Up @@ -505,7 +505,7 @@ class DummySystemTrayDelegate : public SystemTrayDelegate {
bool bluetooth_enabled_;
float volume_;
bool caps_lock_enabled_;
SkBitmap null_image_;
gfx::ImageSkia null_image_;

DISALLOW_COPY_AND_ASSIGN(DummySystemTrayDelegate);
};
Expand Down
4 changes: 2 additions & 2 deletions ash/shell.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,10 @@
#include "base/gtest_prod_util.h"
#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
#include "ui/gfx/size.h"
#include "ui/gfx/insets.h"
#include "ui/gfx/size.h"

class CommandLine;
class SkBitmap;

namespace aura {
class EventFilter;
Expand All @@ -39,6 +38,7 @@ class BrowserContext;
}

namespace gfx {
class ImageSkia;
class Point;
class Rect;
}
Expand Down
10 changes: 5 additions & 5 deletions ash/shell/app_list.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
#include <string>

#include "ash/shell.h"
#include "ash/shell_delegate.h"
#include "ash/shell/example_factory.h"
#include "ash/shell/toplevel_window.h"
#include "ash/shell_delegate.h"
#include "base/basictypes.h"
#include "base/i18n/case_conversion.h"
#include "base/i18n/string_search.h"
Expand Down Expand Up @@ -46,7 +46,7 @@ class WindowTypeLauncherItem : public app_list::AppListItemModel {
SetTitle(GetTitle(type));
}

static SkBitmap GetIcon(Type type) {
static gfx::ImageSkia GetIcon(Type type) {
static const SkColor kColors[] = {
SK_ColorRED,
SK_ColorGREEN,
Expand All @@ -60,7 +60,7 @@ class WindowTypeLauncherItem : public app_list::AppListItemModel {
icon.setConfig(SkBitmap::kARGB_8888_Config, kIconSize, kIconSize);
icon.allocPixels();
icon.eraseColor(kColors[static_cast<int>(type) % arraysize(kColors)]);
return icon;
return gfx::ImageSkia(icon);
}

// The text below is not localized as this is an example code.
Expand Down Expand Up @@ -199,7 +199,7 @@ class ExampleAppListViewDelegate : public app_list::AppListViewDelegate {
}
}

SkBitmap CreateSearchBoxIcon() {
gfx::ImageSkia CreateSearchBoxIcon() {
const string16 icon_text = ASCIIToUTF16("ash");
const gfx::Size icon_size(32, 32);

Expand All @@ -212,7 +212,7 @@ class ExampleAppListViewDelegate : public app_list::AppListViewDelegate {
gfx::Canvas::TEXT_VALIGN_MIDDLE |
gfx::Canvas::NO_SUBPIXEL_RENDERING);

return canvas.ExtractBitmap();
return gfx::ImageSkia(canvas.ExtractBitmap());
}

void DecorateSearchBox(app_list::SearchBoxModel* search_box_model) {
Expand Down
6 changes: 4 additions & 2 deletions ash/shell_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
#include "ash/ash_export.h"
#include "ash/desktop_background/desktop_background_resources.h"

class SkBitmap;
namespace gfx {
class ImageSkia;
}

namespace views {
class View;
Expand All @@ -21,7 +23,7 @@ class Widget;
namespace ash {

namespace internal {
void CreateDesktopBackground(const SkBitmap& wallpaper,
void CreateDesktopBackground(const gfx::ImageSkia& wallpaper,
WallpaperLayout wallpaper_layout);
ASH_EXPORT views::Widget* CreateStatusArea(views::View* contents);
} // namespace internal
Expand Down
2 changes: 1 addition & 1 deletion ash/system/date/tray_date.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
#include "base/timer.h"
#include "base/utf_string_conversions.h"
#include "grit/ui_resources.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkRect.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/size.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/controls/button/text_button.h"
Expand Down
2 changes: 1 addition & 1 deletion ash/system/network/tray_network.cc
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ class NetworkDetailedView : public TrayDetailsView,
HoverHighlightView* container = new HoverHighlightView(this);
container->set_fixed_height(kTrayPopupItemHeight);
container->AddIconAndLabel(
*rb.GetImageNamed(IDR_AURA_UBER_TRAY_NETWORK_AIRPLANE).ToSkBitmap(),
*rb.GetImageNamed(IDR_AURA_UBER_TRAY_NETWORK_AIRPLANE).ToImageSkia(),
rb.GetLocalizedString(IDS_ASH_STATUS_TRAY_AIRPLANE_MODE),
gfx::Font::NORMAL);
AddChildView(container);
Expand Down
10 changes: 5 additions & 5 deletions ash/system/power/tray_power.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
#include "base/utf_string_conversions.h"
#include "grit/ash_strings.h"
#include "grit/ui_resources.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "third_party/skia/include/core/SkRect.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/gfx/size.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/controls/button/text_button.h"
#include "ui/views/controls/image_view.h"
Expand Down Expand Up @@ -58,9 +58,9 @@ enum IconSet {
ICON_DARK
};

SkBitmap GetBatteryImage(const PowerSupplyStatus& supply_status,
gfx::ImageSkia GetBatteryImage(const PowerSupplyStatus& supply_status,
IconSet icon_set) {
SkBitmap image;
gfx::ImageSkia image;
gfx::Image all = ui::ResourceBundle::GetSharedInstance().GetImageNamed(
icon_set == ICON_DARK ?
IDR_AURA_UBER_TRAY_POWER_SMALL_DARK : IDR_AURA_UBER_TRAY_POWER_SMALL);
Expand All @@ -83,7 +83,7 @@ SkBitmap GetBatteryImage(const PowerSupplyStatus& supply_status,
(supply_status.line_power_on ? kBatteryImageWidth : 0) + 2,
image_index * kBatteryImageHeight,
kBatteryImageWidth - 2, kBatteryImageHeight);
all.ToSkBitmap()->extractSubset(&image, region);
all.ToImageSkia()->extractSubset(&image, region);
return image;
}

Expand Down
2 changes: 1 addition & 1 deletion ash/system/status_area_widget_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#pragma once

#include "ash/ash_export.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/views/accessible_pane_view.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/widget/widget_delegate.h"
Expand Down
5 changes: 2 additions & 3 deletions ash/system/tray/system_tray_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,11 @@
#include <vector>

#include "ash/ash_export.h"
#include "ash/system/user/login_status.h"
#include "ash/system/power/power_supply_status.h"
#include "ash/system/user/login_status.h"
#include "base/file_path.h"
#include "base/i18n/time_formatting.h"
#include "base/string16.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "ui/gfx/image/image_skia.h"

namespace ash {
Expand Down Expand Up @@ -107,7 +106,7 @@ class SystemTrayDelegate {
// Gets information about the logged in user.
virtual const std::string GetUserDisplayName() const = 0;
virtual const std::string GetUserEmail() const = 0;
virtual const SkBitmap& GetUserImage() const = 0;
virtual const gfx::ImageSkia& GetUserImage() const = 0;
virtual user::LoginStatus GetUserLoginStatus() const = 0;

// Returns whether a system upgrade is available.
Expand Down
10 changes: 5 additions & 5 deletions ash/system/tray/tray_views.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
#include "ash/system/tray/tray_views.h"

#include "ash/system/tray/tray_constants.h"
#include "third_party/skia/include/core/SkBitmap.h"
#include "grit/ash_strings.h"
#include "grit/ui_resources.h"
#include "grit/ui_resources_standard.h"
#include "ui/base/accessibility/accessible_view_state.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/image/image.h"
#include "ui/gfx/image/image_skia.h"
#include "ui/views/border.h"
#include "ui/views/controls/button/image_button.h"
#include "ui/views/controls/label.h"
Expand Down Expand Up @@ -125,7 +125,7 @@ HoverHighlightView::HoverHighlightView(ViewClickListener* listener)
HoverHighlightView::~HoverHighlightView() {
}

void HoverHighlightView::AddIconAndLabel(const SkBitmap& image,
void HoverHighlightView::AddIconAndLabel(const gfx::ImageSkia& image,
const string16& text,
gfx::Font::FontStyle style) {
SetLayoutManager(new views::BoxLayout(
Expand Down Expand Up @@ -412,7 +412,7 @@ void SpecialPopupRow::SetTextLabel(int string_id, ViewClickListener* listener) {
container->set_text_default_color(kHeaderTextColorNormal);

container->AddIconAndLabel(
*rb.GetImageNamed(IDR_AURA_UBER_TRAY_LESS).ToSkBitmap(),
*rb.GetImageNamed(IDR_AURA_UBER_TRAY_LESS).ToImageSkia(),
rb.GetLocalizedString(string_id),
gfx::Font::BOLD);

Expand Down Expand Up @@ -528,7 +528,7 @@ void TrayNotificationView::InitView(views::View* contents) {
layout->AddPaddingRow(0, kTrayPopupPaddingBetweenItems);
}

void TrayNotificationView::SetIconImage(const SkBitmap& image) {
void TrayNotificationView::SetIconImage(const gfx::ImageSkia& image) {
icon_->SetImage(image);
SchedulePaint();
}
Expand All @@ -542,7 +542,7 @@ void TrayNotificationView::UpdateView(views::View* new_contents) {
}

void TrayNotificationView::UpdateViewAndImage(views::View* new_contents,
const SkBitmap& image) {
const gfx::ImageSkia& image) {
RemoveAllChildViews(true);
InitView(new_contents);
icon_->SetImage(image);
Expand Down
Loading

0 comments on commit 5443f29

Please sign in to comment.