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

Unified Diff: chrome/browser/ui/webui/signin/signin_utils.cc

Issue 2275883003: [Signin Error Dialog] (2/3) Added handlers and UI constructors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@error-modal-web
Patch Set: Final nit from tommycli Created 4 years, 4 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/ui/webui/signin/signin_utils.cc
diff --git a/chrome/browser/ui/webui/signin/get_auth_frame.cc b/chrome/browser/ui/webui/signin/signin_utils.cc
similarity index 67%
rename from chrome/browser/ui/webui/signin/get_auth_frame.cc
rename to chrome/browser/ui/webui/signin/signin_utils.cc
index f5705a299978da8b6e019b339a5c9d7edd28903a..9adc9ac4e5f7cc56f6e561ad346615f8bccb0cf5 100644
--- a/chrome/browser/ui/webui/signin/get_auth_frame.cc
+++ b/chrome/browser/ui/webui/signin/signin_utils.cc
@@ -2,13 +2,16 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/ui/webui/signin/get_auth_frame.h"
+#include "chrome/browser/ui/webui/signin/signin_utils.h"
#include <set>
#include "base/bind.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/browser_finder.h"
#include "components/guest_view/browser/guest_view_manager.h"
#include "content/public/browser/web_contents.h"
+#include "content/public/browser/web_ui.h"
#include "extensions/browser/guest_view/web_view/web_view_guest.h"
namespace {
@@ -51,4 +54,24 @@ content::WebContents* GetAuthFrameWebContents(
return nullptr;
}
+Browser* GetDesktopBrowser(content::WebUI* web_ui) {
+ Browser* browser =
+ chrome::FindBrowserWithWebContents(web_ui->GetWebContents());
+ if (!browser)
+ browser = chrome::FindLastActiveWithProfile(Profile::FromWebUI(web_ui));
+ return browser;
+}
+
+void SetInitializedModalHeight(content::WebUI* web_ui,
+ const base::ListValue* args) {
+ double height;
+ bool success = args->GetDouble(0, &height);
+ DCHECK(success);
+
+ Browser* browser = GetDesktopBrowser(web_ui);
+ DCHECK(browser);
+ browser->signin_view_controller()->SetModalSigninHeight(
+ static_cast<int>(height));
+}
+
} // namespace signin
« no previous file with comments | « chrome/browser/ui/webui/signin/signin_utils.h ('k') | chrome/browser/ui/webui/signin/sync_confirmation_handler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698