OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/wm/custom_frame_view_ash.h" | 5 #include "ash/wm/custom_frame_view_ash.h" |
6 | 6 |
7 #include "ash/wm/frame_painter.h" | 7 #include "ash/wm/frame_painter.h" |
| 8 #include "ash/wm/workspace/frame_maximize_button.h" |
8 #include "grit/ui_resources.h" | 9 #include "grit/ui_resources.h" |
9 #include "grit/ui_strings.h" // Accessibility names | 10 #include "grit/ui_strings.h" // Accessibility names |
10 #include "ui/base/l10n/l10n_util.h" | 11 #include "ui/base/l10n/l10n_util.h" |
11 #include "ui/base/resource/resource_bundle.h" | 12 #include "ui/base/resource/resource_bundle.h" |
12 #include "ui/gfx/font.h" | 13 #include "ui/gfx/font.h" |
13 #include "ui/gfx/image/image.h" | 14 #include "ui/gfx/image/image.h" |
14 #include "ui/gfx/rect.h" | 15 #include "ui/gfx/rect.h" |
15 #include "ui/gfx/size.h" | 16 #include "ui/gfx/size.h" |
16 #include "ui/views/controls/button/image_button.h" | 17 #include "ui/views/controls/button/image_button.h" |
17 #include "ui/views/widget/native_widget_aura.h" | 18 #include "ui/views/widget/native_widget_aura.h" |
(...skipping 18 matching lines...) Expand all Loading... |
36 } | 37 } |
37 | 38 |
38 CustomFrameViewAsh::~CustomFrameViewAsh() { | 39 CustomFrameViewAsh::~CustomFrameViewAsh() { |
39 } | 40 } |
40 | 41 |
41 void CustomFrameViewAsh::Init(views::Widget* frame) { | 42 void CustomFrameViewAsh::Init(views::Widget* frame) { |
42 InitClass(); | 43 InitClass(); |
43 | 44 |
44 frame_ = frame; | 45 frame_ = frame; |
45 | 46 |
46 maximize_button_ = new views::ImageButton(this); | 47 maximize_button_ = new FrameMaximizeButton(this); |
47 maximize_button_->SetAccessibleName( | 48 maximize_button_->SetAccessibleName( |
48 l10n_util::GetStringUTF16(IDS_APP_ACCNAME_MAXIMIZE)); | 49 l10n_util::GetStringUTF16(IDS_APP_ACCNAME_MAXIMIZE)); |
49 AddChildView(maximize_button_); | 50 AddChildView(maximize_button_); |
50 close_button_ = new views::ImageButton(this); | 51 close_button_ = new views::ImageButton(this); |
51 close_button_->SetAccessibleName( | 52 close_button_->SetAccessibleName( |
52 l10n_util::GetStringUTF16(IDS_APP_ACCNAME_CLOSE)); | 53 l10n_util::GetStringUTF16(IDS_APP_ACCNAME_CLOSE)); |
53 AddChildView(close_button_); | 54 AddChildView(close_button_); |
54 | 55 |
55 maximize_button_->SetVisible(frame_->widget_delegate()->CanMaximize()); | 56 maximize_button_->SetVisible(frame_->widget_delegate()->CanMaximize()); |
56 | 57 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 // static | 159 // static |
159 void CustomFrameViewAsh::InitClass() { | 160 void CustomFrameViewAsh::InitClass() { |
160 static bool initialized = false; | 161 static bool initialized = false; |
161 if (!initialized) { | 162 if (!initialized) { |
162 title_font_ = new gfx::Font(views::NativeWidgetAura::GetWindowTitleFont()); | 163 title_font_ = new gfx::Font(views::NativeWidgetAura::GetWindowTitleFont()); |
163 initialized = true; | 164 initialized = true; |
164 } | 165 } |
165 } | 166 } |
166 | 167 |
167 } // namespace ash | 168 } // namespace ash |
OLD | NEW |