Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: chrome/browser/ui/webui/options/options_ui.cc

Issue 16290004: Update chrome/ to use scoped_refptr<T>::get() rather than implicit "operator T*" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/webui/options/options_ui.h" 5 #include "chrome/browser/ui/webui/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 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 } else if (path == kOptionsBundleJsFile) { 155 } else if (path == kOptionsBundleJsFile) {
156 // Return (and cache) the options javascript code. 156 // Return (and cache) the options javascript code.
157 response_bytes = ui::ResourceBundle::GetSharedInstance(). 157 response_bytes = ui::ResourceBundle::GetSharedInstance().
158 LoadDataResourceBytes(IDR_OPTIONS_BUNDLE_JS); 158 LoadDataResourceBytes(IDR_OPTIONS_BUNDLE_JS);
159 } else { 159 } else {
160 // Return (and cache) the main options html page as the default. 160 // Return (and cache) the main options html page as the default.
161 response_bytes = ui::ResourceBundle::GetSharedInstance(). 161 response_bytes = ui::ResourceBundle::GetSharedInstance().
162 LoadDataResourceBytes(IDR_OPTIONS_HTML); 162 LoadDataResourceBytes(IDR_OPTIONS_HTML);
163 } 163 }
164 164
165 callback.Run(response_bytes); 165 callback.Run(response_bytes.get());
166 } 166 }
167 167
168 std::string OptionsUIHTMLSource::GetMimeType(const std::string& path) const { 168 std::string OptionsUIHTMLSource::GetMimeType(const std::string& path) const {
169 if (path == kLocalizedStringsFile || path == kOptionsBundleJsFile) 169 if (path == kLocalizedStringsFile || path == kOptionsBundleJsFile)
170 return "application/javascript"; 170 return "application/javascript";
171 171
172 return "text/html"; 172 return "text/html";
173 } 173 }
174 174
175 bool OptionsUIHTMLSource::ShouldDenyXFrameOptions() const { 175 bool OptionsUIHTMLSource::ShouldDenyXFrameOptions() const {
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 // Add only if handler's service is enabled. 424 // Add only if handler's service is enabled.
425 if (handler->IsEnabled()) { 425 if (handler->IsEnabled()) {
426 // Add handler to the list and also pass the ownership. 426 // Add handler to the list and also pass the ownership.
427 web_ui()->AddMessageHandler(handler.release()); 427 web_ui()->AddMessageHandler(handler.release());
428 handler_raw->GetLocalizedValues(localized_strings); 428 handler_raw->GetLocalizedValues(localized_strings);
429 handlers_.push_back(handler_raw); 429 handlers_.push_back(handler_raw);
430 } 430 }
431 } 431 }
432 432
433 } // namespace options 433 } // namespace options
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/import_data_handler.cc ('k') | chrome/browser/ui/webui/print_preview/print_preview_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698