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

Unified Diff: ash/common/wm/panels/panel_frame_view.cc

Issue 2410633002: Moves PanelFrameView to common (Closed)
Patch Set: Created 4 years, 2 months 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 | « ash/common/wm/panels/panel_frame_view.h ('k') | ash/mus/non_client_frame_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm/panels/panel_frame_view.cc
diff --git a/ash/wm/panels/panel_frame_view.cc b/ash/common/wm/panels/panel_frame_view.cc
similarity index 86%
rename from ash/wm/panels/panel_frame_view.cc
rename to ash/common/wm/panels/panel_frame_view.cc
index 2c1be25601032bb0f6f043c13d2ff524926fefa3..6161d8c21c196729d453f064e6197d264141d39c 100644
--- a/ash/wm/panels/panel_frame_view.cc
+++ b/ash/common/wm/panels/panel_frame_view.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ash/wm/panels/panel_frame_view.h"
+#include "ash/common/wm/panels/panel_frame_view.h"
#include "ash/common/frame/caption_buttons/frame_caption_button_container_view.h"
#include "ash/common/frame/default_header_painter.h"
@@ -10,8 +10,7 @@
#include "ash/common/wm_lookup.h"
#include "ash/common/wm_shell.h"
#include "ash/common/wm_window.h"
-#include "ui/aura/client/aura_constants.h"
-#include "ui/aura/window.h"
+#include "ash/common/wm_window_property.h"
#include "ui/base/hit_test.h"
#include "ui/gfx/canvas.h"
#include "ui/views/controls/image_view.h"
@@ -25,8 +24,7 @@ const char PanelFrameView::kViewClassName[] = "PanelFrameView";
PanelFrameView::PanelFrameView(views::Widget* frame, FrameType frame_type)
: frame_(frame), caption_button_container_(nullptr), window_icon_(nullptr) {
- WmLookup::Get()->GetWindowForWidget(frame)->InstallResizeHandleWindowTargeter(
- nullptr);
+ GetWidgetWindow()->InstallResizeHandleWindowTargeter(nullptr);
DCHECK(!frame_->widget_delegate()->CanMaximize());
if (frame_type != FRAME_NONE)
InitHeaderPainter();
@@ -40,8 +38,8 @@ PanelFrameView::~PanelFrameView() {
void PanelFrameView::SetFrameColors(SkColor active_frame_color,
SkColor inactive_frame_color) {
header_painter_->SetFrameColors(active_frame_color, inactive_frame_color);
- frame_->GetNativeWindow()->SetProperty(
- aura::client::kTopViewColor, header_painter_->GetInactiveFrameColor());
+ GetWidgetWindow()->SetColorProperty(WmWindowProperty::TOP_VIEW_COLOR,
+ header_painter_->GetInactiveFrameColor());
}
const char* PanelFrameView::GetClassName() const {
@@ -50,8 +48,8 @@ const char* PanelFrameView::GetClassName() const {
void PanelFrameView::InitHeaderPainter() {
header_painter_.reset(new DefaultHeaderPainter);
- frame_->GetNativeWindow()->SetProperty(
- aura::client::kTopViewColor, header_painter_->GetInactiveFrameColor());
+ GetWidgetWindow()->SetColorProperty(WmWindowProperty::TOP_VIEW_COLOR,
+ header_painter_->GetInactiveFrameColor());
caption_button_container_ = new FrameCaptionButtonContainerView(frame_);
AddChildView(caption_button_container_);
@@ -65,6 +63,10 @@ void PanelFrameView::InitHeaderPainter() {
}
}
+WmWindow* PanelFrameView::GetWidgetWindow() {
+ return WmLookup::Get()->GetWindowForWidget(frame_);
+}
+
int PanelFrameView::NonClientTopBorderHeight() const {
if (!header_painter_)
return 0;
@@ -84,8 +86,8 @@ void PanelFrameView::Layout() {
if (!header_painter_)
return;
header_painter_->LayoutHeader();
- frame_->GetNativeWindow()->SetProperty(aura::client::kTopViewInset,
- NonClientTopBorderHeight());
+ GetWidgetWindow()->SetIntProperty(WmWindowProperty::TOP_VIEW_INSET,
+ NonClientTopBorderHeight());
}
void PanelFrameView::GetWindowMask(const gfx::Size&, gfx::Path*) {
« no previous file with comments | « ash/common/wm/panels/panel_frame_view.h ('k') | ash/mus/non_client_frame_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698