summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
Diffstat (limited to 'ash')
-rw-r--r--ash/frame/caption_buttons/frame_caption_button_container_view.cc2
-rw-r--r--ash/frame/default_header_painter.cc26
-rw-r--r--ash/frame/default_header_painter.h3
-rw-r--r--ash/resources/ash_resources.grd6
-rw-r--r--ash/resources/default_100_percent/common/window_control_icon_restore.pngbin115 -> 115 bytes
-rw-r--r--ash/resources/default_100_percent/common/window_control_icon_size.pngbin92 -> 0 bytes
-rw-r--r--ash/resources/default_100_percent/common/window_control_icon_size_inactive.pngbin107 -> 0 bytes
-rw-r--r--ash/resources/default_200_percent/common/window_control_icon_size.pngbin106 -> 0 bytes
-rw-r--r--ash/resources/default_200_percent/common/window_control_icon_size_inactive.pngbin120 -> 0 bytes
9 files changed, 28 insertions, 9 deletions
diff --git a/ash/frame/caption_buttons/frame_caption_button_container_view.cc b/ash/frame/caption_buttons/frame_caption_button_container_view.cc
index ce3cd4d..b084ec4 100644
--- a/ash/frame/caption_buttons/frame_caption_button_container_view.cc
+++ b/ash/frame/caption_buttons/frame_caption_button_container_view.cc
@@ -340,7 +340,7 @@ void FrameCaptionButtonContainerView::ButtonPressed(views::Button* sender,
frame_->Minimize();
} else if (sender == size_button_) {
if (frame_->IsFullscreen()) { // Can be clicked in immersive fullscreen.
- frame_->SetFullscreen(false);
+ frame_->Restore();
action = ash::UMA_WINDOW_MAXIMIZE_BUTTON_CLICK_EXIT_FULLSCREEN;
} else if (frame_->IsMaximized()) {
frame_->Restore();
diff --git a/ash/frame/default_header_painter.cc b/ash/frame/default_header_painter.cc
index 5e5fe51..0819d4d 100644
--- a/ash/frame/default_header_painter.cc
+++ b/ash/frame/default_header_painter.cc
@@ -106,12 +106,7 @@ void DefaultHeaderPainter::Init(
IDR_AURA_WINDOW_CONTROL_ICON_MINIMIZE_I,
IDR_AURA_WINDOW_CONTROL_BACKGROUND_H,
IDR_AURA_WINDOW_CONTROL_BACKGROUND_P);
- caption_button_container_->SetButtonImages(
- CAPTION_BUTTON_ICON_MAXIMIZE_RESTORE,
- IDR_AURA_WINDOW_CONTROL_ICON_SIZE,
- IDR_AURA_WINDOW_CONTROL_ICON_SIZE_I,
- IDR_AURA_WINDOW_CONTROL_BACKGROUND_H,
- IDR_AURA_WINDOW_CONTROL_BACKGROUND_P);
+ UpdateSizeButtonImages();
caption_button_container_->SetButtonImages(
CAPTION_BUTTON_ICON_CLOSE,
IDR_AURA_WINDOW_CONTROL_ICON_CLOSE,
@@ -186,6 +181,7 @@ void DefaultHeaderPainter::PaintHeader(gfx::Canvas* canvas, Mode mode) {
}
void DefaultHeaderPainter::LayoutHeader() {
+ UpdateSizeButtonImages();
caption_button_container_->Layout();
gfx::Size caption_button_container_size =
@@ -309,6 +305,24 @@ void DefaultHeaderPainter::LayoutLeftHeaderView() {
}
}
+void DefaultHeaderPainter::UpdateSizeButtonImages() {
+ int icon_id = 0;
+ int inactive_icon_id = 0;
+ if (frame_->IsMaximized() || frame_->IsFullscreen()) {
+ icon_id = IDR_AURA_WINDOW_CONTROL_ICON_RESTORE;
+ inactive_icon_id = IDR_AURA_WINDOW_CONTROL_ICON_RESTORE_I;
+ } else {
+ icon_id = IDR_AURA_WINDOW_CONTROL_ICON_MAXIMIZE;
+ inactive_icon_id = IDR_AURA_WINDOW_CONTROL_ICON_MAXIMIZE_I;
+ }
+ caption_button_container_->SetButtonImages(
+ CAPTION_BUTTON_ICON_MAXIMIZE_RESTORE,
+ icon_id,
+ inactive_icon_id,
+ IDR_AURA_WINDOW_CONTROL_BACKGROUND_H,
+ IDR_AURA_WINDOW_CONTROL_BACKGROUND_P);
+}
+
gfx::Rect DefaultHeaderPainter::GetLocalBounds() const {
return gfx::Rect(view_->width(), height_);
}
diff --git a/ash/frame/default_header_painter.h b/ash/frame/default_header_painter.h
index ba1d9e8..c0ca2fd 100644
--- a/ash/frame/default_header_painter.h
+++ b/ash/frame/default_header_painter.h
@@ -70,6 +70,9 @@ class ASH_EXPORT DefaultHeaderPainter : public HeaderPainter,
// Layout the left header view.
void LayoutLeftHeaderView();
+ // Updates the size button's images.
+ void UpdateSizeButtonImages();
+
// Returns the header bounds in the coordinates of |view_|. The header is
// assumed to be positioned at the top left corner of |view_| and to have the
// same width as |view_|.
diff --git a/ash/resources/ash_resources.grd b/ash/resources/ash_resources.grd
index 6f10ca3..01e5af7 100644
--- a/ash/resources/ash_resources.grd
+++ b/ash/resources/ash_resources.grd
@@ -194,11 +194,13 @@
<structure type="chrome_scaled_image" name="IDR_AURA_WINDOW_CONTROL_ICON_CLOSE" file="common/window_control_icon_close.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_WINDOW_CONTROL_ICON_CLOSE_I" file="common/window_control_icon_close_inactive.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_WINDOW_CONTROL_ICON_LEFT_SNAPPED" file="common/window_control_icon_left_snapped.png" />
+ <structure type="chrome_scaled_image" name="IDR_AURA_WINDOW_CONTROL_ICON_MAXIMIZE" file="common/window_control_icon_maximize.png" />
+ <structure type="chrome_scaled_image" name="IDR_AURA_WINDOW_CONTROL_ICON_MAXIMIZE_I" file="common/window_control_icon_maximize_inactive.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_WINDOW_CONTROL_ICON_MINIMIZE" file="common/window_control_icon_minimize.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_WINDOW_CONTROL_ICON_MINIMIZE_I" file="common/window_control_icon_minimize_inactive.png" />
+ <structure type="chrome_scaled_image" name="IDR_AURA_WINDOW_CONTROL_ICON_RESTORE" file="common/window_control_icon_restore.png" />
+ <structure type="chrome_scaled_image" name="IDR_AURA_WINDOW_CONTROL_ICON_RESTORE_I" file="common/window_control_icon_restore_inactive.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_WINDOW_CONTROL_ICON_RIGHT_SNAPPED" file="common/window_control_icon_right_snapped.png" />
- <structure type="chrome_scaled_image" name="IDR_AURA_WINDOW_CONTROL_ICON_SIZE" file="common/window_control_icon_size.png" />
- <structure type="chrome_scaled_image" name="IDR_AURA_WINDOW_CONTROL_ICON_SIZE_I" file="common/window_control_icon_size_inactive.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_WINDOW_HEADER_SHADE_INACTIVE_BOTTOM" file="common/window_header_shade_bottom_inactive.png" />
<structure type="chrome_scaled_image" name="IDR_AURA_WINDOW_HEADER_SHADE_INACTIVE_LEFT" file="common/window_header_shade_left_inactive.png" />
diff --git a/ash/resources/default_100_percent/common/window_control_icon_restore.png b/ash/resources/default_100_percent/common/window_control_icon_restore.png
index bdd7507..84fa1d1 100644
--- a/ash/resources/default_100_percent/common/window_control_icon_restore.png
+++ b/ash/resources/default_100_percent/common/window_control_icon_restore.png
Binary files differ
diff --git a/ash/resources/default_100_percent/common/window_control_icon_size.png b/ash/resources/default_100_percent/common/window_control_icon_size.png
deleted file mode 100644
index 1fca585..0000000
--- a/ash/resources/default_100_percent/common/window_control_icon_size.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_100_percent/common/window_control_icon_size_inactive.png b/ash/resources/default_100_percent/common/window_control_icon_size_inactive.png
deleted file mode 100644
index c1fb862..0000000
--- a/ash/resources/default_100_percent/common/window_control_icon_size_inactive.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_200_percent/common/window_control_icon_size.png b/ash/resources/default_200_percent/common/window_control_icon_size.png
deleted file mode 100644
index c89a819..0000000
--- a/ash/resources/default_200_percent/common/window_control_icon_size.png
+++ /dev/null
Binary files differ
diff --git a/ash/resources/default_200_percent/common/window_control_icon_size_inactive.png b/ash/resources/default_200_percent/common/window_control_icon_size_inactive.png
deleted file mode 100644
index 6d2b978..0000000
--- a/ash/resources/default_200_percent/common/window_control_icon_size_inactive.png
+++ /dev/null
Binary files differ