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

Side by Side Diff: remoting/host/it2me/it2me_host.cc

Issue 1233043003: Remove some legacy versions of StartsWith and EndsWith. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « pdf/document_loader.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "remoting/host/it2me/it2me_host.h" 5 #include "remoting/host/it2me/it2me_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/callback_helpers.h" 8 #include "base/callback_helpers.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/threading/platform_thread.h" 10 #include "base/threading/platform_thread.h"
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread()); 190 DCHECK(host_context_->network_task_runner()->BelongsToCurrentThread());
191 191
192 if (state_ != kStarting) { 192 if (state_ != kStarting) {
193 // Host has been stopped while we were fetching policy. 193 // Host has been stopped while we were fetching policy.
194 return; 194 return;
195 } 195 }
196 196
197 // Check the host domain policy. 197 // Check the host domain policy.
198 if (!required_host_domain_.empty() && 198 if (!required_host_domain_.empty() &&
199 !base::EndsWith(xmpp_server_config_.username, 199 !base::EndsWith(xmpp_server_config_.username,
200 std::string("@") + required_host_domain_, false)) { 200 std::string("@") + required_host_domain_,
201 base::CompareCase::INSENSITIVE_ASCII)) {
201 SetState(kInvalidDomainError, ""); 202 SetState(kInvalidDomainError, "");
202 return; 203 return;
203 } 204 }
204 205
205 // Generate a key pair for the Host to use. 206 // Generate a key pair for the Host to use.
206 // TODO(wez): Move this to the worker thread. 207 // TODO(wez): Move this to the worker thread.
207 host_key_pair_ = RsaKeyPair::Generate(); 208 host_key_pair_ = RsaKeyPair::Generate();
208 209
209 // Create XMPP connection. 210 // Create XMPP connection.
210 scoped_ptr<SignalStrategy> signal_strategy( 211 scoped_ptr<SignalStrategy> signal_strategy(
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 scoped_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory( 533 scoped_ptr<It2MeConfirmationDialogFactory> confirmation_dialog_factory(
533 new It2MeConfirmationDialogFactory()); 534 new It2MeConfirmationDialogFactory());
534 scoped_ptr<PolicyWatcher> policy_watcher = 535 scoped_ptr<PolicyWatcher> policy_watcher =
535 PolicyWatcher::Create(policy_service_, context->file_task_runner()); 536 PolicyWatcher::Create(policy_service_, context->file_task_runner());
536 return new It2MeHost(context.Pass(), policy_watcher.Pass(), 537 return new It2MeHost(context.Pass(), policy_watcher.Pass(),
537 confirmation_dialog_factory.Pass(), 538 confirmation_dialog_factory.Pass(),
538 observer, xmpp_server_config, directory_bot_jid); 539 observer, xmpp_server_config, directory_bot_jid);
539 } 540 }
540 541
541 } // namespace remoting 542 } // namespace remoting
OLDNEW
« no previous file with comments | « pdf/document_loader.cc ('k') | remoting/host/remoting_me2me_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698