OLD | NEW |
| (Empty) |
1 // Copyright (c) 2011 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 #include "chrome/browser/ui/views/options/options_page_view.h" | |
6 | |
7 #include "chrome/browser/metrics/user_metrics.h" | |
8 #include "views/widget/widget.h" | |
9 | |
10 /////////////////////////////////////////////////////////////////////////////// | |
11 // OptionsPageView | |
12 | |
13 OptionsPageView::OptionsPageView(Profile* profile) | |
14 : OptionsPageBase(profile), | |
15 initialized_(false) { | |
16 } | |
17 | |
18 OptionsPageView::~OptionsPageView() { | |
19 } | |
20 | |
21 /////////////////////////////////////////////////////////////////////////////// | |
22 // OptionsPageView, views::View overrides: | |
23 | |
24 bool OptionsPageView::CanClose() const { | |
25 return true; | |
26 } | |
27 | |
28 void OptionsPageView::ViewHierarchyChanged(bool is_add, | |
29 views::View* parent, | |
30 views::View* child) { | |
31 if (!initialized_ && is_add && GetWidget()) { | |
32 // It is important that this only get done _once_ otherwise we end up | |
33 // duplicating the view hierarchy when tabs are switched. | |
34 initialized_ = true; | |
35 InitControlLayout(); | |
36 NotifyPrefChanged(NULL); | |
37 } | |
38 } | |
39 | |
40 AccessibilityTypes::Role OptionsPageView::GetAccessibleRole() { | |
41 return AccessibilityTypes::ROLE_PAGETAB; | |
42 } | |
OLD | NEW |