Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / webui / identity_internals_ui.cc
index a5def4b..c536177 100644 (file)
@@ -15,6 +15,7 @@
 #include "chrome/browser/extensions/extension_service.h"
 #include "chrome/browser/profiles/profile.h"
 #include "chrome/common/url_constants.h"
+#include "chrome/grit/generated_resources.h"
 #include "content/public/browser/web_ui.h"
 #include "content/public/browser/web_ui_controller.h"
 #include "content/public/browser/web_ui_data_source.h"
@@ -23,7 +24,6 @@
 #include "google_apis/gaia/gaia_auth_fetcher.h"
 #include "google_apis/gaia/gaia_constants.h"
 #include "grit/browser_resources.h"
-#include "grit/generated_resources.h"
 #include "ui/base/l10n/l10n_util.h"
 
 namespace {
@@ -46,7 +46,7 @@ class IdentityInternalsTokenRevoker;
 class IdentityInternalsUIMessageHandler : public content::WebUIMessageHandler {
  public:
   IdentityInternalsUIMessageHandler();
-  virtual ~IdentityInternalsUIMessageHandler();
+  ~IdentityInternalsUIMessageHandler() override;
 
   // Ensures that a proper clean up happens after a token is revoked. That
   // includes deleting the |token_revoker|, removing the token from Identity API
@@ -54,7 +54,7 @@ class IdentityInternalsUIMessageHandler : public content::WebUIMessageHandler {
   void OnTokenRevokerDone(IdentityInternalsTokenRevoker* token_revoker);
 
   // WebUIMessageHandler implementation.
-  virtual void RegisterMessages() OVERRIDE;
+  void RegisterMessages() override;
 
  private:
   // Gets the name of an extension referred to by |token_cache_key| as a string.
@@ -110,7 +110,7 @@ class IdentityInternalsTokenRevoker : public GaiaAuthConsumer {
                                 const std::string& access_token,
                                 Profile* profile,
                                 IdentityInternalsUIMessageHandler* consumer);
-  virtual ~IdentityInternalsTokenRevoker();
+  ~IdentityInternalsTokenRevoker() override;
 
   // Returns the access token being revoked.
   const std::string& access_token() const { return access_token_; }
@@ -119,7 +119,7 @@ class IdentityInternalsTokenRevoker : public GaiaAuthConsumer {
   const std::string& extension_id() const { return extension_id_; }
 
   // GaiaAuthConsumer implementation.
-  virtual void OnOAuth2RevokeTokenCompleted() OVERRIDE;
+  void OnOAuth2RevokeTokenCompleted() override;
 
  private:
   // An object used to start a token revoke request.
@@ -141,9 +141,10 @@ IdentityInternalsUIMessageHandler::~IdentityInternalsUIMessageHandler() {}
 void IdentityInternalsUIMessageHandler::OnTokenRevokerDone(
     IdentityInternalsTokenRevoker* token_revoker) {
   // Remove token from the cache.
-  extensions::IdentityAPI::GetFactoryInstance()->GetForProfile(
-      Profile::FromWebUI(web_ui()))->EraseCachedToken(
-          token_revoker->extension_id(), token_revoker->access_token());
+  extensions::IdentityAPI::GetFactoryInstance()
+      ->Get(Profile::FromWebUI(web_ui()))
+      ->EraseCachedToken(token_revoker->extension_id(),
+                         token_revoker->access_token());
 
   // Update view about the token being removed.
   base::ListValue result;
@@ -220,8 +221,9 @@ void IdentityInternalsUIMessageHandler::GetInfoForAllTokens(
     const base::ListValue* args) {
   base::ListValue results;
   extensions::IdentityAPI::CachedTokens tokens =
-      extensions::IdentityAPI::GetFactoryInstance()->GetForProfile(
-          Profile::FromWebUI(web_ui()))->GetAllCachedTokens();
+      extensions::IdentityAPI::GetFactoryInstance()
+          ->Get(Profile::FromWebUI(web_ui()))
+          ->GetAllCachedTokens();
   for (extensions::IdentityAPI::CachedTokens::const_iterator
            iter = tokens.begin(); iter != tokens.end(); ++iter) {
     results.Append(GetInfoForToken(iter->first, iter->second));
@@ -276,7 +278,6 @@ IdentityInternalsUI::IdentityInternalsUI(content::WebUI* web_ui)
   // chrome://identity-internals source.
   content::WebUIDataSource* html_source =
     content::WebUIDataSource::Create(chrome::kChromeUIIdentityInternalsHost);
-  html_source->SetUseJsonJSFormatV2();
 
   // Localized strings
   html_source->AddLocalizedString("tokenCacheHeader",