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

Unified Diff: chrome/browser/ui/webui/chromeos/login/base_screen_handler.h

Issue 2701023003: cros: Move call js prefix out of ctor. (Closed)
Patch Set: Created 3 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/ui/webui/chromeos/login/base_screen_handler.h
diff --git a/chrome/browser/ui/webui/chromeos/login/base_screen_handler.h b/chrome/browser/ui/webui/chromeos/login/base_screen_handler.h
index 4c485f58039364806eff24c459b1552bc4f988f3..2e46198a8b3133fcf74b2347f5bbe7d6a0bf5daf 100644
--- a/chrome/browser/ui/webui/chromeos/login/base_screen_handler.h
+++ b/chrome/browser/ui/webui/chromeos/login/base_screen_handler.h
@@ -36,12 +36,7 @@ class OobeUI;
class BaseScreenHandler : public content::WebUIMessageHandler,
public ModelViewChannel {
public:
- // C-tor used when JS screen prefix is not needed.
BaseScreenHandler();
-
- // C-tor used when JS screen prefix is needed.
- explicit BaseScreenHandler(const std::string& js_screen_path);
-
~BaseScreenHandler() override;
// Gets localized strings to be used on the page.
@@ -65,6 +60,13 @@ class BaseScreenHandler : public content::WebUIMessageHandler,
return async_assets_load_id_;
}
+ // Set the prefix used when running CallJs with a method. For example,
+ // set_call_js_prefix("Oobe")
+ // CallJs("lock") -> Invokes JS global named "Oobe.lock"
+ void set_call_js_prefix(const std::string& prefix) {
+ js_screen_path_prefix_ = prefix + ".";
+ }
+
protected:
// All subclasses should implement this method to provide localized values.
virtual void DeclareLocalizedValues(
@@ -178,9 +180,9 @@ class BaseScreenHandler : public content::WebUIMessageHandler,
void HandleContextChanged(const base::DictionaryValue* diff);
// Keeps whether page is ready.
- bool page_is_ready_;
+ bool page_is_ready_ = false;
- BaseScreen* base_screen_;
+ BaseScreen* base_screen_ = nullptr;
// Full name of the corresponding JS screen object. Can be empty, if
// there are no corresponding screen object or several different

Powered by Google App Engine
This is Rietveld 408576698