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

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

Issue 591703002: Fixing the locale problem in scope approval dialog (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 "chrome/browser/extensions/api/identity/identity_api.h" 5 #include "chrome/browser/extensions/api/identity/identity_api.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 15 matching lines...) Expand all
26 #include "chrome/common/extensions/api/identity.h" 26 #include "chrome/common/extensions/api/identity.h"
27 #include "chrome/common/extensions/api/identity/oauth2_manifest_handler.h" 27 #include "chrome/common/extensions/api/identity/oauth2_manifest_handler.h"
28 #include "chrome/common/pref_names.h" 28 #include "chrome/common/pref_names.h"
29 #include "chrome/common/url_constants.h" 29 #include "chrome/common/url_constants.h"
30 #include "components/signin/core/browser/profile_oauth2_token_service.h" 30 #include "components/signin/core/browser/profile_oauth2_token_service.h"
31 #include "components/signin/core/browser/signin_manager.h" 31 #include "components/signin/core/browser/signin_manager.h"
32 #include "components/signin/core/common/profile_management_switches.h" 32 #include "components/signin/core/common/profile_management_switches.h"
33 #include "extensions/browser/event_router.h" 33 #include "extensions/browser/event_router.h"
34 #include "extensions/browser/extension_function_dispatcher.h" 34 #include "extensions/browser/extension_function_dispatcher.h"
35 #include "extensions/common/extension.h" 35 #include "extensions/common/extension.h"
36 #include "extensions/common/extension_l10n_util.h"
36 #include "extensions/common/permissions/permission_set.h" 37 #include "extensions/common/permissions/permission_set.h"
37 #include "extensions/common/permissions/permissions_data.h" 38 #include "extensions/common/permissions/permissions_data.h"
38 #include "google_apis/gaia/gaia_urls.h" 39 #include "google_apis/gaia/gaia_urls.h"
39 #include "url/gurl.h" 40 #include "url/gurl.h"
40 41
41 #if defined(OS_CHROMEOS) 42 #if defined(OS_CHROMEOS)
42 #include "chrome/browser/chromeos/login/session/user_session_manager.h" 43 #include "chrome/browser/chromeos/login/session/user_session_manager.h"
43 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" 44 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
44 #include "chrome/browser/chromeos/settings/device_oauth2_token_service.h" 45 #include "chrome/browser/chromeos/settings/device_oauth2_token_service.h"
45 #include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h " 46 #include "chrome/browser/chromeos/settings/device_oauth2_token_service_factory.h "
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after
767 mint_token_flow_->Start(); 768 mint_token_flow_->Start();
768 } 769 }
769 770
770 void IdentityGetAuthTokenFunction::ShowLoginPopup() { 771 void IdentityGetAuthTokenFunction::ShowLoginPopup() {
771 signin_flow_.reset(new IdentitySigninFlow(this, GetProfile())); 772 signin_flow_.reset(new IdentitySigninFlow(this, GetProfile()));
772 signin_flow_->Start(); 773 signin_flow_->Start();
773 } 774 }
774 775
775 void IdentityGetAuthTokenFunction::ShowOAuthApprovalDialog( 776 void IdentityGetAuthTokenFunction::ShowOAuthApprovalDialog(
776 const IssueAdviceInfo& issue_advice) { 777 const IssueAdviceInfo& issue_advice) {
777 const std::string locale = g_browser_process->local_state()->GetString( 778 const std::string locale = extension_l10n_util::CurrentLocaleOrDefault();
778 prefs::kApplicationLocale);
779 779
780 gaia_web_auth_flow_.reset(new GaiaWebAuthFlow( 780 gaia_web_auth_flow_.reset(new GaiaWebAuthFlow(
781 this, GetProfile(), token_key_.get(), oauth2_client_id_, locale)); 781 this, GetProfile(), token_key_.get(), oauth2_client_id_, locale));
782 gaia_web_auth_flow_->Start(); 782 gaia_web_auth_flow_->Start();
783 } 783 }
784 784
785 OAuth2MintTokenFlow* IdentityGetAuthTokenFunction::CreateMintTokenFlow( 785 OAuth2MintTokenFlow* IdentityGetAuthTokenFunction::CreateMintTokenFlow(
786 const std::string& login_access_token) { 786 const std::string& login_access_token) {
787 OAuth2MintTokenFlow* mint_token_flow = new OAuth2MintTokenFlow( 787 OAuth2MintTokenFlow* mint_token_flow = new OAuth2MintTokenFlow(
788 GetProfile()->GetRequestContext(), 788 GetProfile()->GetRequestContext(),
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 void IdentityLaunchWebAuthFlowFunction::OnAuthFlowURLChange( 943 void IdentityLaunchWebAuthFlowFunction::OnAuthFlowURLChange(
944 const GURL& redirect_url) { 944 const GURL& redirect_url) {
945 if (redirect_url.GetWithEmptyPath() == final_url_prefix_) { 945 if (redirect_url.GetWithEmptyPath() == final_url_prefix_) {
946 SetResult(new base::StringValue(redirect_url.spec())); 946 SetResult(new base::StringValue(redirect_url.spec()));
947 SendResponse(true); 947 SendResponse(true);
948 Release(); // Balanced in RunAsync. 948 Release(); // Balanced in RunAsync.
949 } 949 }
950 } 950 }
951 951
952 } // namespace extensions 952 } // namespace extensions
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