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

Side by Side Diff: ash/wm/caption_buttons/frame_caption_button_container_view.h

Issue 24048003: [Refactor] Cache the views::Widget* that the FrameMaximizeButton acts on (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #ifndef ASH_WM_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_CONTAINER_VIEW_H_ 5 #ifndef ASH_WM_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_CONTAINER_VIEW_H_
6 #define ASH_WM_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_CONTAINER_VIEW_H_ 6 #define ASH_WM_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_CONTAINER_VIEW_H_
7 7
8 #include "ash/ash_export.h" 8 #include "ash/ash_export.h"
9 #include "ui/gfx/image/image_skia.h" 9 #include "ui/gfx/image/image_skia.h"
10 #include "ui/views/controls/button/button.h" 10 #include "ui/views/controls/button/button.h"
11 #include "ui/views/view.h" 11 #include "ui/views/view.h"
12 12
13 namespace views { 13 namespace views {
14 class CustomButton; 14 class CustomButton;
15 class NonClientFrameView;
16 class Widget; 15 class Widget;
17 } 16 }
18 17
19 namespace ash { 18 namespace ash {
20 19
21 // Container view for the frame caption buttons. It performs the appropriate 20 // Container view for the frame caption buttons. It performs the appropriate
22 // action when a caption button is clicked. 21 // action when a caption button is clicked.
23 class ASH_EXPORT FrameCaptionButtonContainerView 22 class ASH_EXPORT FrameCaptionButtonContainerView
24 : public views::View, 23 : public views::View,
25 public views::ButtonListener { 24 public views::ButtonListener {
(...skipping 12 matching lines...) Expand all
38 HEADER_STYLE_SHORT, 37 HEADER_STYLE_SHORT,
39 38
40 // Restored tabbed browser windows, popups for browser windows, restored 39 // Restored tabbed browser windows, popups for browser windows, restored
41 // hosted app windows, popups for hosted app windows. 40 // hosted app windows, popups for hosted app windows.
42 HEADER_STYLE_TALL, 41 HEADER_STYLE_TALL,
43 42
44 // AppNonClientFrameViewAsh. 43 // AppNonClientFrameViewAsh.
45 HEADER_STYLE_MAXIMIZED_HOSTED_APP 44 HEADER_STYLE_MAXIMIZED_HOSTED_APP
46 }; 45 };
47 46
48 // |frame_view| and |frame| are the NonClientFrameView and the views::Widget 47 // |frame_view| and |frame| are the NonClientFrameView and the views::Widget
James Cook 2013/09/16 16:08:07 nit: update comment
49 // that the caption buttons act on. 48 // that the caption buttons act on.
50 // |minimize_allowed| indicates whether the frame can be minimized (either via 49 // |minimize_allowed| indicates whether the frame can be minimized (either via
51 // the maximize/restore button or via a dedicated button). 50 // the maximize/restore button or via a dedicated button).
52 // TODO(pkotwicz): Remove the |frame_view| parameter once FrameMaximizeButton 51 FrameCaptionButtonContainerView(views::Widget* frame,
53 // is refactored to take in a views::Widget instead.
54 FrameCaptionButtonContainerView(views::NonClientFrameView* frame_view,
55 views::Widget* frame,
56 MinimizeAllowed minimize_allowed); 52 MinimizeAllowed minimize_allowed);
57 virtual ~FrameCaptionButtonContainerView(); 53 virtual ~FrameCaptionButtonContainerView();
58 54
59 // For testing. 55 // For testing.
60 class TestApi { 56 class TestApi {
61 public: 57 public:
62 explicit TestApi(FrameCaptionButtonContainerView* container_view) 58 explicit TestApi(FrameCaptionButtonContainerView* container_view)
63 : container_view_(container_view) { 59 : container_view_(container_view) {
64 } 60 }
65 61
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 views::CustomButton* minimize_button_; 136 views::CustomButton* minimize_button_;
141 views::CustomButton* size_button_; 137 views::CustomButton* size_button_;
142 views::CustomButton* close_button_; 138 views::CustomButton* close_button_;
143 139
144 DISALLOW_COPY_AND_ASSIGN(FrameCaptionButtonContainerView); 140 DISALLOW_COPY_AND_ASSIGN(FrameCaptionButtonContainerView);
145 }; 141 };
146 142
147 } // namesapace ash 143 } // namesapace ash
148 144
149 #endif // ASH_WM_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_CONTAINER_VIEW_H_ 145 #endif // ASH_WM_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_CONTAINER_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698