1 // Copyright 2016 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef CHROME_BROWSER_UI_WEBUI_SIGNIN_SIGNIN_UTILS_H_ 6 #define CHROME_BROWSER_UI_WEBUI_SIGNIN_SIGNIN_UTILS_H_ 7 8 #include <string> 9 10 #include "base/values.h" 11 12 class Browser; 13 14 namespace content { 15 class RenderFrameHost; 16 class WebContents; 17 class WebUI; 18 } 19 20 namespace signin { 21 22 // Gets a webview within an auth page that has the specified parent frame name 23 // (i.e. <webview name="foobar"></webview>). 24 content::RenderFrameHost* GetAuthFrame(content::WebContents* web_contents, 25 const std::string& parent_frame_name); 26 27 content::WebContents* GetAuthFrameWebContents( 28 content::WebContents* web_contents, 29 const std::string& parent_frame_name); 30 31 // Gets the browser containing the web UI; if none is found, returns the last 32 // active browser for web UI's profile. 33 Browser* GetDesktopBrowser(content::WebUI* web_ui); 34 35 // Sets the height of the WebUI modal dialog after its initialization. This is 36 // needed to better accomodate different locales' text heights. 37 void SetInitializedModalHeight(Browser* browser, 38 content::WebUI* web_ui, 39 const base::ListValue* args); 40 41 } // namespace signin 42 43 #endif // CHROME_BROWSER_UI_WEBUI_SIGNIN_SIGNIN_UTILS_H_ 44