/**
  * Opens the single origin settings page for the given URL.
  *
  * @param url The URL to show the single origin settings for. This is a complete url including
  *     scheme, domain, port, path, etc.
  */
 protected void showSingleOriginSettings(String url) {
   Bundle fragmentArgs = SingleWebsitePreferences.createFragmentArgsForSite(url);
   Intent intent =
       PreferencesLauncher.createIntentForSettingsPage(
           this, SingleWebsitePreferences.class.getName());
   intent.putExtra(Preferences.EXTRA_SHOW_FRAGMENT_ARGUMENTS, fragmentArgs);
   startActivity(intent);
 }
Пример #2
0
 private void onLocationLinkClicked() {
   if (!LocationSettings.getInstance().isSystemLocationSettingEnabled()) {
     mContext.startActivity(LocationSettings.getInstance().getSystemLocationSettingsIntent());
   } else {
     Intent settingsIntent =
         PreferencesLauncher.createIntentForSettingsPage(
             mContext, SingleWebsitePreferences.class.getName());
     String url =
         TemplateUrlService.getInstance()
             .getSearchEngineUrlFromTemplateUrl(toIndex(mSelectedSearchEnginePosition));
     Bundle fragmentArgs = SingleWebsitePreferences.createFragmentArgsForSite(url);
     fragmentArgs.putBoolean(
         SingleWebsitePreferences.EXTRA_LOCATION,
         locationEnabled(mSelectedSearchEnginePosition, true));
     settingsIntent.putExtra(Preferences.EXTRA_SHOW_FRAGMENT_ARGUMENTS, fragmentArgs);
     mContext.startActivity(settingsIntent);
   }
   mCallback.onDismissDialog();
 }