• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3 // found in the LICENSE file.
4 
5 #include "chrome/browser/extensions/api/identity/extension_token_key.h"
6 
7 namespace extensions {
8 
ExtensionTokenKey(const std::string & extension_id,const std::string & account_id,const std::set<std::string> & scopes)9 ExtensionTokenKey::ExtensionTokenKey(const std::string& extension_id,
10                                      const std::string& account_id,
11                                      const std::set<std::string>& scopes)
12     : extension_id(extension_id), account_id(account_id), scopes(scopes) {}
13 
~ExtensionTokenKey()14 ExtensionTokenKey::~ExtensionTokenKey() {}
15 
operator <(const ExtensionTokenKey & rhs) const16 bool ExtensionTokenKey::operator<(const ExtensionTokenKey& rhs) const {
17   if (extension_id < rhs.extension_id)
18     return true;
19   else if (rhs.extension_id < extension_id)
20     return false;
21 
22   if (account_id < rhs.account_id)
23     return true;
24   else if (rhs.account_id < account_id)
25     return false;
26 
27   return scopes < rhs.scopes;
28 }
29 
30 }  // namespace extensions
31