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

Side by Side Diff: ui/views/window/dialog_frame_view.h

Issue 11756005: Implement rough new dialog style. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix CrOS build. Created 7 years, 11 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 (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 #ifndef UI_VIEWS_WINDOW_DIALOG_FRAME_VIEW_H_ 5 #ifndef UI_VIEWS_WINDOW_DIALOG_FRAME_VIEW_H_
6 #define UI_VIEWS_WINDOW_DIALOG_FRAME_VIEW_H_ 6 #define UI_VIEWS_WINDOW_DIALOG_FRAME_VIEW_H_
7 7
8 #include "ui/views/controls/button/button.h" 8 #include "ui/views/controls/button/button.h"
9 #include "ui/views/window/non_client_view.h" 9 #include "ui/views/window/non_client_view.h"
10 10
11 namespace gfx {
12 class Font;
13 }
14
15 namespace views { 11 namespace views {
16 12
17 class ImageButton; 13 class Label;
14 class LabelButton;
18 15
19 // A NonClientFrameView that implements a new-style for dialogs. 16 // A NonClientFrameView that implements a new-style for dialogs.
20 class VIEWS_EXPORT DialogFrameView : public NonClientFrameView, 17 class VIEWS_EXPORT DialogFrameView : public NonClientFrameView,
21 public ButtonListener { 18 public ButtonListener {
22 public: 19 public:
23 // Internal class name. 20 DialogFrameView(const string16& title);
sky 2013/01/07 16:51:03 explicit
msw 2013/01/07 18:06:32 Done.
24 static const char kViewClassName[];
25
26 DialogFrameView();
27 virtual ~DialogFrameView(); 21 virtual ~DialogFrameView();
28 22
29 // Overridden from NonClientFrameView: 23 // Overridden from NonClientFrameView:
30 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE; 24 virtual gfx::Rect GetBoundsForClientView() const OVERRIDE;
31 virtual gfx::Rect GetWindowBoundsForClientBounds( 25 virtual gfx::Rect GetWindowBoundsForClientBounds(
32 const gfx::Rect& client_bounds) const OVERRIDE; 26 const gfx::Rect& client_bounds) const OVERRIDE;
33 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE; 27 virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE;
34 virtual void GetWindowMask(const gfx::Size& size, 28 virtual void GetWindowMask(const gfx::Size& size,
35 gfx::Path* window_mask) OVERRIDE; 29 gfx::Path* window_mask) OVERRIDE;
36 virtual void ResetWindowControls() OVERRIDE; 30 virtual void ResetWindowControls() OVERRIDE;
37 virtual void UpdateWindowIcon() OVERRIDE; 31 virtual void UpdateWindowIcon() OVERRIDE;
38 virtual void UpdateWindowTitle() OVERRIDE; 32 virtual void UpdateWindowTitle() OVERRIDE;
39 33
40 // Overridden from View: 34 // Overridden from View:
41 virtual std::string GetClassName() const OVERRIDE; 35 virtual std::string GetClassName() const OVERRIDE;
42 virtual void Layout() OVERRIDE; 36 virtual void Layout() OVERRIDE;
43 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
44 37
45 // Overridden from ButtonListener: 38 // Overridden from ButtonListener:
46 virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE; 39 virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE;
47 40
48 private: 41 private:
49 gfx::Insets GetPaddingInsets() const;
50 gfx::Insets GetClientInsets() const; 42 gfx::Insets GetClientInsets() const;
51 43
52 scoped_ptr<gfx::Font> title_font_; 44 Label* title_;
53 gfx::Rect title_display_rect_; 45 LabelButton* close_;
54 46
55 ImageButton* close_button_; 47 // The margins between the content and the inside of the border.
48 gfx::Insets content_margins_;
56 49
57 DISALLOW_COPY_AND_ASSIGN(DialogFrameView); 50 DISALLOW_COPY_AND_ASSIGN(DialogFrameView);
58 }; 51 };
59 52
60 } // namespace views 53 } // namespace views
61 54
62 #endif // UI_VIEWS_WINDOW_DIALOG_FRAME_VIEW_H_ 55 #endif // UI_VIEWS_WINDOW_DIALOG_FRAME_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698