Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / athena / activity / activity_widget_delegate.cc
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.
4
5 #include "athena/activity/activity_widget_delegate.h"
6
7 #include "athena/activity/activity_frame_view.h"
8 #include "athena/activity/public/activity_view_model.h"
9 #include "ui/views/view.h"
10 #include "ui/views/window/client_view.h"
11
12 namespace athena {
13
14 ActivityWidgetDelegate::ActivityWidgetDelegate(ActivityViewModel* view_model)
15     : view_model_(view_model) {
16 }
17
18 ActivityWidgetDelegate::~ActivityWidgetDelegate() {
19 }
20
21 bool ActivityWidgetDelegate::CanResize() const {
22   return true;
23 }
24
25 bool ActivityWidgetDelegate::CanMaximize() const {
26   return true;
27 }
28
29 bool ActivityWidgetDelegate::CanMinimize() const {
30   return true;
31 }
32
33 base::string16 ActivityWidgetDelegate::GetWindowTitle() const {
34   return view_model_->GetTitle();
35 }
36
37 void ActivityWidgetDelegate::DeleteDelegate() {
38   delete this;
39 }
40
41 views::Widget* ActivityWidgetDelegate::GetWidget() {
42   return GetContentsView()->GetWidget();
43 }
44
45 const views::Widget* ActivityWidgetDelegate::GetWidget() const {
46   return const_cast<ActivityWidgetDelegate*>(this)->GetWidget();
47 }
48
49 views::View* ActivityWidgetDelegate::GetContentsView() {
50   return view_model_->GetContentsView();
51 }
52
53 views::NonClientFrameView* ActivityWidgetDelegate::CreateNonClientFrameView(
54     views::Widget* widget) {
55   return new ActivityFrameView(widget, view_model_);
56 }
57
58 }  // namespace athena