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

Unified Diff: chrome/browser/extensions/api/identity/web_auth_flow.cc

Issue 15148007: Identity API: web-based scope approval dialogs for getAuthToken (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address reviewer comments Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/api/identity/web_auth_flow.h ('k') | chrome/chrome_browser_extensions.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/identity/web_auth_flow.cc
diff --git a/chrome/browser/extensions/api/identity/web_auth_flow.cc b/chrome/browser/extensions/api/identity/web_auth_flow.cc
index dd76b47244194855d01f6c31b50b4eb0c8e9122e..3f2d9454f1b297ca13655721ebfac204144cf477 100644
--- a/chrome/browser/extensions/api/identity/web_auth_flow.cc
+++ b/chrome/browser/extensions/api/identity/web_auth_flow.cc
@@ -5,11 +5,13 @@
#include "chrome/browser/extensions/api/identity/web_auth_flow.h"
#include "base/location.h"
+#include "base/utf_string_conversions.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_navigator.h"
#include "content/public/browser/load_notification_details.h"
#include "content/public/browser/navigation_controller.h"
+#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
#include "content/public/browser/notification_types.h"
@@ -72,6 +74,10 @@ void WebAuthFlow::Start() {
this,
content::NOTIFICATION_RESOURCE_RECEIVED_REDIRECT,
content::Source<WebContents>(contents_));
+ registrar_.Add(
+ this,
+ content::NOTIFICATION_WEB_CONTENTS_TITLE_UPDATED,
+ content::Source<WebContents>(contents_));
controller->LoadURL(
provider_url_,
@@ -129,6 +135,15 @@ void WebAuthFlow::Observe(int type,
BeforeUrlLoaded(redirect_details->new_url);
}
break;
+ case content::NOTIFICATION_WEB_CONTENTS_TITLE_UPDATED: {
+ std::pair<content::NavigationEntry*, bool>* title =
+ content::Details<
+ std::pair<content::NavigationEntry*, bool> >(details).ptr();
+
+ if (title->first)
+ delegate_->OnAuthFlowTitleChange(UTF16ToUTF8(title->first->GetTitle()));
+ }
+ break;
default:
NOTREACHED() << "Got a notification that we did not register for: "
<< type;
« no previous file with comments | « chrome/browser/extensions/api/identity/web_auth_flow.h ('k') | chrome/chrome_browser_extensions.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698