| 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/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 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 DOMUI::DidBecomeActiveForReusedRenderView(); | 249 DOMUI::DidBecomeActiveForReusedRenderView(); |
| 250 } | 250 } |
| 251 | 251 |
| 252 // static | 252 // static |
| 253 RefCountedMemory* OptionsUI::GetFaviconResourceBytes() { | 253 RefCountedMemory* OptionsUI::GetFaviconResourceBytes() { |
| 254 return ResourceBundle::GetSharedInstance(). | 254 return ResourceBundle::GetSharedInstance(). |
| 255 LoadDataResourceBytes(IDR_SETTINGS_FAVICON); | 255 LoadDataResourceBytes(IDR_SETTINGS_FAVICON); |
| 256 } | 256 } |
| 257 | 257 |
| 258 void OptionsUI::InitializeHandlers() { | 258 void OptionsUI::InitializeHandlers() { |
| 259 DCHECK(!GetProfile()->IsOffTheRecord()); | 259 DCHECK(!GetProfile()->IsOffTheRecord() || Profile::IsGuestSession()); |
| 260 | 260 |
| 261 std::vector<DOMMessageHandler*>::iterator iter; | 261 std::vector<DOMMessageHandler*>::iterator iter; |
| 262 // Skip over the generic handler. | 262 // Skip over the generic handler. |
| 263 for (iter = handlers_.begin() + 1; iter != handlers_.end(); ++iter) { | 263 for (iter = handlers_.begin() + 1; iter != handlers_.end(); ++iter) { |
| 264 (static_cast<OptionsPageUIHandler*>(*iter))->Initialize(); | 264 (static_cast<OptionsPageUIHandler*>(*iter))->Initialize(); |
| 265 } | 265 } |
| 266 } | 266 } |
| 267 | 267 |
| 268 void OptionsUI::AddOptionsPageUIHandler(DictionaryValue* localized_strings, | 268 void OptionsUI::AddOptionsPageUIHandler(DictionaryValue* localized_strings, |
| 269 OptionsPageUIHandler* handler_raw) { | 269 OptionsPageUIHandler* handler_raw) { |
| 270 scoped_ptr<OptionsPageUIHandler> handler(handler_raw); | 270 scoped_ptr<OptionsPageUIHandler> handler(handler_raw); |
| 271 DCHECK(handler.get()); | 271 DCHECK(handler.get()); |
| 272 // Add only if handler's service is enabled. | 272 // Add only if handler's service is enabled. |
| 273 if (handler->IsEnabled()) { | 273 if (handler->IsEnabled()) { |
| 274 handler->GetLocalizedValues(localized_strings); | 274 handler->GetLocalizedValues(localized_strings); |
| 275 // Add handler to the list and also pass the ownership. | 275 // Add handler to the list and also pass the ownership. |
| 276 AddMessageHandler(handler.release()->Attach(this)); | 276 AddMessageHandler(handler.release()->Attach(this)); |
| 277 } | 277 } |
| 278 } | 278 } |
| OLD | NEW |