OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/signin/inline_login_ui.h" | 5 #include "chrome/browser/ui/webui/signin/inline_login_ui.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "chrome/browser/ui/webui/chromeos/login/inline_login_handler_chromeos.h
" | 27 #include "chrome/browser/ui/webui/chromeos/login/inline_login_handler_chromeos.h
" |
28 #else | 28 #else |
29 #include "chrome/browser/ui/webui/signin/inline_login_handler_impl.h" | 29 #include "chrome/browser/ui/webui/signin/inline_login_handler_impl.h" |
30 #endif | 30 #endif |
31 | 31 |
32 namespace { | 32 namespace { |
33 | 33 |
34 bool HandleTestFileRequestCallback( | 34 bool HandleTestFileRequestCallback( |
35 const std::string& path, | 35 const std::string& path, |
36 const content::WebUIDataSource::GotDataCallback& callback) { | 36 const content::WebUIDataSource::GotDataCallback& callback) { |
37 std::vector<std::string> url_substr; | 37 std::vector<std::string> url_substr = base::SplitString( |
38 base::SplitString(path, '/', &url_substr); | 38 path, "/", base::TRIM_WHITESPACE, base::SPLIT_WANT_ALL); |
39 if (url_substr.size() != 2 || url_substr[0] != "test") | 39 if (url_substr.size() != 2 || url_substr[0] != "test") |
40 return false; | 40 return false; |
41 | 41 |
42 std::string contents; | 42 std::string contents; |
43 base::FilePath test_data_dir; | 43 base::FilePath test_data_dir; |
44 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir); | 44 PathService::Get(chrome::DIR_TEST_DATA, &test_data_dir); |
45 if (!base::ReadFileToString( | 45 if (!base::ReadFileToString( |
46 test_data_dir.AppendASCII("webui").AppendASCII(url_substr[1]), | 46 test_data_dir.AppendASCII("webui").AppendASCII(url_substr[1]), |
47 &contents, std::string::npos)) | 47 &contents, std::string::npos)) |
48 return false; | 48 return false; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 web_contents->ForEachFrame( | 148 web_contents->ForEachFrame( |
149 base::Bind(&AddToSetIfIsAuthIframe, &frame_set, | 149 base::Bind(&AddToSetIfIsAuthIframe, &frame_set, |
150 parent_origin, parent_frame_name)); | 150 parent_origin, parent_frame_name)); |
151 } | 151 } |
152 DCHECK_GE(1U, frame_set.size()); | 152 DCHECK_GE(1U, frame_set.size()); |
153 if (!frame_set.empty()) | 153 if (!frame_set.empty()) |
154 return *frame_set.begin(); | 154 return *frame_set.begin(); |
155 | 155 |
156 return NULL; | 156 return NULL; |
157 } | 157 } |
OLD | NEW |