OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_BROWSER_UI_VIEWS_OPTIONS_OPTIONS_PAGE_VIEW_H__ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_OPTIONS_OPTIONS_PAGE_VIEW_H__ |
6 #define CHROME_BROWSER_UI_VIEWS_OPTIONS_OPTIONS_PAGE_VIEW_H__ | 6 #define CHROME_BROWSER_UI_VIEWS_OPTIONS_OPTIONS_PAGE_VIEW_H__ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/ui/options/options_page_base.h" | 9 #include "chrome/browser/ui/options/options_page_base.h" |
10 #include "views/controls/link.h" | 10 #include "views/controls/link.h" |
11 #include "views/controls/button/native_button.h" | 11 #include "views/controls/button/native_button.h" |
12 | 12 |
13 class PrefService; | 13 class PrefService; |
14 | 14 |
15 /////////////////////////////////////////////////////////////////////////////// | 15 /////////////////////////////////////////////////////////////////////////////// |
16 // OptionsPageView | 16 // OptionsPageView |
17 // | 17 // |
18 // A base class for Options dialog pages that handles ensuring control | 18 // A base class for Options dialog pages that handles ensuring control |
19 // initialization is done just once. | 19 // initialization is done just once. |
20 // | 20 // |
21 class OptionsPageView : public views::View, | 21 class OptionsPageView : public views::View, |
22 public OptionsPageBase { | 22 public OptionsPageBase { |
23 public: | 23 public: |
24 virtual ~OptionsPageView(); | 24 virtual ~OptionsPageView(); |
25 | 25 |
26 // Returns true if the window containing this view can be closed, given the | 26 // Returns true if the window containing this view can be closed, given the |
27 // current state of this view. This can be used to prevent the window from | 27 // current state of this view. This can be used to prevent the window from |
28 // being closed when a modal dialog box is showing, for example. | 28 // being closed when a modal dialog box is showing, for example. |
29 virtual bool CanClose() const { return true; } | 29 virtual bool CanClose() const; |
30 | 30 |
31 protected: | 31 protected: |
32 // This class cannot be instantiated directly, but its constructor must be | 32 // This class cannot be instantiated directly, but its constructor must be |
33 // called by derived classes. | 33 // called by derived classes. |
34 explicit OptionsPageView(Profile* profile); | 34 explicit OptionsPageView(Profile* profile); |
35 | 35 |
36 // Initializes the layout of the controls within the panel. | 36 // Initializes the layout of the controls within the panel. |
37 virtual void InitControlLayout() = 0; | 37 virtual void InitControlLayout() = 0; |
38 | 38 |
39 // views::View overrides: | 39 // views::View overrides: |
40 virtual void ViewHierarchyChanged(bool is_add, | 40 virtual void ViewHierarchyChanged(bool is_add, |
41 views::View* parent, | 41 views::View* parent, |
42 views::View* child); | 42 views::View* child); |
43 virtual AccessibilityTypes::Role GetAccessibleRole(); | 43 virtual AccessibilityTypes::Role GetAccessibleRole(); |
44 | 44 |
45 private: | 45 private: |
46 // Whether or not the control layout has been initialized for this page. | 46 // Whether or not the control layout has been initialized for this page. |
47 bool initialized_; | 47 bool initialized_; |
48 | 48 |
49 DISALLOW_COPY_AND_ASSIGN(OptionsPageView); | 49 DISALLOW_COPY_AND_ASSIGN(OptionsPageView); |
50 }; | 50 }; |
51 | 51 |
52 #endif // CHROME_BROWSER_UI_VIEWS_OPTIONS_OPTIONS_PAGE_VIEW_H__ | 52 #endif // CHROME_BROWSER_UI_VIEWS_OPTIONS_OPTIONS_PAGE_VIEW_H__ |
OLD | NEW |