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