1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "athena/main/athena_views_delegate.h"
7 #include "athena/main/athena_frame_view.h"
8 #include "athena/screen/public/screen_manager.h"
9 #include "ui/views/views_delegate.h"
15 class AthenaViewsDelegate
: public views::ViewsDelegate
{
17 AthenaViewsDelegate() {
20 ~AthenaViewsDelegate() override
{}
22 virtual void OnBeforeWidgetInit(
23 views::Widget::InitParams
* params
,
24 views::internal::NativeWidgetDelegate
* delegate
) override
{
25 params
->context
= athena::ScreenManager::Get()->GetContext();
28 virtual views::NonClientFrameView
* CreateDefaultNonClientFrameView(
29 views::Widget
* widget
) override
{
30 return new AthenaFrameView(widget
);
34 DISALLOW_COPY_AND_ASSIGN(AthenaViewsDelegate
);
39 void CreateAthenaViewsDelegate() {
40 views::ViewsDelegate::views_delegate
= new AthenaViewsDelegate
;
43 void ShutdownAthenaViewsDelegate() {
44 CHECK(views::ViewsDelegate::views_delegate
);
45 delete views::ViewsDelegate::views_delegate
;
46 views::ViewsDelegate::views_delegate
= nullptr;