| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/bind.h" | 5 #include "base/bind.h" |
| 6 #include "base/compiler_specific.h" | 6 #include "base/compiler_specific.h" |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "base/strings/string_tokenizer.h" | 8 #include "base/strings/string_tokenizer.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "mojo/public/cpp/application/application_connection.h" | 10 #include "mojo/public/cpp/application/application_connection.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 virtual ~LaunchInstance() {} | 51 virtual ~LaunchInstance() {} |
| 52 | 52 |
| 53 private: | 53 private: |
| 54 void OnReceivedResponse(URLResponsePtr response); | 54 void OnReceivedResponse(URLResponsePtr response); |
| 55 | 55 |
| 56 std::string GetContentType(const Array<String>& headers) { | 56 std::string GetContentType(const Array<String>& headers) { |
| 57 for (size_t i = 0; i < headers.size(); ++i) { | 57 for (size_t i = 0; i < headers.size(); ++i) { |
| 58 base::StringTokenizer t(headers[i], ": ;="); | 58 base::StringTokenizer t(headers[i], ": ;="); |
| 59 while (t.GetNext()) { | 59 while (t.GetNext()) { |
| 60 if (!t.token_is_delim() && | 60 if (!t.token_is_delim() && |
| 61 base::LowerCaseEqualsASCII(t.token(), "content-type")) { | 61 LowerCaseEqualsASCII(t.token(), "content-type")) { |
| 62 while (t.GetNext()) { | 62 while (t.GetNext()) { |
| 63 if (!t.token_is_delim()) | 63 if (!t.token_is_delim()) |
| 64 return t.token(); | 64 return t.token(); |
| 65 } | 65 } |
| 66 } | 66 } |
| 67 } | 67 } |
| 68 } | 68 } |
| 69 return ""; | 69 return ""; |
| 70 } | 70 } |
| 71 | 71 |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 } | 173 } |
| 174 ScheduleDestroy(); | 174 ScheduleDestroy(); |
| 175 } | 175 } |
| 176 | 176 |
| 177 // static | 177 // static |
| 178 ApplicationDelegate* ApplicationDelegate::Create() { | 178 ApplicationDelegate* ApplicationDelegate::Create() { |
| 179 return new LauncherApp; | 179 return new LauncherApp; |
| 180 } | 180 } |
| 181 | 181 |
| 182 } // namespace mojo | 182 } // namespace mojo |
| OLD | NEW |