| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 VIEWS_WINDOW_DIALOG_CLIENT_VIEW_H_ | 5 #ifndef VIEWS_WINDOW_DIALOG_CLIENT_VIEW_H_ |
| 6 #define VIEWS_WINDOW_DIALOG_CLIENT_VIEW_H_ | 6 #define VIEWS_WINDOW_DIALOG_CLIENT_VIEW_H_ |
| 7 | 7 |
| 8 #include "app/gfx/chrome_font.h" | 8 #include "app/gfx/font.h" |
| 9 #include "views/focus/focus_manager.h" | 9 #include "views/focus/focus_manager.h" |
| 10 #include "views/controls/button/button.h" | 10 #include "views/controls/button/button.h" |
| 11 #include "views/window/client_view.h" | 11 #include "views/window/client_view.h" |
| 12 | 12 |
| 13 namespace views { | 13 namespace views { |
| 14 | 14 |
| 15 class DialogDelegate; | 15 class DialogDelegate; |
| 16 class NativeButton; | 16 class NativeButton; |
| 17 class Window; | 17 class Window; |
| 18 | 18 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 virtual bool CanClose() const; | 54 virtual bool CanClose() const; |
| 55 virtual void WindowClosing(); | 55 virtual void WindowClosing(); |
| 56 virtual int NonClientHitTest(const gfx::Point& point); | 56 virtual int NonClientHitTest(const gfx::Point& point); |
| 57 virtual DialogClientView* AsDialogClientView() { return this; } | 57 virtual DialogClientView* AsDialogClientView() { return this; } |
| 58 | 58 |
| 59 // FocusChangeListener implementation: | 59 // FocusChangeListener implementation: |
| 60 virtual void FocusWillChange(View* focused_before, View* focused_now); | 60 virtual void FocusWillChange(View* focused_before, View* focused_now); |
| 61 | 61 |
| 62 protected: | 62 protected: |
| 63 // View overrides: | 63 // View overrides: |
| 64 virtual void Paint(ChromeCanvas* canvas); | 64 virtual void Paint(gfx::Canvas* canvas); |
| 65 virtual void PaintChildren(ChromeCanvas* canvas); | 65 virtual void PaintChildren(gfx::Canvas* canvas); |
| 66 virtual void Layout(); | 66 virtual void Layout(); |
| 67 virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child); | 67 virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child); |
| 68 virtual gfx::Size GetPreferredSize(); | 68 virtual gfx::Size GetPreferredSize(); |
| 69 virtual bool AcceleratorPressed(const Accelerator& accelerator); | 69 virtual bool AcceleratorPressed(const Accelerator& accelerator); |
| 70 | 70 |
| 71 // ButtonListener implementation: | 71 // ButtonListener implementation: |
| 72 virtual void ButtonPressed(Button* sender); | 72 virtual void ButtonPressed(Button* sender); |
| 73 | 73 |
| 74 private: | 74 private: |
| 75 // Paint the size box in the bottom right corner of the window if it is | 75 // Paint the size box in the bottom right corner of the window if it is |
| 76 // resizable. | 76 // resizable. |
| 77 void PaintSizeBox(ChromeCanvas* canvas); | 77 void PaintSizeBox(gfx::Canvas* canvas); |
| 78 | 78 |
| 79 // Returns the width of the specified dialog button using the correct font. | 79 // Returns the width of the specified dialog button using the correct font. |
| 80 int GetButtonWidth(int button) const; | 80 int GetButtonWidth(int button) const; |
| 81 int GetButtonsHeight() const; | 81 int GetButtonsHeight() const; |
| 82 | 82 |
| 83 // Position and size various sub-views. | 83 // Position and size various sub-views. |
| 84 void LayoutDialogButtons(); | 84 void LayoutDialogButtons(); |
| 85 void LayoutContentsView(); | 85 void LayoutContentsView(); |
| 86 | 86 |
| 87 // Makes the specified button the default button. | 87 // Makes the specified button the default button. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 114 // Static resource initialization | 114 // Static resource initialization |
| 115 static void InitClass(); | 115 static void InitClass(); |
| 116 static gfx::Font* dialog_button_font_; | 116 static gfx::Font* dialog_button_font_; |
| 117 | 117 |
| 118 DISALLOW_COPY_AND_ASSIGN(DialogClientView); | 118 DISALLOW_COPY_AND_ASSIGN(DialogClientView); |
| 119 }; | 119 }; |
| 120 | 120 |
| 121 } // namespace views | 121 } // namespace views |
| 122 | 122 |
| 123 #endif // #ifndef VIEWS_WINDOW_DIALOG_CLIENT_VIEW_H_ | 123 #endif // #ifndef VIEWS_WINDOW_DIALOG_CLIENT_VIEW_H_ |
| OLD | NEW |