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 #include "chrome/browser/dom_ui/constrained_html_ui.h" | 5 #include "chrome/browser/dom_ui/constrained_html_ui.h" |
6 | 6 |
7 #include "base/singleton.h" | 7 #include "base/lazy_instance.h" |
8 #include "chrome/browser/dom_ui/dom_ui_util.h" | 8 #include "chrome/browser/dom_ui/dom_ui_util.h" |
9 #include "chrome/browser/dom_ui/html_dialog_ui.h" | 9 #include "chrome/browser/dom_ui/html_dialog_ui.h" |
10 #include "chrome/browser/renderer_host/render_view_host.h" | 10 #include "chrome/browser/renderer_host/render_view_host.h" |
11 #include "chrome/common/bindings_policy.h" | 11 #include "chrome/common/bindings_policy.h" |
12 | 12 |
| 13 static base::LazyInstance<PropertyAccessor<ConstrainedHtmlUIDelegate*> > |
| 14 g_constrained_html_ui_property_accessor(base::LINKER_INITIALIZED); |
| 15 |
13 ConstrainedHtmlUI::ConstrainedHtmlUI(TabContents* contents) | 16 ConstrainedHtmlUI::ConstrainedHtmlUI(TabContents* contents) |
14 : DOMUI(contents) { | 17 : DOMUI(contents) { |
15 } | 18 } |
16 | 19 |
17 ConstrainedHtmlUI::~ConstrainedHtmlUI() { | 20 ConstrainedHtmlUI::~ConstrainedHtmlUI() { |
18 } | 21 } |
19 | 22 |
20 void ConstrainedHtmlUI::RenderViewCreated( | 23 void ConstrainedHtmlUI::RenderViewCreated( |
21 RenderViewHost* render_view_host) { | 24 RenderViewHost* render_view_host) { |
22 HtmlDialogUIDelegate* delegate = | 25 HtmlDialogUIDelegate* delegate = |
(...skipping 20 matching lines...) Expand all Loading... |
43 } | 46 } |
44 | 47 |
45 ConstrainedHtmlUIDelegate* | 48 ConstrainedHtmlUIDelegate* |
46 ConstrainedHtmlUI::GetConstrainedDelegate() { | 49 ConstrainedHtmlUI::GetConstrainedDelegate() { |
47 return *GetPropertyAccessor().GetProperty(tab_contents()->property_bag()); | 50 return *GetPropertyAccessor().GetProperty(tab_contents()->property_bag()); |
48 } | 51 } |
49 | 52 |
50 // static | 53 // static |
51 PropertyAccessor<ConstrainedHtmlUIDelegate*>& | 54 PropertyAccessor<ConstrainedHtmlUIDelegate*>& |
52 ConstrainedHtmlUI::GetPropertyAccessor() { | 55 ConstrainedHtmlUI::GetPropertyAccessor() { |
53 return *Singleton<PropertyAccessor<ConstrainedHtmlUIDelegate*> >::get(); | 56 return g_constrained_html_ui_property_accessor.Get(); |
54 } | 57 } |
OLD | NEW |