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/options/options_ui.h" | 5 #include "chrome/browser/dom_ui/options/options_ui.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "app/resource_bundle.h" | 9 #include "app/resource_bundle.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 // OptionsPageUIHandler | 115 // OptionsPageUIHandler |
116 // | 116 // |
117 //////////////////////////////////////////////////////////////////////////////// | 117 //////////////////////////////////////////////////////////////////////////////// |
118 | 118 |
119 OptionsPageUIHandler::OptionsPageUIHandler() { | 119 OptionsPageUIHandler::OptionsPageUIHandler() { |
120 } | 120 } |
121 | 121 |
122 OptionsPageUIHandler::~OptionsPageUIHandler() { | 122 OptionsPageUIHandler::~OptionsPageUIHandler() { |
123 } | 123 } |
124 | 124 |
| 125 bool OptionsPageUIHandler::IsEnabled() { |
| 126 return true; |
| 127 } |
| 128 |
125 void OptionsPageUIHandler::UserMetricsRecordAction( | 129 void OptionsPageUIHandler::UserMetricsRecordAction( |
126 const UserMetricsAction& action) { | 130 const UserMetricsAction& action) { |
127 UserMetrics::RecordAction(action, dom_ui_->GetProfile()); | 131 UserMetrics::RecordAction(action, dom_ui_->GetProfile()); |
128 } | 132 } |
129 | 133 |
130 //////////////////////////////////////////////////////////////////////////////// | 134 //////////////////////////////////////////////////////////////////////////////// |
131 // | 135 // |
132 // OptionsUI | 136 // OptionsUI |
133 // | 137 // |
134 //////////////////////////////////////////////////////////////////////////////// | 138 //////////////////////////////////////////////////////////////////////////////// |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 OptionsPageUIHandler* handler_raw) { | 268 OptionsPageUIHandler* handler_raw) { |
265 scoped_ptr<OptionsPageUIHandler> handler(handler_raw); | 269 scoped_ptr<OptionsPageUIHandler> handler(handler_raw); |
266 DCHECK(handler.get()); | 270 DCHECK(handler.get()); |
267 // Add only if handler's service is enabled. | 271 // Add only if handler's service is enabled. |
268 if (handler->IsEnabled()) { | 272 if (handler->IsEnabled()) { |
269 handler->GetLocalizedValues(localized_strings); | 273 handler->GetLocalizedValues(localized_strings); |
270 // Add handler to the list and also pass the ownership. | 274 // Add handler to the list and also pass the ownership. |
271 AddMessageHandler(handler.release()->Attach(this)); | 275 AddMessageHandler(handler.release()->Attach(this)); |
272 } | 276 } |
273 } | 277 } |
OLD | NEW |