]> khamidou — GitHub mirrors - electron.git/commitdiff
Store window icon as ImageSkia.
authorCheng Zhao <zcbenz@gmail.com>
Mon, 11 Aug 2014 02:06:46 +0000 (10:06 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 11 Aug 2014 02:06:46 +0000 (10:06 +0800)
atom/browser/native_window.cc
atom/browser/native_window.h
atom/browser/native_window_views.cc

index da9409ab6a5a41420d2de3ee1ed71bc157ed7c5f..163c0f5f2858c9e5afb3add63e688cdb84eb53c4 100644 (file)
@@ -45,8 +45,6 @@
 #include "ipc/ipc_message_macros.h"
 #include "native_mate/dictionary.h"
 #include "ui/gfx/codec/png_codec.h"
-#include "ui/gfx/image/image.h"
-#include "ui/gfx/image/image_skia.h"
 #include "ui/gfx/point.h"
 #include "ui/gfx/rect.h"
 #include "ui/gfx/size.h"
@@ -70,9 +68,7 @@ NativeWindow::NativeWindow(content::WebContents* web_contents,
   options.Get(switches::kFrame, &has_frame_);
 
   // Read icon before window is created.
-  gfx::ImageSkia icon;
-  if (options.Get(switches::kIcon, &icon))
-    icon_.reset(new gfx::Image(icon));
+  options.Get(switches::kIcon, &icon_);
 
   // Read iframe security before any navigation.
   options.Get(switches::kNodeIntegration, &node_integration_);
index 4ffa87a3afdcbd1ecd9bd70dbb7b643e8c6c3928..5dccb365ae1feb403b256b822600e09b24bb8b4e 100644 (file)
@@ -21,6 +21,7 @@
 #include "content/public/browser/notification_registrar.h"
 #include "content/public/browser/notification_observer.h"
 #include "native_mate/scoped_persistent.h"
+#include "ui/gfx/image/image_skia.h"
 
 struct WebPreferences;
 
@@ -34,7 +35,6 @@ class WebContents;
 }
 
 namespace gfx {
-class Image;
 class Point;
 class Rect;
 class Size;
@@ -252,7 +252,7 @@ class NativeWindow : public brightray::DefaultWebContentsDelegate,
   bool has_frame_;
 
   // Window icon.
-  scoped_ptr<gfx::Image> icon_;
+  gfx::ImageSkia icon_;
 
  private:
   // Schedule a notification unresponsive event.
index d3c12dd88218cc4d1556c0d74f4f06c800ac0f44..821c17af26dbbacfa6b2af77ecb615f102f73e60 100644 (file)
@@ -28,8 +28,6 @@
 #include "ui/aura/window.h"
 #include "ui/aura/window_tree_host.h"
 #include "ui/base/hit_test.h"
-#include "ui/gfx/image/image.h"
-#include "ui/gfx/image/image_skia.h"
 #include "ui/views/background.h"
 #include "ui/views/controls/webview/unhandled_keyboard_event_handler.h"
 #include "ui/views/controls/webview/webview.h"
@@ -492,10 +490,7 @@ bool NativeWindowViews::ShouldHandleSystemCommands() const {
 }
 
 gfx::ImageSkia NativeWindowViews::GetWindowAppIcon() {
-  if (icon_)
-    return *(icon_->ToImageSkia());
-  else
-    return gfx::ImageSkia();
+  return icon_;
 }
 
 gfx::ImageSkia NativeWindowViews::GetWindowIcon() {