Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(180)

Unified Diff: components/exo/shell_surface.cc

Issue 1441683007: exo: Add "back" button to shell surface decorations. Base URL: https://chromium.googlesource.com/chromium/src.git@exosphere-subcompositor
Patch Set: rebase Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/exo/shell_surface.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/exo/shell_surface.cc
diff --git a/components/exo/shell_surface.cc b/components/exo/shell_surface.cc
index 29f67496fd02f5be81fcb5141eee5ee1f297c33f..879d3bfc2487d59d131f26d950e79bb1712e11f3 100644
--- a/components/exo/shell_surface.cc
+++ b/components/exo/shell_surface.cc
@@ -4,6 +4,8 @@
#include "components/exo/shell_surface.h"
+#include "ash/frame/caption_buttons/frame_caption_button.h"
+#include "ash/frame/custom_frame_view_ash.h"
#include "ash/shell.h"
#include "ash/shell_window_ids.h"
#include "base/logging.h"
@@ -11,6 +13,7 @@
#include "base/trace_event/trace_event.h"
#include "base/trace_event/trace_event_argument.h"
#include "components/exo/surface.h"
+#include "grit/ash_resources.h"
#include "ui/aura/window.h"
#include "ui/base/hit_test.h"
#include "ui/views/widget/widget.h"
@@ -18,29 +21,27 @@
namespace exo {
namespace {
-class CustomFrameView : public views::NonClientFrameView {
+class CustomFrameView : public ash::CustomFrameViewAsh,
+ public views::ButtonListener {
public:
- explicit CustomFrameView(views::Widget* widget) : widget_(widget) {}
+ explicit CustomFrameView(views::Widget* widget)
+ : ash::CustomFrameViewAsh(widget) {
+ ash::FrameCaptionButton* back_button =
+ new ash::FrameCaptionButton(this, ash::CAPTION_BUTTON_ICON_BACK);
+ back_button->SetImages(
+ ash::CAPTION_BUTTON_ICON_BACK, ash::FrameCaptionButton::ANIMATE_NO,
+ IDR_AURA_WINDOW_CONTROL_ICON_BACK, IDR_AURA_WINDOW_CONTROL_BACKGROUND_H,
+ IDR_AURA_WINDOW_CONTROL_BACKGROUND_P);
+ SetLeftCaptionButton(back_button);
+ }
~CustomFrameView() override {}
- // Overridden from views::NonClientFrameView:
- gfx::Rect GetBoundsForClientView() const override { return bounds(); }
- gfx::Rect GetWindowBoundsForClientBounds(
- const gfx::Rect& client_bounds) const override {
- return client_bounds;
- }
- int NonClientHitTest(const gfx::Point& point) override {
- return widget_->client_view()->NonClientHitTest(point);
+ // Overridden from views::ButtonListener:
+ void ButtonPressed(views::Button* sender, const ui::Event& event) override {
+ NOTIMPLEMENTED();
}
- void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask) override {}
- void ResetWindowControls() override {}
- void UpdateWindowIcon() override {}
- void UpdateWindowTitle() override {}
- void SizeConstraintsChanged() override {}
private:
- views::Widget* const widget_;
-
DISALLOW_COPY_AND_ASSIGN(CustomFrameView);
};
« no previous file with comments | « components/exo/shell_surface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698