| OLD | NEW |
| 1 // Copyright (c) 2011 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_CLIENT_VIEW_H_ | 5 #ifndef UI_VIEWS_WINDOW_DIALOG_CLIENT_VIEW_H_ |
| 6 #define UI_VIEWS_WINDOW_DIALOG_CLIENT_VIEW_H_ | 6 #define UI_VIEWS_WINDOW_DIALOG_CLIENT_VIEW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "ui/gfx/font.h" | 9 #include "ui/gfx/font.h" |
| 10 #include "ui/views/controls/button/button.h" | 10 #include "ui/views/controls/button/button.h" |
| 11 #include "ui/views/focus/focus_manager.h" | 11 #include "ui/views/focus/focus_manager.h" |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 virtual const DialogClientView* AsDialogClientView() const OVERRIDE; | 76 virtual const DialogClientView* AsDialogClientView() const OVERRIDE; |
| 77 | 77 |
| 78 // FocusChangeListener implementation: | 78 // FocusChangeListener implementation: |
| 79 virtual void OnWillChangeFocus(View* focused_before, | 79 virtual void OnWillChangeFocus(View* focused_before, |
| 80 View* focused_now) OVERRIDE; | 80 View* focused_now) OVERRIDE; |
| 81 virtual void OnDidChangeFocus(View* focused_before, | 81 virtual void OnDidChangeFocus(View* focused_before, |
| 82 View* focused_now) OVERRIDE; | 82 View* focused_now) OVERRIDE; |
| 83 | 83 |
| 84 protected: | 84 protected: |
| 85 // View overrides: | 85 // View overrides: |
| 86 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 86 virtual void OnPaint(gfx::CanvasSkia* canvas) OVERRIDE; |
| 87 virtual void PaintChildren(gfx::Canvas* canvas) OVERRIDE; | 87 virtual void PaintChildren(gfx::CanvasSkia* canvas) OVERRIDE; |
| 88 virtual void Layout() OVERRIDE; | 88 virtual void Layout() OVERRIDE; |
| 89 virtual void ViewHierarchyChanged(bool is_add, View* parent, | 89 virtual void ViewHierarchyChanged(bool is_add, View* parent, |
| 90 View* child) OVERRIDE; | 90 View* child) OVERRIDE; |
| 91 virtual gfx::Size GetPreferredSize() OVERRIDE; | 91 virtual gfx::Size GetPreferredSize() OVERRIDE; |
| 92 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; | 92 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; |
| 93 | 93 |
| 94 // ButtonListener implementation: | 94 // ButtonListener implementation: |
| 95 virtual void ButtonPressed(Button* sender, | 95 virtual void ButtonPressed(Button* sender, |
| 96 const views::Event& event) OVERRIDE; | 96 const views::Event& event) OVERRIDE; |
| 97 | 97 |
| 98 private: | 98 private: |
| 99 // Paint the size box in the bottom right corner of the window if it is | 99 // Paint the size box in the bottom right corner of the window if it is |
| 100 // resizable. | 100 // resizable. |
| 101 void PaintSizeBox(gfx::Canvas* canvas); | 101 void PaintSizeBox(gfx::CanvasSkia* canvas); |
| 102 | 102 |
| 103 // Returns the width of the specified dialog button using the correct font. | 103 // Returns the width of the specified dialog button using the correct font. |
| 104 int GetButtonWidth(int button) const; | 104 int GetButtonWidth(int button) const; |
| 105 int GetButtonsHeight() const; | 105 int GetButtonsHeight() const; |
| 106 | 106 |
| 107 // Position and size various sub-views. | 107 // Position and size various sub-views. |
| 108 void LayoutDialogButtons(); | 108 void LayoutDialogButtons(); |
| 109 void LayoutContentsView(); | 109 void LayoutContentsView(); |
| 110 | 110 |
| 111 // Makes the specified button the default button. | 111 // Makes the specified button the default button. |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 161 |
| 162 // Static resource initialization | 162 // Static resource initialization |
| 163 static gfx::Font* dialog_button_font_; | 163 static gfx::Font* dialog_button_font_; |
| 164 | 164 |
| 165 DISALLOW_COPY_AND_ASSIGN(DialogClientView); | 165 DISALLOW_COPY_AND_ASSIGN(DialogClientView); |
| 166 }; | 166 }; |
| 167 | 167 |
| 168 } // namespace views | 168 } // namespace views |
| 169 | 169 |
| 170 #endif // UI_VIEWS_WINDOW_DIALOG_CLIENT_VIEW_H_ | 170 #endif // UI_VIEWS_WINDOW_DIALOG_CLIENT_VIEW_H_ |
| OLD | NEW |