tuple: update to make use of C++11
[chromium-blink-merge.git] / athena / main / athena_views_delegate.cc
blob17dab73d24ef623bf8790e51cb2c13afb6501715
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"
11 namespace athena {
13 namespace {
15 class AthenaViewsDelegate: public views::ViewsDelegate {
16 public:
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);
33 private:
34 DISALLOW_COPY_AND_ASSIGN(AthenaViewsDelegate);
37 } // namespace
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;
49 } // namespace athena