Index: chrome/browser/extensions/api/identity/identity_api.cc |
=================================================================== |
--- chrome/browser/extensions/api/identity/identity_api.cc (revision 133968) |
+++ chrome/browser/extensions/api/identity/identity_api.cc (working copy) |
@@ -8,11 +8,20 @@ |
#include "chrome/browser/extensions/extension_function_dispatcher.h" |
#include "chrome/browser/signin/token_service.h" |
#include "chrome/browser/signin/token_service_factory.h" |
+#include "chrome/browser/tab_contents/tab_util.h" |
#include "chrome/browser/ui/browser.h" |
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
#include "chrome/common/extensions/extension.h" |
+#include "content/public/browser/web_contents.h" |
+#include "content/public/browser/web_contents_delegate.h" |
#include "googleurl/src/gurl.h" |
+#include "ui/views/controls/webview/webview.h" |
+#include "ui/views/widget/widget.h" |
+#include "ui/views/widget/widget_delegate.h" |
+using content::WebContents; |
+using content::WebContentsDelegate; |
+ |
namespace extensions { |
namespace { |
@@ -70,4 +79,27 @@ |
Release(); // Balanced in RunImpl. |
} |
+LaunchAuthFlowFunction::LaunchAuthFlowFunction() {} |
+LaunchAuthFlowFunction::~LaunchAuthFlowFunction() {} |
+ |
+bool LaunchAuthFlowFunction::RunImpl() { |
+ GURL auth_url( |
+ "https://www.facebook.com/dialog/oauth" |
+ "?client_id=223140341116959" |
+ "&redirect_uri=http://munjalsample.appspot.com" |
+ "&response_type=token&scope=user_photos"); |
+ auth_flow_.reset(new ExtensionAuthFlow( |
+ this, profile(), GetExtension()->id(), auth_url)); |
+ auth_flow_->Start(); |
+ AddRef(); |
+ return true; |
+} |
+ |
+void LaunchAuthFlowFunction::OnAuthFlowCompleted( |
+ const std::string& redirect_url) { |
+ result_.reset(Value::CreateStringValue(redirect_url)); |
+ SendResponse(true); |
+ Release(); |
+} |
+ |
} // namespace extensions |