summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-16 22:14:03 +0000
committerpkotwicz@chromium.org <pkotwicz@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-16 22:14:03 +0000
commit1cd2b4d9ac962885068d3437b3447332b37168dd (patch)
treec5246cf2f56d63b898be71bc454a84d3fc484948
parentd0410b2592dddf8df2b35418d168b3c5d1952b1c (diff)
downloadchromium_src-1cd2b4d9ac962885068d3437b3447332b37168dd.zip
chromium_src-1cd2b4d9ac962885068d3437b3447332b37168dd.tar.gz
chromium_src-1cd2b4d9ac962885068d3437b3447332b37168dd.tar.bz2
Refactors the window icon for PanelFrameView so that it is a views::ImageView instead of a views::ImageButton as it is not clickable.
Removes the window icon for CustomFrameViewAsh because in addition to not being clickable the window icon never had an image. BUG=274171 TEST=None Review URL: https://chromiumcodereview.appspot.com/22819010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@218099 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ash/wm/custom_frame_view_ash.cc10
-rw-r--r--ash/wm/custom_frame_view_ash.h1
-rw-r--r--ash/wm/panels/panel_frame_view.cc9
-rw-r--r--ash/wm/panels/panel_frame_view.h3
4 files changed, 7 insertions, 16 deletions
diff --git a/ash/wm/custom_frame_view_ash.cc b/ash/wm/custom_frame_view_ash.cc
index 9852d16..f7090a4 100644
--- a/ash/wm/custom_frame_view_ash.cc
+++ b/ash/wm/custom_frame_view_ash.cc
@@ -45,7 +45,6 @@ CustomFrameViewAsh::CustomFrameViewAsh()
: frame_(NULL),
maximize_button_(NULL),
close_button_(NULL),
- window_icon_(NULL),
frame_painter_(new ash::FramePainter) {
}
@@ -66,12 +65,7 @@ void CustomFrameViewAsh::Init(views::Widget* frame) {
maximize_button_->SetVisible(frame_->widget_delegate()->CanMaximize());
- if (frame_->widget_delegate()->ShouldShowWindowIcon()) {
- window_icon_ = new views::ImageButton(this);
- AddChildView(window_icon_);
- }
-
- frame_painter_->Init(frame_, window_icon_, maximize_button_, close_button_,
+ frame_painter_->Init(frame_, NULL, maximize_button_, close_button_,
FramePainter::SIZE_BUTTON_MAXIMIZES);
}
@@ -104,8 +98,6 @@ void CustomFrameViewAsh::ResetWindowControls() {
}
void CustomFrameViewAsh::UpdateWindowIcon() {
- if (window_icon_)
- window_icon_->SchedulePaint();
}
void CustomFrameViewAsh::UpdateWindowTitle() {
diff --git a/ash/wm/custom_frame_view_ash.h b/ash/wm/custom_frame_view_ash.h
index b6ccf7f..80525c3 100644
--- a/ash/wm/custom_frame_view_ash.h
+++ b/ash/wm/custom_frame_view_ash.h
@@ -86,7 +86,6 @@ class ASH_EXPORT CustomFrameViewAsh : public views::NonClientFrameView,
ash::FrameMaximizeButton* maximize_button_;
views::ImageButton* close_button_;
- views::ImageButton* window_icon_;
scoped_ptr<FramePainter> frame_painter_;
diff --git a/ash/wm/panels/panel_frame_view.cc b/ash/wm/panels/panel_frame_view.cc
index 8c18215..f394dc0 100644
--- a/ash/wm/panels/panel_frame_view.cc
+++ b/ash/wm/panels/panel_frame_view.cc
@@ -17,6 +17,7 @@
#include "ui/gfx/font.h"
#include "ui/gfx/image/image.h"
#include "ui/views/controls/button/image_button.h"
+#include "ui/views/controls/image_view.h"
#include "ui/views/widget/native_widget_aura.h"
#include "ui/views/widget/widget.h"
#include "ui/views/widget/widget_delegate.h"
@@ -57,7 +58,7 @@ void PanelFrameView::InitFramePainter() {
AddChildView(minimize_button_);
if (frame_->widget_delegate()->ShouldShowWindowIcon()) {
- window_icon_ = new views::ImageButton(this);
+ window_icon_ = new views::ImageView();
AddChildView(window_icon_);
}
@@ -85,10 +86,8 @@ void PanelFrameView::UpdateWindowIcon() {
if (!window_icon_)
return;
views::WidgetDelegate* delegate = frame_->widget_delegate();
- if (delegate) {
- gfx::ImageSkia image = delegate->GetWindowIcon();
- window_icon_->SetImage(views::CustomButton::STATE_NORMAL, &image);
- }
+ if (delegate)
+ window_icon_->SetImage(delegate->GetWindowIcon());
window_icon_->SchedulePaint();
}
diff --git a/ash/wm/panels/panel_frame_view.h b/ash/wm/panels/panel_frame_view.h
index ee124df..4a0a6f2 100644
--- a/ash/wm/panels/panel_frame_view.h
+++ b/ash/wm/panels/panel_frame_view.h
@@ -14,6 +14,7 @@
namespace views {
class ImageButton;
+class ImageView;
}
namespace ash {
@@ -66,7 +67,7 @@ class ASH_EXPORT PanelFrameView : public views::NonClientFrameView,
views::Widget* frame_;
views::ImageButton* close_button_;
views::ImageButton* minimize_button_;
- views::ImageButton* window_icon_;
+ views::ImageView* window_icon_;
gfx::Rect client_view_bounds_;
const gfx::Font title_font_;