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

Side by Side Diff: chrome/browser/extensions/api/identity/identity_apitest.cc

Issue 1116633003: Replacing const by value return values into const by ref in chrome/browser/extensions/api/identity (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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 | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <set> 5 #include <set>
6 #include <string> 6 #include <string>
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 extension_id_ = ext->id(); 717 extension_id_ = ext->id();
718 oauth_scopes_ = std::set<std::string>(oauth2_info.scopes.begin(), 718 oauth_scopes_ = std::set<std::string>(oauth2_info.scopes.begin(),
719 oauth2_info.scopes.end()); 719 oauth2_info.scopes.end());
720 return ext; 720 return ext;
721 } 721 }
722 722
723 IdentityAPI* id_api() { 723 IdentityAPI* id_api() {
724 return IdentityAPI::GetFactoryInstance()->Get(browser()->profile()); 724 return IdentityAPI::GetFactoryInstance()->Get(browser()->profile());
725 } 725 }
726 726
727 const std::string GetPrimaryAccountId() { 727 const std::string& GetPrimaryAccountId() {
728 SigninManagerBase* signin_manager = 728 SigninManagerBase* signin_manager =
729 SigninManagerFactory::GetForProfile(browser()->profile()); 729 SigninManagerFactory::GetForProfile(browser()->profile());
730 return signin_manager->GetAuthenticatedAccountId(); 730 return signin_manager->GetAuthenticatedAccountId();
731 } 731 }
732 732
733 void SetCachedToken(const IdentityTokenCacheValue& token_data) { 733 void SetCachedToken(const IdentityTokenCacheValue& token_data) {
734 ExtensionTokenKey key(extension_id_, GetPrimaryAccountId(), oauth_scopes_); 734 ExtensionTokenKey key(extension_id_, GetPrimaryAccountId(), oauth_scopes_);
735 id_api()->SetCachedToken(key, token_data); 735 id_api()->SetCachedToken(key, token_data);
736 } 736 }
737 737
(...skipping 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after
1825 EXPECT_EQ(std::string("https://abcdefghij.chromiumapp.org/callback#test"), 1825 EXPECT_EQ(std::string("https://abcdefghij.chromiumapp.org/callback#test"),
1826 url); 1826 url);
1827 } 1827 }
1828 1828
1829 } // namespace extensions 1829 } // namespace extensions
1830 1830
1831 // Tests the chrome.identity API implemented by custom JS bindings . 1831 // Tests the chrome.identity API implemented by custom JS bindings .
1832 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ChromeIdentityJsBindings) { 1832 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ChromeIdentityJsBindings) {
1833 ASSERT_TRUE(RunExtensionTest("identity/js_bindings")) << message_; 1833 ASSERT_TRUE(RunExtensionTest("identity/js_bindings")) << message_;
1834 } 1834 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698