Use SkCanvas::drawImageRect() instead of SkImage::draw()
[chromium-blink-merge.git] / athena / main / athena_views_delegate.cc
blob4db7ff981148ee2930dc01ad229803101291ce12
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 virtual ~AthenaViewsDelegate() {
23 virtual void OnBeforeWidgetInit(
24 views::Widget::InitParams* params,
25 views::internal::NativeWidgetDelegate* delegate) OVERRIDE {
26 params->context = athena::ScreenManager::Get()->GetContext();
29 virtual views::NonClientFrameView* CreateDefaultNonClientFrameView(
30 views::Widget* widget) OVERRIDE {
31 return new AthenaFrameView(widget);
34 private:
35 DISALLOW_COPY_AND_ASSIGN(AthenaViewsDelegate);
38 } // namespace
40 void CreateAthenaViewsDelegate() {
41 views::ViewsDelegate::views_delegate = new AthenaViewsDelegate;
44 void ShutdownAthenaViewsDelegate() {
45 CHECK(views::ViewsDelegate::views_delegate);
46 delete views::ViewsDelegate::views_delegate;
47 views::ViewsDelegate::views_delegate = NULL;
50 } // namespace athena