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/webui/chromeos/login/login_ui.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/login_ui.h" |
6 | 6 |
7 #include "base/memory/ref_counted_memory.h" | 7 #include "base/memory/ref_counted_memory.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 10 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 | 49 |
50 void LoginUIHTMLSource::StartDataRequest(const std::string& path, | 50 void LoginUIHTMLSource::StartDataRequest(const std::string& path, |
51 bool is_incognito, | 51 bool is_incognito, |
52 int request_id) { | 52 int request_id) { |
53 SetFontAndTextDirection(localized_strings_.get()); | 53 SetFontAndTextDirection(localized_strings_.get()); |
54 | 54 |
55 base::StringPiece login_html = html_operations_->GetLoginHTML(); | 55 base::StringPiece login_html = html_operations_->GetLoginHTML(); |
56 std::string full_html = html_operations_->GetFullHTML( | 56 std::string full_html = html_operations_->GetFullHTML( |
57 login_html, localized_strings_.get()); | 57 login_html, localized_strings_.get()); |
58 | 58 |
59 scoped_refptr<RefCountedBytes> html_bytes( | 59 SendResponse(request_id, base::RefCountedString::TakeString(&full_html)); |
60 html_operations_->CreateHTMLBytes(full_html)); | |
61 SendResponse(request_id, | |
62 (html_bytes.get())); | |
63 } | 60 } |
64 | 61 |
65 std::string LoginUIHTMLSource::GetMimeType(const std::string&) const { | 62 std::string LoginUIHTMLSource::GetMimeType(const std::string&) const { |
66 return "text/html"; | 63 return "text/html"; |
67 } | 64 } |
68 | 65 |
69 // LoginUI, public: ------------------------------------------------------------ | 66 // LoginUI, public: ------------------------------------------------------------ |
70 | 67 |
71 LoginUI::LoginUI(TabContents* contents) | 68 LoginUI::LoginUI(TabContents* contents) |
72 : ChromeWebUI(contents) { | 69 : ChromeWebUI(contents) { |
(...skipping 14 matching lines...) Expand all Loading... |
87 | 84 |
88 // Load the user-image URLs | 85 // Load the user-image URLs |
89 // Set up the chrome://userimage/ source. | 86 // Set up the chrome://userimage/ source. |
90 chromeos::UserImageSource* user_image_source = | 87 chromeos::UserImageSource* user_image_source = |
91 new chromeos::UserImageSource(); | 88 new chromeos::UserImageSource(); |
92 contents->profile()->GetChromeURLDataManager()->AddDataSource( | 89 contents->profile()->GetChromeURLDataManager()->AddDataSource( |
93 user_image_source); | 90 user_image_source); |
94 } | 91 } |
95 | 92 |
96 } // namespace chromeos | 93 } // namespace chromeos |
OLD | NEW |