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

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

Issue 166573005: Rename apps::ShellWindow to apps::AppWindow (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase, nits (rename) Created 6 years, 10 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
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 5f516140297f356ce2ae98f5c1a49ccdea97792d..725e9133feb6a5cb8d116947a307d230e642e394 100644
--- a/chrome/browser/extensions/api/identity/web_auth_flow.cc
+++ b/chrome/browser/extensions/api/identity/web_auth_flow.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/extensions/api/identity/web_auth_flow.h"
-#include "apps/shell_window.h"
+#include "apps/app_window.h"
#include "base/base64.h"
#include "base/location.h"
#include "base/message_loop/message_loop.h"
@@ -30,7 +30,7 @@
#include "grit/browser_resources.h"
#include "url/gurl.h"
-using apps::ShellWindow;
+using apps::AppWindow;
using content::RenderViewHost;
using content::ResourceRedirectDetails;
using content::WebContents;
@@ -60,26 +60,26 @@ WebAuthFlow::~WebAuthFlow() {
registrar_.RemoveAll();
WebContentsObserver::Observe(NULL);
- if (!shell_window_key_.empty()) {
- apps::ShellWindowRegistry::Get(profile_)->RemoveObserver(this);
+ if (!app_window_key_.empty()) {
+ apps::AppWindowRegistry::Get(profile_)->RemoveObserver(this);
- if (shell_window_ && shell_window_->web_contents())
- shell_window_->web_contents()->Close();
+ if (app_window_ && app_window_->web_contents())
+ app_window_->web_contents()->Close();
}
}
void WebAuthFlow::Start() {
- apps::ShellWindowRegistry::Get(profile_)->AddObserver(this);
+ apps::AppWindowRegistry::Get(profile_)->AddObserver(this);
// Attach a random ID string to the window so we can recoginize it
- // in OnShellWindowAdded.
+ // in OnAppWindowAdded.
std::string random_bytes;
crypto::RandBytes(WriteInto(&random_bytes, 33), 32);
- base::Base64Encode(random_bytes, &shell_window_key_);
+ base::Base64Encode(random_bytes, &app_window_key_);
// identityPrivate.onWebFlowRequest(shell_window_key, provider_url_, mode_)
scoped_ptr<base::ListValue> args(new base::ListValue());
- args->AppendString(shell_window_key_);
+ args->AppendString(app_window_key_);
args->AppendString(provider_url_.spec());
if (mode_ == WebAuthFlow::INTERACTIVE)
args->AppendString("interactive");
@@ -108,11 +108,11 @@ void WebAuthFlow::DetachDelegateAndDelete() {
base::MessageLoop::current()->DeleteSoon(FROM_HERE, this);
}
-void WebAuthFlow::OnShellWindowAdded(ShellWindow* shell_window) {
- if (shell_window->window_key() == shell_window_key_ &&
- shell_window->extension()->id() == extension_misc::kIdentityApiUiAppId) {
- shell_window_ = shell_window;
- WebContentsObserver::Observe(shell_window->web_contents());
+void WebAuthFlow::OnAppWindowAdded(AppWindow* app_window) {
+ if (app_window->window_key() == app_window_key_ &&
+ app_window->extension()->id() == extension_misc::kIdentityApiUiAppId) {
+ app_window_ = app_window;
+ WebContentsObserver::Observe(app_window->web_contents());
registrar_.Add(
this,
@@ -121,12 +121,12 @@ void WebAuthFlow::OnShellWindowAdded(ShellWindow* shell_window) {
}
}
-void WebAuthFlow::OnShellWindowIconChanged(ShellWindow* shell_window) {}
+void WebAuthFlow::OnAppWindowIconChanged(AppWindow* app_window) {}
-void WebAuthFlow::OnShellWindowRemoved(ShellWindow* shell_window) {
- if (shell_window->window_key() == shell_window_key_ &&
- shell_window->extension()->id() == extension_misc::kIdentityApiUiAppId) {
- shell_window_ = NULL;
+void WebAuthFlow::OnAppWindowRemoved(AppWindow* app_window) {
+ if (app_window->window_key() == app_window_key_ &&
+ app_window->extension()->id() == extension_misc::kIdentityApiUiAppId) {
+ app_window_ = NULL;
registrar_.RemoveAll();
if (delegate_)
@@ -147,7 +147,7 @@ void WebAuthFlow::AfterUrlLoaded() {
void WebAuthFlow::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- DCHECK(shell_window_);
+ DCHECK(app_window_);
if (!delegate_)
return;
@@ -162,7 +162,7 @@ void WebAuthFlow::Observe(int type,
if (web_contents &&
(web_contents->GetEmbedderWebContents() ==
WebContentsObserver::web_contents())) {
- // Switch from watching the shell window to the guest inside it.
+ // Switch from watching the app window to the guest inside it.
embedded_window_created_ = true;
WebContentsObserver::Observe(web_contents);

Powered by Google App Engine
This is Rietveld 408576698