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