Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(177)

Side by Side Diff: ash/wm/custom_frame_view_ash.cc

Issue 9703026: Makes the maximize/restore button handling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporate review feedback Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/shell/window_type_launcher.cc ('k') | ash/wm/workspace/frame_maximize_button.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ash/shell/window_type_launcher.cc ('k') | ash/wm/workspace/frame_maximize_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698