Java Code Examples for org.chromium.chrome.browser.partnercustomizations.HomepageManager#getInstance()
The following examples show how to use
org.chromium.chrome.browser.partnercustomizations.HomepageManager#getInstance() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HomepagePreferences.java From delion with Apache License 2.0 | 6 votes |
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); mHomepageManager = HomepageManager.getInstance(getActivity()); getActivity().setTitle(R.string.options_homepage_title); addPreferencesFromResource(R.xml.homepage_preferences); mHomepageSwitch = (ChromeSwitchPreference) findPreference(PREF_HOMEPAGE_SWITCH); boolean isHomepageEnabled = mHomepageManager.getPrefHomepageEnabled(); mHomepageSwitch.setChecked(isHomepageEnabled); mHomepageSwitch.setOnPreferenceChangeListener(new OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { mHomepageManager.setPrefHomepageEnabled((boolean) newValue); return true; } }); mHomepageEdit = findPreference(PREF_HOMEPAGE_EDIT); updateCurrentHomepageUrl(); }
Example 2
Source File: HomepageEditor.java From delion with Apache License 2.0 | 6 votes |
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreate(savedInstanceState); mHomepageManager = HomepageManager.getInstance(getActivity()); getActivity().setTitle(R.string.options_homepage_edit_title); View v = inflater.inflate(R.layout.homepage_editor, container, false); FloatLabelLayout homepageUrl = (FloatLabelLayout) v.findViewById(R.id.homepage_url); homepageUrl.focusWithoutAnimation(); mHomepageUrlEdit = (EditText) v.findViewById(R.id.homepage_url_edit); mHomepageUrlEdit.setText((mHomepageManager.getPrefHomepageUseDefaultUri() ? PartnerBrowserCustomizations.getHomePageUrl() : mHomepageManager.getPrefHomepageCustomUri())); mHomepageUrlEdit.addTextChangedListener(this); initializeSaveCancelResetButtons(v); return v; }
Example 3
Source File: HomepagePreferences.java From AndroidChromium with Apache License 2.0 | 6 votes |
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); mHomepageManager = HomepageManager.getInstance(getActivity()); getActivity().setTitle(R.string.options_homepage_title); addPreferencesFromResource(R.xml.homepage_preferences); mHomepageSwitch = (ChromeSwitchPreference) findPreference(PREF_HOMEPAGE_SWITCH); boolean isHomepageEnabled = mHomepageManager.getPrefHomepageEnabled(); mHomepageSwitch.setChecked(isHomepageEnabled); mHomepageSwitch.setOnPreferenceChangeListener(new OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { mHomepageManager.setPrefHomepageEnabled((boolean) newValue); return true; } }); mHomepageEdit = findPreference(PREF_HOMEPAGE_EDIT); updateCurrentHomepageUrl(); }
Example 4
Source File: HomepageEditor.java From AndroidChromium with Apache License 2.0 | 6 votes |
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreate(savedInstanceState); mHomepageManager = HomepageManager.getInstance(getActivity()); getActivity().setTitle(R.string.options_homepage_edit_title); View v = inflater.inflate(R.layout.homepage_editor, container, false); FloatLabelLayout homepageUrl = (FloatLabelLayout) v.findViewById(R.id.homepage_url); homepageUrl.focusWithoutAnimation(); mHomepageUrlEdit = (EditText) v.findViewById(R.id.homepage_url_edit); mHomepageUrlEdit.setText((mHomepageManager.getPrefHomepageUseDefaultUri() ? PartnerBrowserCustomizations.getHomePageUrl() : mHomepageManager.getPrefHomepageCustomUri())); mHomepageUrlEdit.addTextChangedListener(this); initializeSaveCancelResetButtons(v); return v; }
Example 5
Source File: HomepagePreferences.java From 365browser with Apache License 2.0 | 6 votes |
@Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); mHomepageManager = HomepageManager.getInstance(getActivity()); getActivity().setTitle(R.string.options_homepage_title); addPreferencesFromResource(R.xml.homepage_preferences); mHomepageSwitch = (ChromeSwitchPreference) findPreference(PREF_HOMEPAGE_SWITCH); boolean isHomepageEnabled = mHomepageManager.getPrefHomepageEnabled(); mHomepageSwitch.setChecked(isHomepageEnabled); mHomepageSwitch.setOnPreferenceChangeListener(new OnPreferenceChangeListener() { @Override public boolean onPreferenceChange(Preference preference, Object newValue) { mHomepageManager.setPrefHomepageEnabled((boolean) newValue); return true; } }); mHomepageEdit = findPreference(PREF_HOMEPAGE_EDIT); updateCurrentHomepageUrl(); }
Example 6
Source File: HomepageEditor.java From 365browser with Apache License 2.0 | 6 votes |
@Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { super.onCreate(savedInstanceState); mHomepageManager = HomepageManager.getInstance(getActivity()); getActivity().setTitle(R.string.options_homepage_edit_title); View v = inflater.inflate(R.layout.homepage_editor, container, false); FloatLabelLayout homepageUrl = (FloatLabelLayout) v.findViewById(R.id.homepage_url); homepageUrl.focusWithoutAnimation(); mHomepageUrlEdit = (EditText) v.findViewById(R.id.homepage_url_edit); mHomepageUrlEdit.setText((mHomepageManager.getPrefHomepageUseDefaultUri() ? PartnerBrowserCustomizations.getHomePageUrl() : mHomepageManager.getPrefHomepageCustomUri())); mHomepageUrlEdit.addTextChangedListener(this); initializeSaveCancelResetButtons(v); return v; }