Rename WebsiteSettings code to PageInfo.
This was automated using a script [1] that does the following: - Rename relevant files in the following folders from website_settings* to page_info*: - chrome/browser/ui/page_info - chrome/browser/ui/cocoa/page_info - chrome/browser/ui/views/page_info - chrome/browser/ui/android/page_info - chrome/android/java/res/layout - Run `./tools/git/mass-rename.py` to update e.g. includes, build files, header guards. - mass-rename.py does not handle test files (https://crbug.com/701529) or Java, so those are handled separately, either in an early step are as part of the later renames. - `page_info_bubble_controller.h` needs a separate header guard fix. - Use `sed` to rename classes, enums, non-UMA strings, and comments *WebsiteSettings* to *PageInfo* across the entire Chromium project. - Since several content settings classes are also called "WebsiteSettings", this is done by taking a full list of all occurrences of full tokens containing "WebsiteSettings", "website_settings", or "website settings" and whitelisting individual replacements. - To avoid modifying strings, all lines containing the relevant tokens *following at least one quote mark on the same line* are preserved, except two individually handled cases. There do not appear to be any affected multi-line strings. - `git cl format` - Remove two long-standing TODO comments about this rename, in: - PageInfoPopup.java - page_info_bubble_controller.h This CL does not attempt to reflow comments; all changes stay within 80 lines, though. [1] https://github.com/lgarron/website-settings-to-page-info/blob/master/page_info.fish BUG=571506 TBR=jochen@chromium.org Review-Url: https://codereview.chromium.org/2754383004 Cr-Commit-Position: refs/heads/master@{#459562}
This commit is contained in:
build/android/pylib/gtest/filter
chrome
BUILD.gn
android
BUILD.gn
java
java_sources.gniapp
browser
BUILD.gn
android
chromeos
ui
BUILD.gn
android
page_info
autofill
browser_commands.ccbrowser_commands.hbrowser_dialogs.hbrowser_window.hcocoa
browser_window_cocoa.hbrowser_window_cocoa.mm
location_bar
page_info
page_info_bubble_controller.hpage_info_bubble_controller.mmpage_info_bubble_controller_unittest.mmpage_info_utils_cocoa.hpage_info_utils_cocoa.mmpermission_selector_button.hpermission_selector_button.mmpermission_selector_button_unittest.mmwebsite_settings_utils_cocoa.h
permission_bubble
login
page_info
page_info.ccpage_info.hpage_info_infobar_delegate.ccpage_info_infobar_delegate.hpage_info_ui.ccpage_info_ui.hpage_info_unittest.ccpermission_menu_model.ccpermission_menu_model.hpermission_menu_model_unittest.cc
views
browser_dialogs_views_mac.cc
frame
location_bar
page_info
chosen_object_row.ccchosen_object_row.hchosen_object_row_observer.hpage_info_popup_view.ccpage_info_popup_view.hpage_info_popup_view_interactive_uitest.ccpage_info_popup_view_unittest.ccpermission_selector_row.ccpermission_selector_row.hpermission_selector_row_observer.h
permission_bubble
toolbar
webui
vr_shell
test
components
docs/ui/views
ios/chrome/browser/ui/dialogs
tools/metrics
@@ -26,7 +26,7 @@ DownloadItemModelTest.InterruptTooltip
|
|||||||
# l10n_util.cc(655)] Check failed: std::string::npos != pos
|
# l10n_util.cc(655)] Check failed: std::string::npos != pos
|
||||||
DownloadItemModelTest.InterruptStatus
|
DownloadItemModelTest.InterruptStatus
|
||||||
# l10n_util.cc(655)] Check failed: std::string::npos != pos
|
# l10n_util.cc(655)] Check failed: std::string::npos != pos
|
||||||
WebsiteSettingsTest.OnSiteDataAccessed
|
PageInfoTest.OnSiteDataAccessed
|
||||||
|
|
||||||
# crbug.com/139423
|
# crbug.com/139423
|
||||||
ValueStoreFrontendTest.GetExistingData
|
ValueStoreFrontendTest.GetExistingData
|
||||||
|
@@ -1548,13 +1548,13 @@ if (is_android) {
|
|||||||
|
|
||||||
java_cpp_enum("page_info_connection_type_javagen") {
|
java_cpp_enum("page_info_connection_type_javagen") {
|
||||||
sources = [
|
sources = [
|
||||||
"browser/ui/android/page_info/website_settings_popup_android.h",
|
"browser/ui/android/page_info/page_info_popup_android.h",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
java_cpp_enum("website_settings_action_javagen") {
|
java_cpp_enum("page_info_action_javagen") {
|
||||||
sources = [
|
sources = [
|
||||||
"browser/ui/page_info/website_settings.h",
|
"browser/ui/page_info/page_info.h",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -254,7 +254,7 @@ android_library("chrome_java") {
|
|||||||
"//chrome:signin_metrics_enum_javagen",
|
"//chrome:signin_metrics_enum_javagen",
|
||||||
"//chrome:quick_action_category_enum_javagen",
|
"//chrome:quick_action_category_enum_javagen",
|
||||||
"//chrome:page_info_connection_type_javagen",
|
"//chrome:page_info_connection_type_javagen",
|
||||||
"//chrome:website_settings_action_javagen",
|
"//chrome:page_info_action_javagen",
|
||||||
"//components/browsing_data/core:browsing_data_utils_java",
|
"//components/browsing_data/core:browsing_data_utils_java",
|
||||||
"//components/browsing_data/core:clear_browsing_data_tab_java",
|
"//components/browsing_data/core:clear_browsing_data_tab_java",
|
||||||
"//components/infobars/core:infobar_enums_java",
|
"//components/infobars/core:infobar_enums_java",
|
||||||
|
54
chrome/android/java/res/layout/website_settings.xml → chrome/android/java/res/layout/page_info.xml
54
chrome/android/java/res/layout/website_settings.xml → chrome/android/java/res/layout/page_info.xml
@@ -19,11 +19,11 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingBottom="12dp"
|
android:paddingBottom="12dp"
|
||||||
android:paddingEnd="@dimen/website_settings_popup_padding_sides"
|
android:paddingEnd="@dimen/page_info_popup_padding_sides"
|
||||||
android:paddingStart="@dimen/website_settings_popup_padding_sides" >
|
android:paddingStart="@dimen/page_info_popup_padding_sides" >
|
||||||
|
|
||||||
<view class="org.chromium.chrome.browser.page_info.WebsiteSettingsPopup$ElidedUrlTextView"
|
<view class="org.chromium.chrome.browser.page_info.WebsiteSettingsPopup$ElidedUrlTextView"
|
||||||
android:id="@+id/website_settings_url"
|
android:id="@+id/page_info_url"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:ellipsize="end"
|
android:ellipsize="end"
|
||||||
@@ -34,36 +34,36 @@
|
|||||||
android:textSize="16sp"/>
|
android:textSize="16sp"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/website_settings_connection_summary"
|
android:id="@+id/page_info_connection_summary"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:lineSpacingExtra="3dp"
|
android:lineSpacingExtra="3dp"
|
||||||
android:paddingTop="16dp"
|
android:paddingTop="16dp"
|
||||||
android:textColor="@color/website_settings_popup_text"
|
android:textColor="@color/page_info_popup_text"
|
||||||
android:textSize="16sp"
|
android:textSize="16sp"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/website_settings_connection_message"
|
android:id="@+id/page_info_connection_message"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:lineSpacingExtra="3dp"
|
android:lineSpacingExtra="3dp"
|
||||||
android:paddingTop="8dp"
|
android:paddingTop="8dp"
|
||||||
android:textColor="@color/website_settings_popup_text"
|
android:textColor="@color/page_info_popup_text"
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<org.chromium.ui.widget.ButtonCompat
|
<org.chromium.ui.widget.ButtonCompat
|
||||||
android:id="@+id/website_settings_instant_app_button"
|
android:id="@+id/page_info_instant_app_button"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="start"
|
android:layout_gravity="start"
|
||||||
android:layout_marginEnd="@dimen/website_settings_popup_padding_sides"
|
android:layout_marginEnd="@dimen/page_info_popup_padding_sides"
|
||||||
android:layout_marginStart="@dimen/website_settings_popup_padding_sides"
|
android:layout_marginStart="@dimen/page_info_popup_padding_sides"
|
||||||
android:layout_marginTop="12dp"
|
android:layout_marginTop="12dp"
|
||||||
android:layout_marginBottom="4dp"
|
android:layout_marginBottom="4dp"
|
||||||
android:paddingEnd="@dimen/website_settings_popup_button_padding_sides"
|
android:paddingEnd="@dimen/page_info_popup_button_padding_sides"
|
||||||
android:paddingStart="@dimen/website_settings_popup_button_padding_sides"
|
android:paddingStart="@dimen/page_info_popup_button_padding_sides"
|
||||||
android:text="@string/page_info_instant_app_button"
|
android:text="@string/page_info_instant_app_button"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:textColor="@android:color/white"
|
android:textColor="@android:color/white"
|
||||||
@@ -71,38 +71,38 @@
|
|||||||
chrome:buttonColor="@color/app_banner_install_button_bg" />
|
chrome:buttonColor="@color/app_banner_install_button_bg" />
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:id="@+id/website_settings_permissions_list"
|
android:id="@+id/page_info_permissions_list"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
android:paddingStart="@dimen/website_settings_popup_padding_sides"
|
android:paddingStart="@dimen/page_info_popup_padding_sides"
|
||||||
android:paddingEnd="@dimen/website_settings_popup_padding_sides" >
|
android:paddingEnd="@dimen/page_info_popup_padding_sides" >
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/website_settings_site_settings_button"
|
android:id="@+id/page_info_site_settings_button"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="@dimen/website_settings_popup_button_height"
|
android:layout_height="@dimen/page_info_popup_button_height"
|
||||||
android:layout_gravity="end"
|
android:layout_gravity="end"
|
||||||
android:layout_marginEnd="@dimen/website_settings_popup_padding_sides"
|
android:layout_marginEnd="@dimen/page_info_popup_padding_sides"
|
||||||
android:layout_marginStart="@dimen/website_settings_popup_padding_sides"
|
android:layout_marginStart="@dimen/page_info_popup_padding_sides"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:paddingEnd="@dimen/website_settings_popup_button_padding_sides"
|
android:paddingEnd="@dimen/page_info_popup_button_padding_sides"
|
||||||
android:paddingStart="@dimen/website_settings_popup_button_padding_sides"
|
android:paddingStart="@dimen/page_info_popup_button_padding_sides"
|
||||||
android:text="@string/page_info_site_settings_button"
|
android:text="@string/page_info_site_settings_button"
|
||||||
android:textColor="@color/light_active_color"
|
android:textColor="@color/light_active_color"
|
||||||
style="@style/ButtonCompatBorderless" />
|
style="@style/ButtonCompatBorderless" />
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
android:id="@+id/website_settings_open_online_button"
|
android:id="@+id/page_info_open_online_button"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="@dimen/website_settings_popup_button_height"
|
android:layout_height="@dimen/page_info_popup_button_height"
|
||||||
android:layout_gravity="end"
|
android:layout_gravity="end"
|
||||||
android:layout_marginEnd="@dimen/website_settings_popup_padding_sides"
|
android:layout_marginEnd="@dimen/page_info_popup_padding_sides"
|
||||||
android:layout_marginStart="@dimen/website_settings_popup_padding_sides"
|
android:layout_marginStart="@dimen/page_info_popup_padding_sides"
|
||||||
android:layout_marginTop="8dp"
|
android:layout_marginTop="8dp"
|
||||||
android:paddingEnd="@dimen/website_settings_popup_button_padding_sides"
|
android:paddingEnd="@dimen/page_info_popup_button_padding_sides"
|
||||||
android:paddingStart="@dimen/website_settings_popup_button_padding_sides"
|
android:paddingStart="@dimen/page_info_popup_button_padding_sides"
|
||||||
android:text="@string/page_info_open_online_button"
|
android:text="@string/page_info_open_online_button"
|
||||||
android:textColor="@color/light_active_color"
|
android:textColor="@color/light_active_color"
|
||||||
style="@style/ButtonCompatBorderless" />
|
style="@style/ButtonCompatBorderless" />
|
@@ -4,34 +4,34 @@
|
|||||||
found in the LICENSE file. -->
|
found in the LICENSE file. -->
|
||||||
|
|
||||||
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:id="@+id/website_settings_permission_row"
|
android:id="@+id/page_info_permission_row"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:paddingTop="12dp" >
|
android:paddingTop="12dp" >
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/website_settings_permission_icon"
|
android:id="@+id/page_info_permission_icon"
|
||||||
android:layout_width="@dimen/website_settings_popup_permission_icon_size"
|
android:layout_width="@dimen/page_info_popup_permission_icon_size"
|
||||||
android:layout_height="@dimen/website_settings_popup_permission_icon_size"
|
android:layout_height="@dimen/page_info_popup_permission_icon_size"
|
||||||
android:layout_marginEnd="16dp"
|
android:layout_marginEnd="16dp"
|
||||||
android:contentDescription="@null" />
|
android:contentDescription="@null" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/website_settings_permission_status"
|
android:id="@+id/page_info_permission_status"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_toEndOf="@id/website_settings_permission_icon"
|
android:layout_toEndOf="@id/page_info_permission_icon"
|
||||||
android:textColor="@color/website_settings_popup_text"
|
android:textColor="@color/page_info_popup_text"
|
||||||
android:textSize="14sp" />
|
android:textSize="14sp" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/website_settings_permission_unavailable_message"
|
android:id="@+id/page_info_permission_unavailable_message"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_below="@id/website_settings_permission_status"
|
android:layout_below="@id/page_info_permission_status"
|
||||||
android:layout_toEndOf="@id/website_settings_permission_icon"
|
android:layout_toEndOf="@id/page_info_permission_icon"
|
||||||
android:lineSpacingExtra="6dp"
|
android:lineSpacingExtra="6dp"
|
||||||
android:textColor="@color/website_settings_popup_text_link"
|
android:textColor="@color/page_info_popup_text_link"
|
||||||
android:textSize="14sp"
|
android:textSize="14sp"
|
||||||
android:visibility="gone" />
|
android:visibility="gone" />
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
@@ -53,9 +53,9 @@
|
|||||||
<color name="connection_info_popup_reset_cert_decisions_button">#000000</color>
|
<color name="connection_info_popup_reset_cert_decisions_button">#000000</color>
|
||||||
<color name="connection_info_popup_text">#444444</color>
|
<color name="connection_info_popup_text">#444444</color>
|
||||||
|
|
||||||
<!-- Website Settings Popup colors -->
|
<!-- Page Info Popup colors -->
|
||||||
<color name="website_settings_popup_text">#444444</color>
|
<color name="page_info_popup_text">#444444</color>
|
||||||
<color name="website_settings_popup_text_link">#4285f4</color>
|
<color name="page_info_popup_text_link">#4285f4</color>
|
||||||
|
|
||||||
<!-- URL Emphasizer colors -->
|
<!-- URL Emphasizer colors -->
|
||||||
<color name="url_emphasis_non_emphasized_text">#80333333</color>
|
<color name="url_emphasis_non_emphasized_text">#80333333</color>
|
||||||
|
@@ -8,11 +8,11 @@
|
|||||||
<dimen name="connection_info_padding_wide">24dp</dimen>
|
<dimen name="connection_info_padding_wide">24dp</dimen>
|
||||||
<dimen name="connection_info_padding_thin">16dp</dimen>
|
<dimen name="connection_info_padding_thin">16dp</dimen>
|
||||||
|
|
||||||
<!-- Website Settings Popup Dimensions -->
|
<!-- Page Info Popup Dimensions -->
|
||||||
<dimen name="website_settings_popup_padding_sides">16dp</dimen>
|
<dimen name="page_info_popup_padding_sides">16dp</dimen>
|
||||||
<dimen name="website_settings_popup_button_height">36dp</dimen>
|
<dimen name="page_info_popup_button_height">36dp</dimen>
|
||||||
<dimen name="website_settings_popup_button_padding_sides">8dp</dimen>
|
<dimen name="page_info_popup_button_padding_sides">8dp</dimen>
|
||||||
<dimen name="website_settings_popup_permission_icon_size">24dp</dimen>
|
<dimen name="page_info_popup_permission_icon_size">24dp</dimen>
|
||||||
|
|
||||||
<!-- Accessibility tab switcher -->
|
<!-- Accessibility tab switcher -->
|
||||||
<dimen name="accessibility_tab_height">65dp</dimen>
|
<dimen name="accessibility_tab_height">65dp</dimen>
|
||||||
|
@@ -100,7 +100,7 @@ import org.chromium.chrome.browser.ntp.NewTabPageUma;
|
|||||||
import org.chromium.chrome.browser.offlinepages.OfflinePageBridge;
|
import org.chromium.chrome.browser.offlinepages.OfflinePageBridge;
|
||||||
import org.chromium.chrome.browser.offlinepages.OfflinePageUtils;
|
import org.chromium.chrome.browser.offlinepages.OfflinePageUtils;
|
||||||
import org.chromium.chrome.browser.omaha.UpdateMenuItemHelper;
|
import org.chromium.chrome.browser.omaha.UpdateMenuItemHelper;
|
||||||
import org.chromium.chrome.browser.page_info.WebsiteSettingsPopup;
|
import org.chromium.chrome.browser.page_info.PageInfoPopup;
|
||||||
import org.chromium.chrome.browser.partnercustomizations.PartnerBrowserCustomizations;
|
import org.chromium.chrome.browser.partnercustomizations.PartnerBrowserCustomizations;
|
||||||
import org.chromium.chrome.browser.physicalweb.PhysicalWebShareActivity;
|
import org.chromium.chrome.browser.physicalweb.PhysicalWebShareActivity;
|
||||||
import org.chromium.chrome.browser.preferences.ChromePreferenceManager;
|
import org.chromium.chrome.browser.preferences.ChromePreferenceManager;
|
||||||
@@ -1837,8 +1837,7 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
|
|||||||
RecordUserAction.record("MobileMenuReload");
|
RecordUserAction.record("MobileMenuReload");
|
||||||
}
|
}
|
||||||
} else if (id == R.id.info_menu_id) {
|
} else if (id == R.id.info_menu_id) {
|
||||||
WebsiteSettingsPopup.show(
|
PageInfoPopup.show(this, currentTab, null, PageInfoPopup.OPENED_FROM_MENU);
|
||||||
this, currentTab, null, WebsiteSettingsPopup.OPENED_FROM_MENU);
|
|
||||||
} else if (id == R.id.open_history_menu_id) {
|
} else if (id == R.id.open_history_menu_id) {
|
||||||
if (NewTabPage.isNTPUrl(currentTab.getUrl())) {
|
if (NewTabPage.isNTPUrl(currentTab.getUrl())) {
|
||||||
NewTabPageUma.recordAction(NewTabPageUma.ACTION_OPENED_HISTORY_MANAGER);
|
NewTabPageUma.recordAction(NewTabPageUma.ACTION_OPENED_HISTORY_MANAGER);
|
||||||
|
@@ -58,7 +58,7 @@ import org.chromium.chrome.browser.fullscreen.BrowserStateBrowserControlsVisibil
|
|||||||
import org.chromium.chrome.browser.gsa.GSAState;
|
import org.chromium.chrome.browser.gsa.GSAState;
|
||||||
import org.chromium.chrome.browser.metrics.PageLoadMetrics;
|
import org.chromium.chrome.browser.metrics.PageLoadMetrics;
|
||||||
import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings;
|
import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings;
|
||||||
import org.chromium.chrome.browser.page_info.WebsiteSettingsPopup;
|
import org.chromium.chrome.browser.page_info.PageInfoPopup;
|
||||||
import org.chromium.chrome.browser.rappor.RapporServiceBridge;
|
import org.chromium.chrome.browser.rappor.RapporServiceBridge;
|
||||||
import org.chromium.chrome.browser.tab.EmptyTabObserver;
|
import org.chromium.chrome.browser.tab.EmptyTabObserver;
|
||||||
import org.chromium.chrome.browser.tab.Tab;
|
import org.chromium.chrome.browser.tab.Tab;
|
||||||
@@ -902,10 +902,8 @@ public class CustomTabActivity extends ChromeActivity {
|
|||||||
return true;
|
return true;
|
||||||
} else if (id == R.id.info_menu_id) {
|
} else if (id == R.id.info_menu_id) {
|
||||||
if (getTabModelSelector().getCurrentTab() == null) return false;
|
if (getTabModelSelector().getCurrentTab() == null) return false;
|
||||||
WebsiteSettingsPopup.show(
|
PageInfoPopup.show(this, getTabModelSelector().getCurrentTab(),
|
||||||
this, getTabModelSelector().getCurrentTab(),
|
getToolbarManager().getContentPublisher(), PageInfoPopup.OPENED_FROM_MENU);
|
||||||
getToolbarManager().getContentPublisher(),
|
|
||||||
WebsiteSettingsPopup.OPENED_FROM_MENU);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return super.onMenuOrKeyboardAction(id, fromMenu);
|
return super.onMenuOrKeyboardAction(id, fromMenu);
|
||||||
|
@@ -66,7 +66,7 @@ import org.chromium.chrome.browser.omnibox.OmniboxResultsAdapter.OmniboxSuggesti
|
|||||||
import org.chromium.chrome.browser.omnibox.VoiceSuggestionProvider.VoiceResult;
|
import org.chromium.chrome.browser.omnibox.VoiceSuggestionProvider.VoiceResult;
|
||||||
import org.chromium.chrome.browser.omnibox.geo.GeolocationHeader;
|
import org.chromium.chrome.browser.omnibox.geo.GeolocationHeader;
|
||||||
import org.chromium.chrome.browser.omnibox.geo.GeolocationSnackbarController;
|
import org.chromium.chrome.browser.omnibox.geo.GeolocationSnackbarController;
|
||||||
import org.chromium.chrome.browser.page_info.WebsiteSettingsPopup;
|
import org.chromium.chrome.browser.page_info.PageInfoPopup;
|
||||||
import org.chromium.chrome.browser.preferences.privacy.PrivacyPreferencesManager;
|
import org.chromium.chrome.browser.preferences.privacy.PrivacyPreferencesManager;
|
||||||
import org.chromium.chrome.browser.profiles.Profile;
|
import org.chromium.chrome.browser.profiles.Profile;
|
||||||
import org.chromium.chrome.browser.search_engines.TemplateUrlService;
|
import org.chromium.chrome.browser.search_engines.TemplateUrlService;
|
||||||
@@ -1895,8 +1895,8 @@ public class LocationBarLayout extends FrameLayout
|
|||||||
if (currentTab != null && currentTab.getWebContents() != null) {
|
if (currentTab != null && currentTab.getWebContents() != null) {
|
||||||
Activity activity = currentTab.getWindowAndroid().getActivity().get();
|
Activity activity = currentTab.getWindowAndroid().getActivity().get();
|
||||||
if (activity != null) {
|
if (activity != null) {
|
||||||
WebsiteSettingsPopup.show(
|
PageInfoPopup.show(
|
||||||
activity, currentTab, null, WebsiteSettingsPopup.OPENED_FROM_TOOLBAR);
|
activity, currentTab, null, PageInfoPopup.OPENED_FROM_TOOLBAR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (v == mMicButton) {
|
} else if (v == mMicButton) {
|
||||||
|
@@ -31,7 +31,7 @@ import org.chromium.content_public.browser.WebContents;
|
|||||||
import org.chromium.content_public.browser.WebContentsObserver;
|
import org.chromium.content_public.browser.WebContentsObserver;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Java side of Android implementation of the website settings UI.
|
* Java side of Android implementation of the page info UI.
|
||||||
*/
|
*/
|
||||||
public class ConnectionInfoPopup implements OnClickListener {
|
public class ConnectionInfoPopup implements OnClickListener {
|
||||||
private static final String TAG = "ConnectionInfoPopup";
|
private static final String TAG = "ConnectionInfoPopup";
|
||||||
@@ -145,7 +145,7 @@ public class ConnectionInfoPopup implements OnClickListener {
|
|||||||
mCertificateViewer = new TextView(mContext);
|
mCertificateViewer = new TextView(mContext);
|
||||||
mCertificateViewer.setText(label);
|
mCertificateViewer.setText(label);
|
||||||
mCertificateViewer.setTextColor(ApiCompatibilityUtils.getColor(
|
mCertificateViewer.setTextColor(ApiCompatibilityUtils.getColor(
|
||||||
mContext.getResources(), R.color.website_settings_popup_text_link));
|
mContext.getResources(), R.color.page_info_popup_text_link));
|
||||||
mCertificateViewer.setTextSize(DESCRIPTION_TEXT_SIZE_SP);
|
mCertificateViewer.setTextSize(DESCRIPTION_TEXT_SIZE_SP);
|
||||||
mCertificateViewer.setOnClickListener(this);
|
mCertificateViewer.setOnClickListener(this);
|
||||||
mCertificateViewer.setPadding(0, mPaddingThin, 0, 0);
|
mCertificateViewer.setPadding(0, mPaddingThin, 0, 0);
|
||||||
@@ -180,7 +180,7 @@ public class ConnectionInfoPopup implements OnClickListener {
|
|||||||
mLinkUrl = HELP_URL;
|
mLinkUrl = HELP_URL;
|
||||||
mMoreInfoLink.setText(linkText);
|
mMoreInfoLink.setText(linkText);
|
||||||
mMoreInfoLink.setTextColor(ApiCompatibilityUtils.getColor(
|
mMoreInfoLink.setTextColor(ApiCompatibilityUtils.getColor(
|
||||||
mContext.getResources(), R.color.website_settings_popup_text_link));
|
mContext.getResources(), R.color.page_info_popup_text_link));
|
||||||
mMoreInfoLink.setTextSize(DESCRIPTION_TEXT_SIZE_SP);
|
mMoreInfoLink.setTextSize(DESCRIPTION_TEXT_SIZE_SP);
|
||||||
mMoreInfoLink.setPadding(0, mPaddingThin, 0, 0);
|
mMoreInfoLink.setPadding(0, mPaddingThin, 0, 0);
|
||||||
mMoreInfoLink.setOnClickListener(this);
|
mMoreInfoLink.setOnClickListener(this);
|
||||||
|
@@ -86,11 +86,9 @@ import java.util.Date;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Java side of Android implementation of the website settings UI.
|
* Java side of Android implementation of the page info UI.
|
||||||
* TODO(sashab): Rename this, and all its resources, to PageInfo* and page_info_* instead of
|
|
||||||
* WebsiteSettings* and website_settings_*. Do this on the C++ side as well.
|
|
||||||
*/
|
*/
|
||||||
public class WebsiteSettingsPopup implements OnClickListener {
|
public class PageInfoPopup implements OnClickListener {
|
||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
@IntDef({OPENED_FROM_MENU, OPENED_FROM_TOOLBAR})
|
@IntDef({OPENED_FROM_MENU, OPENED_FROM_TOOLBAR})
|
||||||
private @interface OpenedFromSource {}
|
private @interface OpenedFromSource {}
|
||||||
@@ -247,9 +245,9 @@ public class WebsiteSettingsPopup implements OnClickListener {
|
|||||||
private final Tab mTab;
|
private final Tab mTab;
|
||||||
|
|
||||||
// A pointer to the C++ object for this UI.
|
// A pointer to the C++ object for this UI.
|
||||||
private long mNativeWebsiteSettingsPopup;
|
private long mNativePageInfoPopup;
|
||||||
|
|
||||||
// The outer container, filled with the layout from website_settings.xml.
|
// The outer container, filled with the layout from page_info.xml.
|
||||||
private final LinearLayout mContainer;
|
private final LinearLayout mContainer;
|
||||||
|
|
||||||
// UI elements in the dialog.
|
// UI elements in the dialog.
|
||||||
@@ -297,14 +295,14 @@ public class WebsiteSettingsPopup implements OnClickListener {
|
|||||||
private Intent mInstantAppIntent;
|
private Intent mInstantAppIntent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates the WebsiteSettingsPopup, but does not display it. Also initializes the corresponding
|
* Creates the PageInfoPopup, but does not display it. Also initializes the corresponding
|
||||||
* C++ object and saves a pointer to it.
|
* C++ object and saves a pointer to it.
|
||||||
* @param activity Activity which is used for showing a popup.
|
* @param activity Activity which is used for showing a popup.
|
||||||
* @param tab Tab for which the pop up is shown.
|
* @param tab Tab for which the pop up is shown.
|
||||||
* @param offlinePageCreationDate Date when the offline page was created.
|
* @param offlinePageCreationDate Date when the offline page was created.
|
||||||
* @param publisher The name of the content publisher, if any.
|
* @param publisher The name of the content publisher, if any.
|
||||||
*/
|
*/
|
||||||
private WebsiteSettingsPopup(Activity activity, Tab tab, String offlinePageCreationDate,
|
private PageInfoPopup(Activity activity, Tab tab, String offlinePageCreationDate,
|
||||||
String publisher) {
|
String publisher) {
|
||||||
mContext = activity;
|
mContext = activity;
|
||||||
mTab = tab;
|
mTab = tab;
|
||||||
@@ -316,7 +314,7 @@ public class WebsiteSettingsPopup implements OnClickListener {
|
|||||||
|
|
||||||
// Find the container and all it's important subviews.
|
// Find the container and all it's important subviews.
|
||||||
mContainer = (LinearLayout) LayoutInflater.from(mContext).inflate(
|
mContainer = (LinearLayout) LayoutInflater.from(mContext).inflate(
|
||||||
R.layout.website_settings, null);
|
R.layout.page_info, null);
|
||||||
mContainer.setVisibility(View.INVISIBLE);
|
mContainer.setVisibility(View.INVISIBLE);
|
||||||
mContainer.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
|
mContainer.addOnLayoutChangeListener(new View.OnLayoutChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
@@ -330,7 +328,7 @@ public class WebsiteSettingsPopup implements OnClickListener {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
mUrlTitle = (ElidedUrlTextView) mContainer.findViewById(R.id.website_settings_url);
|
mUrlTitle = (ElidedUrlTextView) mContainer.findViewById(R.id.page_info_url);
|
||||||
mUrlTitle.setProfile(mTab.getProfile());
|
mUrlTitle.setProfile(mTab.getProfile());
|
||||||
mUrlTitle.setOnClickListener(this);
|
mUrlTitle.setOnClickListener(this);
|
||||||
// Long press the url text to copy it to the clipboard.
|
// Long press the url text to copy it to the clipboard.
|
||||||
@@ -347,22 +345,22 @@ public class WebsiteSettingsPopup implements OnClickListener {
|
|||||||
});
|
});
|
||||||
|
|
||||||
mConnectionSummary = (TextView) mContainer
|
mConnectionSummary = (TextView) mContainer
|
||||||
.findViewById(R.id.website_settings_connection_summary);
|
.findViewById(R.id.page_info_connection_summary);
|
||||||
mConnectionMessage = (TextView) mContainer
|
mConnectionMessage = (TextView) mContainer
|
||||||
.findViewById(R.id.website_settings_connection_message);
|
.findViewById(R.id.page_info_connection_message);
|
||||||
mPermissionsList = (LinearLayout) mContainer
|
mPermissionsList = (LinearLayout) mContainer
|
||||||
.findViewById(R.id.website_settings_permissions_list);
|
.findViewById(R.id.page_info_permissions_list);
|
||||||
|
|
||||||
mInstantAppButton =
|
mInstantAppButton =
|
||||||
(Button) mContainer.findViewById(R.id.website_settings_instant_app_button);
|
(Button) mContainer.findViewById(R.id.page_info_instant_app_button);
|
||||||
mInstantAppButton.setOnClickListener(this);
|
mInstantAppButton.setOnClickListener(this);
|
||||||
|
|
||||||
mSiteSettingsButton =
|
mSiteSettingsButton =
|
||||||
(Button) mContainer.findViewById(R.id.website_settings_site_settings_button);
|
(Button) mContainer.findViewById(R.id.page_info_site_settings_button);
|
||||||
mSiteSettingsButton.setOnClickListener(this);
|
mSiteSettingsButton.setOnClickListener(this);
|
||||||
|
|
||||||
mOpenOnlineButton =
|
mOpenOnlineButton =
|
||||||
(Button) mContainer.findViewById(R.id.website_settings_open_online_button);
|
(Button) mContainer.findViewById(R.id.page_info_open_online_button);
|
||||||
mOpenOnlineButton.setOnClickListener(this);
|
mOpenOnlineButton.setOnClickListener(this);
|
||||||
|
|
||||||
mDisplayedPermissions = new ArrayList<PageInfoPermissionEntry>();
|
mDisplayedPermissions = new ArrayList<PageInfoPermissionEntry>();
|
||||||
@@ -451,7 +449,7 @@ public class WebsiteSettingsPopup implements OnClickListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// This needs to come after other member initialization.
|
// This needs to come after other member initialization.
|
||||||
mNativeWebsiteSettingsPopup = nativeInit(this, mTab.getWebContents());
|
mNativePageInfoPopup = nativeInit(this, mTab.getWebContents());
|
||||||
final WebContentsObserver webContentsObserver =
|
final WebContentsObserver webContentsObserver =
|
||||||
new WebContentsObserver(mTab.getWebContents()) {
|
new WebContentsObserver(mTab.getWebContents()) {
|
||||||
@Override
|
@Override
|
||||||
@@ -480,10 +478,10 @@ public class WebsiteSettingsPopup implements OnClickListener {
|
|||||||
mDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
mDialog.setOnDismissListener(new DialogInterface.OnDismissListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onDismiss(DialogInterface dialog) {
|
public void onDismiss(DialogInterface dialog) {
|
||||||
assert mNativeWebsiteSettingsPopup != 0;
|
assert mNativePageInfoPopup != 0;
|
||||||
webContentsObserver.destroy();
|
webContentsObserver.destroy();
|
||||||
nativeDestroy(mNativeWebsiteSettingsPopup);
|
nativeDestroy(mNativePageInfoPopup);
|
||||||
mNativeWebsiteSettingsPopup = 0;
|
mNativePageInfoPopup = 0;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -564,10 +562,10 @@ public class WebsiteSettingsPopup implements OnClickListener {
|
|||||||
|
|
||||||
private void addReadOnlyPermissionSection(PageInfoPermissionEntry permission) {
|
private void addReadOnlyPermissionSection(PageInfoPermissionEntry permission) {
|
||||||
View permissionRow = LayoutInflater.from(mContext).inflate(
|
View permissionRow = LayoutInflater.from(mContext).inflate(
|
||||||
R.layout.website_settings_permission_row, null);
|
R.layout.page_info_permission_row, null);
|
||||||
|
|
||||||
ImageView permissionIcon = (ImageView) permissionRow.findViewById(
|
ImageView permissionIcon = (ImageView) permissionRow.findViewById(
|
||||||
R.id.website_settings_permission_icon);
|
R.id.page_info_permission_icon);
|
||||||
permissionIcon.setImageResource(getImageResourceForPermission(permission.type));
|
permissionIcon.setImageResource(getImageResourceForPermission(permission.type));
|
||||||
|
|
||||||
if (permission.setting == ContentSetting.ALLOW) {
|
if (permission.setting == ContentSetting.ALLOW) {
|
||||||
@@ -589,20 +587,20 @@ public class WebsiteSettingsPopup implements OnClickListener {
|
|||||||
|
|
||||||
if (warningTextResource != 0) {
|
if (warningTextResource != 0) {
|
||||||
TextView permissionUnavailable = (TextView) permissionRow.findViewById(
|
TextView permissionUnavailable = (TextView) permissionRow.findViewById(
|
||||||
R.id.website_settings_permission_unavailable_message);
|
R.id.page_info_permission_unavailable_message);
|
||||||
permissionUnavailable.setVisibility(View.VISIBLE);
|
permissionUnavailable.setVisibility(View.VISIBLE);
|
||||||
permissionUnavailable.setText(warningTextResource);
|
permissionUnavailable.setText(warningTextResource);
|
||||||
|
|
||||||
permissionIcon.setImageResource(R.drawable.exclamation_triangle);
|
permissionIcon.setImageResource(R.drawable.exclamation_triangle);
|
||||||
permissionIcon.setColorFilter(ApiCompatibilityUtils.getColor(
|
permissionIcon.setColorFilter(ApiCompatibilityUtils.getColor(
|
||||||
mContext.getResources(), R.color.website_settings_popup_text_link));
|
mContext.getResources(), R.color.page_info_popup_text_link));
|
||||||
|
|
||||||
permissionRow.setOnClickListener(this);
|
permissionRow.setOnClickListener(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TextView permissionStatus = (TextView) permissionRow.findViewById(
|
TextView permissionStatus = (TextView) permissionRow.findViewById(
|
||||||
R.id.website_settings_permission_status);
|
R.id.page_info_permission_status);
|
||||||
SpannableStringBuilder builder = new SpannableStringBuilder();
|
SpannableStringBuilder builder = new SpannableStringBuilder();
|
||||||
SpannableString nameString = new SpannableString(permission.name);
|
SpannableString nameString = new SpannableString(permission.name);
|
||||||
final StyleSpan boldSpan = new StyleSpan(android.graphics.Typeface.BOLD);
|
final StyleSpan boldSpan = new StyleSpan(android.graphics.Typeface.BOLD);
|
||||||
@@ -671,7 +669,7 @@ public class WebsiteSettingsPopup implements OnClickListener {
|
|||||||
mContext.getString(R.string.page_info_details_link));
|
mContext.getString(R.string.page_info_details_link));
|
||||||
final ForegroundColorSpan blueSpan = new ForegroundColorSpan(
|
final ForegroundColorSpan blueSpan = new ForegroundColorSpan(
|
||||||
ApiCompatibilityUtils.getColor(mContext.getResources(),
|
ApiCompatibilityUtils.getColor(mContext.getResources(),
|
||||||
R.color.website_settings_popup_text_link));
|
R.color.page_info_popup_text_link));
|
||||||
detailsText.setSpan(
|
detailsText.setSpan(
|
||||||
blueSpan, 0, detailsText.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
|
blueSpan, 0, detailsText.length(), Spannable.SPAN_INCLUSIVE_EXCLUSIVE);
|
||||||
messageBuilder.append(detailsText);
|
messageBuilder.append(detailsText);
|
||||||
@@ -681,7 +679,7 @@ public class WebsiteSettingsPopup implements OnClickListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Displays the WebsiteSettingsPopup.
|
* Displays the PageInfoPopup.
|
||||||
*/
|
*/
|
||||||
private void showDialog() {
|
private void showDialog() {
|
||||||
if (!DeviceFormFactor.isTablet(mContext)) {
|
if (!DeviceFormFactor.isTablet(mContext)) {
|
||||||
@@ -735,11 +733,11 @@ public class WebsiteSettingsPopup implements OnClickListener {
|
|||||||
@Override
|
@Override
|
||||||
public void onClick(View view) {
|
public void onClick(View view) {
|
||||||
if (view == mSiteSettingsButton) {
|
if (view == mSiteSettingsButton) {
|
||||||
// Delay while the WebsiteSettingsPopup closes.
|
// Delay while the PageInfoPopup closes.
|
||||||
runAfterDismiss(new Runnable() {
|
runAfterDismiss(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
recordAction(WebsiteSettingsAction.WEBSITE_SETTINGS_SITE_SETTINGS_OPENED);
|
recordAction(PageInfoAction.PAGE_INFO_SITE_SETTINGS_OPENED);
|
||||||
Bundle fragmentArguments =
|
Bundle fragmentArguments =
|
||||||
SingleWebsitePreferences.createFragmentArgsForSite(mFullUrl);
|
SingleWebsitePreferences.createFragmentArgsForSite(mFullUrl);
|
||||||
fragmentArguments.putParcelable(SingleWebsitePreferences.EXTRA_WEB_CONTENTS,
|
fragmentArguments.putParcelable(SingleWebsitePreferences.EXTRA_WEB_CONTENTS,
|
||||||
@@ -767,12 +765,12 @@ public class WebsiteSettingsPopup implements OnClickListener {
|
|||||||
public void run() {
|
public void run() {
|
||||||
if (!mTab.getWebContents().isDestroyed()) {
|
if (!mTab.getWebContents().isDestroyed()) {
|
||||||
recordAction(
|
recordAction(
|
||||||
WebsiteSettingsAction.WEBSITE_SETTINGS_SECURITY_DETAILS_OPENED);
|
PageInfoAction.PAGE_INFO_SECURITY_DETAILS_OPENED);
|
||||||
ConnectionInfoPopup.show(mContext, mTab.getWebContents());
|
ConnectionInfoPopup.show(mContext, mTab.getWebContents());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else if (view.getId() == R.id.website_settings_permission_row) {
|
} else if (view.getId() == R.id.page_info_permission_row) {
|
||||||
final Object intentOverride = view.getTag(R.id.permission_intent_override);
|
final Object intentOverride = view.getTag(R.id.permission_intent_override);
|
||||||
|
|
||||||
if (intentOverride == null && mWindowAndroid != null) {
|
if (intentOverride == null && mWindowAndroid != null) {
|
||||||
@@ -926,8 +924,8 @@ public class WebsiteSettingsPopup implements OnClickListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void recordAction(int action) {
|
private void recordAction(int action) {
|
||||||
if (mNativeWebsiteSettingsPopup != 0) {
|
if (mNativePageInfoPopup != 0) {
|
||||||
nativeRecordWebsiteSettingsAction(mNativeWebsiteSettingsPopup, action);
|
nativeRecordPageInfoAction(mNativePageInfoPopup, action);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -939,7 +937,7 @@ public class WebsiteSettingsPopup implements OnClickListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shows a WebsiteSettings dialog for the provided Tab. The popup adds itself to the view
|
* Shows a PageInfo dialog for the provided Tab. The popup adds itself to the view
|
||||||
* hierarchy which owns the reference while it's visible.
|
* hierarchy which owns the reference while it's visible.
|
||||||
*
|
*
|
||||||
* @param activity Activity which is used for launching a dialog.
|
* @param activity Activity which is used for launching a dialog.
|
||||||
@@ -968,13 +966,13 @@ public class WebsiteSettingsPopup implements OnClickListener {
|
|||||||
offlinePageCreationDate = df.format(creationDate);
|
offlinePageCreationDate = df.format(creationDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
new WebsiteSettingsPopup(activity, tab, offlinePageCreationDate, contentPublisher);
|
new PageInfoPopup(activity, tab, offlinePageCreationDate, contentPublisher);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static native long nativeInit(WebsiteSettingsPopup popup, WebContents webContents);
|
private static native long nativeInit(PageInfoPopup popup, WebContents webContents);
|
||||||
|
|
||||||
private native void nativeDestroy(long nativeWebsiteSettingsPopupAndroid);
|
private native void nativeDestroy(long nativePageInfoPopupAndroid);
|
||||||
|
|
||||||
private native void nativeRecordWebsiteSettingsAction(
|
private native void nativeRecordPageInfoAction(
|
||||||
long nativeWebsiteSettingsPopupAndroid, int action);
|
long nativePageInfoPopupAndroid, int action);
|
||||||
}
|
}
|
@@ -46,7 +46,7 @@ import org.chromium.chrome.browser.omnibox.LocationBar;
|
|||||||
import org.chromium.chrome.browser.omnibox.LocationBarLayout;
|
import org.chromium.chrome.browser.omnibox.LocationBarLayout;
|
||||||
import org.chromium.chrome.browser.omnibox.UrlBar;
|
import org.chromium.chrome.browser.omnibox.UrlBar;
|
||||||
import org.chromium.chrome.browser.omnibox.UrlFocusChangeListener;
|
import org.chromium.chrome.browser.omnibox.UrlFocusChangeListener;
|
||||||
import org.chromium.chrome.browser.page_info.WebsiteSettingsPopup;
|
import org.chromium.chrome.browser.page_info.PageInfoPopup;
|
||||||
import org.chromium.chrome.browser.profiles.Profile;
|
import org.chromium.chrome.browser.profiles.Profile;
|
||||||
import org.chromium.chrome.browser.tab.Tab;
|
import org.chromium.chrome.browser.tab.Tab;
|
||||||
import org.chromium.chrome.browser.util.ColorUtils;
|
import org.chromium.chrome.browser.util.ColorUtils;
|
||||||
@@ -183,8 +183,8 @@ public class CustomTabToolbar extends ToolbarLayout implements LocationBar,
|
|||||||
if (activity == null) return;
|
if (activity == null) return;
|
||||||
String publisherName = mState == STATE_TITLE_ONLY
|
String publisherName = mState == STATE_TITLE_ONLY
|
||||||
? parsePublisherNameFromUrl(currentTab.getUrl()) : null;
|
? parsePublisherNameFromUrl(currentTab.getUrl()) : null;
|
||||||
WebsiteSettingsPopup.show(activity, currentTab, publisherName,
|
PageInfoPopup.show(
|
||||||
WebsiteSettingsPopup.OPENED_FROM_TOOLBAR);
|
activity, currentTab, publisherName, PageInfoPopup.OPENED_FROM_TOOLBAR);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -1623,7 +1623,7 @@ To obtain new licenses, connect to the internet and play your downloaded content
|
|||||||
Still adding previous site
|
Still adding previous site
|
||||||
</message>
|
</message>
|
||||||
|
|
||||||
<!-- WebsiteSettingsPopup (PageInfo dialog) -->
|
<!-- PageInfoPopup (PageInfo dialog) -->
|
||||||
<message name="IDS_PAGE_INFO_SITE_SETTINGS_BUTTON" desc="Text in the button that opens a website's Site Settings from the Page Info dialog.">
|
<message name="IDS_PAGE_INFO_SITE_SETTINGS_BUTTON" desc="Text in the button that opens a website's Site Settings from the Page Info dialog.">
|
||||||
Site Settings
|
Site Settings
|
||||||
</message>
|
</message>
|
||||||
|
@@ -696,7 +696,7 @@ chrome_java_sources = [
|
|||||||
"java/src/org/chromium/chrome/browser/page_info/CertificateChainHelper.java",
|
"java/src/org/chromium/chrome/browser/page_info/CertificateChainHelper.java",
|
||||||
"java/src/org/chromium/chrome/browser/page_info/CertificateViewer.java",
|
"java/src/org/chromium/chrome/browser/page_info/CertificateViewer.java",
|
||||||
"java/src/org/chromium/chrome/browser/page_info/ConnectionInfoPopup.java",
|
"java/src/org/chromium/chrome/browser/page_info/ConnectionInfoPopup.java",
|
||||||
"java/src/org/chromium/chrome/browser/page_info/WebsiteSettingsPopup.java",
|
"java/src/org/chromium/chrome/browser/page_info/PageInfoPopup.java",
|
||||||
"java/src/org/chromium/chrome/browser/partnerbookmarks/PartnerBookmarksProviderIterator.java",
|
"java/src/org/chromium/chrome/browser/partnerbookmarks/PartnerBookmarksProviderIterator.java",
|
||||||
"java/src/org/chromium/chrome/browser/partnerbookmarks/PartnerBookmarksReader.java",
|
"java/src/org/chromium/chrome/browser/partnerbookmarks/PartnerBookmarksReader.java",
|
||||||
"java/src/org/chromium/chrome/browser/partnerbookmarks/PartnerBookmarksShim.java",
|
"java/src/org/chromium/chrome/browser/partnerbookmarks/PartnerBookmarksShim.java",
|
||||||
|
@@ -223,137 +223,137 @@ are declared in build/common.gypi.
|
|||||||
</message>
|
</message>
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
<!-- Website Settings UI -->
|
<!-- Page Info UI -->
|
||||||
<message name="IDS_WEBSITE_SETTINGS_TITLE" desc="Title for Website Settings dialog.">
|
<message name="IDS_PAGE_INFO_TITLE" desc="Title for Page Info dialog.">
|
||||||
Manage sites
|
Manage sites
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_INFOBAR_TEXT" desc="The string shown in the infobar after the user has changed site permissions settings, reminding them to reload the page in order for the new settings to take effect.">
|
<message name="IDS_PAGE_INFO_INFOBAR_TEXT" desc="The string shown in the infobar after the user has changed site permissions settings, reminding them to reload the page in order for the new settings to take effect.">
|
||||||
New site permissions settings will take effect after reloading the page.
|
New site permissions settings will take effect after reloading the page.
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_INFOBAR_BUTTON" desc="The string used in the infobar button allowing the user to reload the page directly from the infobar.">
|
<message name="IDS_PAGE_INFO_INFOBAR_BUTTON" desc="The string used in the infobar button allowing the user to reload the page directly from the infobar.">
|
||||||
Reload
|
Reload
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_BUTTON_TEXT_ALLOWED_BY_POLICY" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button is set to allow and managed by policy.">
|
<message name="IDS_PAGE_INFO_BUTTON_TEXT_ALLOWED_BY_POLICY" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button is set to allow and managed by policy.">
|
||||||
Allow (by policy)
|
Allow (by policy)
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_BUTTON_TEXT_BLOCKED_BY_POLICY" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button is set to block and managed by policy.">
|
<message name="IDS_PAGE_INFO_BUTTON_TEXT_BLOCKED_BY_POLICY" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button is set to block and managed by policy.">
|
||||||
Block (by policy)
|
Block (by policy)
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_BUTTON_TEXT_ASK_BY_POLICY" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button is set to ask and managed by policy.">
|
<message name="IDS_PAGE_INFO_BUTTON_TEXT_ASK_BY_POLICY" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button is set to ask and managed by policy.">
|
||||||
Ask (by policy)
|
Ask (by policy)
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_BUTTON_TEXT_ALLOWED_BY_EXTENSION" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button is set to allow and managed by an extension.">
|
<message name="IDS_PAGE_INFO_BUTTON_TEXT_ALLOWED_BY_EXTENSION" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button is set to allow and managed by an extension.">
|
||||||
Allow (by extension)
|
Allow (by extension)
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_BUTTON_TEXT_BLOCKED_BY_EXTENSION" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button is set to block and managed by an extension.">
|
<message name="IDS_PAGE_INFO_BUTTON_TEXT_BLOCKED_BY_EXTENSION" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button is set to block and managed by an extension.">
|
||||||
Block (by extension)
|
Block (by extension)
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_BUTTON_TEXT_ALLOWED_BY_USER" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button was explicitly set to allow by the user.">
|
<message name="IDS_PAGE_INFO_BUTTON_TEXT_ALLOWED_BY_USER" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button was explicitly set to allow by the user.">
|
||||||
Allow
|
Allow
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_BUTTON_TEXT_BLOCKED_BY_USER" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button was explicitly set to block by the user.">
|
<message name="IDS_PAGE_INFO_BUTTON_TEXT_BLOCKED_BY_USER" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button was explicitly set to block by the user.">
|
||||||
Block
|
Block
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_BUTTON_TEXT_ASK_BY_USER" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button was explicitly set to ask by the user.">
|
<message name="IDS_PAGE_INFO_BUTTON_TEXT_ASK_BY_USER" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button was explicitly set to ask by the user.">
|
||||||
Ask
|
Ask
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_BUTTON_TEXT_DETECT_IMPORTANT_CONTENT_BY_USER" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button was explicitly set to detect important content by the user.">
|
<message name="IDS_PAGE_INFO_BUTTON_TEXT_DETECT_IMPORTANT_CONTENT_BY_USER" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button was explicitly set to detect important content by the user.">
|
||||||
Detect
|
Detect
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_BUTTON_TEXT_ALLOWED_BY_DEFAULT" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button is set to the default setting and the default settings is allow.">
|
<message name="IDS_PAGE_INFO_BUTTON_TEXT_ALLOWED_BY_DEFAULT" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button is set to the default setting and the default settings is allow.">
|
||||||
Allow (default)
|
Allow (default)
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_BUTTON_TEXT_BLOCKED_BY_DEFAULT" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button is set to the default setting and the default settings is block.">
|
<message name="IDS_PAGE_INFO_BUTTON_TEXT_BLOCKED_BY_DEFAULT" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button is set to the default setting and the default settings is block.">
|
||||||
Block (default)
|
Block (default)
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_BUTTON_TEXT_ASK_BY_DEFAULT" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button is set to the default setting and the default settings is ask.">
|
<message name="IDS_PAGE_INFO_BUTTON_TEXT_ASK_BY_DEFAULT" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button is set to the default setting and the default settings is ask.">
|
||||||
Ask (default)
|
Ask (default)
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_BUTTON_TEXT_DETECT_IMPORTANT_CONTENT_BY_DEFAULT" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button is set to the default setting and the default settings is detect important content.">
|
<message name="IDS_PAGE_INFO_BUTTON_TEXT_DETECT_IMPORTANT_CONTENT_BY_DEFAULT" desc="The Website Settings popup contains several buttons for opening dropdown menus and changing site permissions. This is the text of such a button if the permission controlled by the button is set to the default setting and the default settings is detect important content.">
|
||||||
Detect (default)
|
Detect (default)
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_USB_DEVICE_LABEL" desc="The label used to describe a USB device that the user has granted the site permission to access.">
|
<message name="IDS_PAGE_INFO_USB_DEVICE_LABEL" desc="The label used to describe a USB device that the user has granted the site permission to access.">
|
||||||
<ph name="DEVICE_NAME">$1<ex>Android Phone</ex></ph>
|
<ph name="DEVICE_NAME">$1<ex>Android Phone</ex></ph>
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_DELETE_USB_DEVICE" desc="The tooltip displayed when hovering over the button that will remove permission to access a USB device that the user previously granted to the site.">
|
<message name="IDS_PAGE_INFO_DELETE_USB_DEVICE" desc="The tooltip displayed when hovering over the button that will remove permission to access a USB device that the user previously granted to the site.">
|
||||||
Revoke access
|
Revoke access
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_TITLE_SITE_PERMISSIONS" desc="Title of the permissions section of the website settings popup.">
|
<message name="IDS_PAGE_INFO_TITLE_SITE_PERMISSIONS" desc="Title of the permissions section of the page info popup.">
|
||||||
Permissions
|
Permissions
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_TITLE_SITE_DATA" desc="Title of the site data section of the website settings popup.">
|
<message name="IDS_PAGE_INFO_TITLE_SITE_DATA" desc="Title of the site data section of the page info popup.">
|
||||||
Cookies
|
Cookies
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_PERMISSION_ALLOW" desc="The label used in the permissions dropdowns for the option that grants a permissions.">
|
<message name="IDS_PAGE_INFO_PERMISSION_ALLOW" desc="The label used in the permissions dropdowns for the option that grants a permissions.">
|
||||||
allow
|
allow
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_PERMISSION_BLOCK" desc="The label used in the permissions dropdowns for the option that denies a permissions. ">
|
<message name="IDS_PAGE_INFO_PERMISSION_BLOCK" desc="The label used in the permissions dropdowns for the option that denies a permissions. ">
|
||||||
block
|
block
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_PERMISSION_ASK" desc="The label used in the permissions dropdowns for the option that makes the browser asks for permission. ">
|
<message name="IDS_PAGE_INFO_PERMISSION_ASK" desc="The label used in the permissions dropdowns for the option that makes the browser asks for permission. ">
|
||||||
ask
|
ask
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_TYPE_AUTOPLAY" desc="The label used for the autoplay permission controls in the Website Settings popup.">
|
<message name="IDS_PAGE_INFO_TYPE_AUTOPLAY" desc="The label used for the autoplay permission controls in the Website Settings popup.">
|
||||||
Autoplay
|
Autoplay
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_TYPE_BACKGROUND_SYNC" desc="The label used for the background sync permission controls in the Website Settings popup.">
|
<message name="IDS_PAGE_INFO_TYPE_BACKGROUND_SYNC" desc="The label used for the background sync permission controls in the Website Settings popup.">
|
||||||
Background Sync
|
Background Sync
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_TYPE_IMAGES" desc="The label used for images permission controls in the Website Settings popup.">
|
<message name="IDS_PAGE_INFO_TYPE_IMAGES" desc="The label used for images permission controls in the Website Settings popup.">
|
||||||
Images
|
Images
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_TYPE_JAVASCRIPT" desc="The label used for JavaScript permission controls in the Website Settings popup.">
|
<message name="IDS_PAGE_INFO_TYPE_JAVASCRIPT" desc="The label used for JavaScript permission controls in the Website Settings popup.">
|
||||||
JavaScript
|
JavaScript
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_TYPE_POPUPS" desc="The label used for popups permission controls in the Website Settings popup.">
|
<message name="IDS_PAGE_INFO_TYPE_POPUPS" desc="The label used for popups permission controls in the Website Settings popup.">
|
||||||
Popups
|
Popups
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_TYPE_FLASH" desc="The label used for Flash permissions in the Website Settings popup.">
|
<message name="IDS_PAGE_INFO_TYPE_FLASH" desc="The label used for Flash permissions in the Website Settings popup.">
|
||||||
Flash
|
Flash
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_TYPE_LOCATION" desc="The label used for location permission controls in the Website Settings popup.">
|
<message name="IDS_PAGE_INFO_TYPE_LOCATION" desc="The label used for location permission controls in the Website Settings popup.">
|
||||||
Location
|
Location
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_TYPE_NOTIFICATIONS" desc="The label used for notifications permission controls in the Website Settings popup.">
|
<message name="IDS_PAGE_INFO_TYPE_NOTIFICATIONS" desc="The label used for notifications permission controls in the Website Settings popup.">
|
||||||
Notifications
|
Notifications
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_TYPE_MIC" desc="The label used for the microphone permission controls in the Website Settings popup.">
|
<message name="IDS_PAGE_INFO_TYPE_MIC" desc="The label used for the microphone permission controls in the Website Settings popup.">
|
||||||
Microphone
|
Microphone
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_TYPE_CAMERA" desc="The label used for the camera permission controls in the Website Settings popup.">
|
<message name="IDS_PAGE_INFO_TYPE_CAMERA" desc="The label used for the camera permission controls in the Website Settings popup.">
|
||||||
Camera
|
Camera
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_TYPE_MIDI_SYSEX" desc="The label used for MIDI system exclusive message permission controls in the Website Settings popup.">
|
<message name="IDS_PAGE_INFO_TYPE_MIDI_SYSEX" desc="The label used for MIDI system exclusive message permission controls in the Website Settings popup.">
|
||||||
MIDI devices full control
|
MIDI devices full control
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_INSECURE_WEBVR_CONTENT_TRANSIENT" desc="Text that is displayed temporarily as a large toast on first entering a WebVR page over non-secure transport.">
|
<message name="IDS_PAGE_INFO_INSECURE_WEBVR_CONTENT_TRANSIENT" desc="Text that is displayed temporarily as a large toast on first entering a WebVR page over non-secure transport.">
|
||||||
Your connection to this site is not private. To exit VR mode at any time, remove headset and press back.
|
Your connection to this site is not private. To exit VR mode at any time, remove headset and press back.
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_INSECURE_WEBVR_CONTENT_PERMANENT" desc="Text that is displayed in a small permanent notification on a WebVR page loaded over non-secure transport. (Should be short, does not need to be a complete sentence.)">
|
<message name="IDS_PAGE_INFO_INSECURE_WEBVR_CONTENT_PERMANENT" desc="Text that is displayed in a small permanent notification on a WebVR page loaded over non-secure transport. (Should be short, does not need to be a complete sentence.)">
|
||||||
Not secure
|
Not secure
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_NUM_COOKIES" desc="The label of the counts for allowed cookies that are in use on the page.">
|
<message name="IDS_PAGE_INFO_NUM_COOKIES" desc="The label of the counts for allowed cookies that are in use on the page.">
|
||||||
{NUM_COOKIES, plural, =1 {1 in use} other {# in use}}
|
{NUM_COOKIES, plural, =1 {1 in use} other {# in use}}
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_MENU_ITEM_DEFAULT_ALLOW" desc="The text of the menu item of a permissions menu on the Website Settings UI that resets the setting to the default setting which is allow.">
|
<message name="IDS_PAGE_INFO_MENU_ITEM_DEFAULT_ALLOW" desc="The text of the menu item of a permissions menu on the Page Info UI that resets the setting to the default setting which is allow.">
|
||||||
Use global default (Allow)
|
Use global default (Allow)
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_MENU_ITEM_DEFAULT_BLOCK" desc="The text of the menu item of a permissions menu on the Website Settings UI that resets the setting to the default setting which is block.">
|
<message name="IDS_PAGE_INFO_MENU_ITEM_DEFAULT_BLOCK" desc="The text of the menu item of a permissions menu on the Page Info UI that resets the setting to the default setting which is block.">
|
||||||
Use global default (Block)
|
Use global default (Block)
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_MENU_ITEM_DEFAULT_ASK" desc="The text of the menu item of a permissions menu on the Website Settings UI that reset the setting to the default setting which is ask.">
|
<message name="IDS_PAGE_INFO_MENU_ITEM_DEFAULT_ASK" desc="The text of the menu item of a permissions menu on the Page Info UI that reset the setting to the default setting which is ask.">
|
||||||
Use global default (Ask)
|
Use global default (Ask)
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_MENU_ITEM_DEFAULT_DETECT_IMPORTANT_CONTENT" desc="The text of the menu item of a permissions menu on the Website Settings UI that reset the setting to the default setting which is detect important content.">
|
<message name="IDS_PAGE_INFO_MENU_ITEM_DEFAULT_DETECT_IMPORTANT_CONTENT" desc="The text of the menu item of a permissions menu on the Page Info UI that reset the setting to the default setting which is detect important content.">
|
||||||
Use global default (Detect)
|
Use global default (Detect)
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_MENU_ITEM_ALLOW" desc="The text of the menu item of a permissions menu on the Website Settings UI that sets the setting to allow.">
|
<message name="IDS_PAGE_INFO_MENU_ITEM_ALLOW" desc="The text of the menu item of a permissions menu on the Page Info UI that sets the setting to allow.">
|
||||||
Always allow on this site
|
Always allow on this site
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_MENU_ITEM_BLOCK" desc="The text of the menu item of a permissions menu on the Website Settings UI that sets the setting to allow.">
|
<message name="IDS_PAGE_INFO_MENU_ITEM_BLOCK" desc="The text of the menu item of a permissions menu on the Page Info UI that sets the setting to allow.">
|
||||||
Always block on this site
|
Always block on this site
|
||||||
</message>
|
</message>
|
||||||
<message name="IDS_WEBSITE_SETTINGS_MENU_ITEM_DETECT_IMPORTANT_CONTENT" desc="The text of the menu item of a permissions menu on the Website Settings UI that sets the setting to detect important content.">
|
<message name="IDS_PAGE_INFO_MENU_ITEM_DETECT_IMPORTANT_CONTENT" desc="The text of the menu item of a permissions menu on the Page Info UI that sets the setting to detect important content.">
|
||||||
Always detect important content on this site
|
Always detect important content on this site
|
||||||
</message>
|
</message>
|
||||||
|
|
||||||
|
@@ -4113,7 +4113,7 @@ if (is_android) {
|
|||||||
"../android/java/src/org/chromium/chrome/browser/page_info/CertificateChainHelper.java",
|
"../android/java/src/org/chromium/chrome/browser/page_info/CertificateChainHelper.java",
|
||||||
"../android/java/src/org/chromium/chrome/browser/page_info/CertificateViewer.java",
|
"../android/java/src/org/chromium/chrome/browser/page_info/CertificateViewer.java",
|
||||||
"../android/java/src/org/chromium/chrome/browser/page_info/ConnectionInfoPopup.java",
|
"../android/java/src/org/chromium/chrome/browser/page_info/ConnectionInfoPopup.java",
|
||||||
"../android/java/src/org/chromium/chrome/browser/page_info/WebsiteSettingsPopup.java",
|
"../android/java/src/org/chromium/chrome/browser/page_info/PageInfoPopup.java",
|
||||||
"../android/java/src/org/chromium/chrome/browser/partnerbookmarks/PartnerBookmarksReader.java",
|
"../android/java/src/org/chromium/chrome/browser/partnerbookmarks/PartnerBookmarksReader.java",
|
||||||
"../android/java/src/org/chromium/chrome/browser/password_manager/AccountChooserDialog.java",
|
"../android/java/src/org/chromium/chrome/browser/password_manager/AccountChooserDialog.java",
|
||||||
"../android/java/src/org/chromium/chrome/browser/password_manager/AutoSigninFirstRunDialog.java",
|
"../android/java/src/org/chromium/chrome/browser/password_manager/AutoSigninFirstRunDialog.java",
|
||||||
|
@@ -161,7 +161,7 @@
|
|||||||
#include "chrome/browser/ui/android/page_info/certificate_chain_helper.h"
|
#include "chrome/browser/ui/android/page_info/certificate_chain_helper.h"
|
||||||
#include "chrome/browser/ui/android/page_info/certificate_viewer_android.h"
|
#include "chrome/browser/ui/android/page_info/certificate_viewer_android.h"
|
||||||
#include "chrome/browser/ui/android/page_info/connection_info_popup_android.h"
|
#include "chrome/browser/ui/android/page_info/connection_info_popup_android.h"
|
||||||
#include "chrome/browser/ui/android/page_info/website_settings_popup_android.h"
|
#include "chrome/browser/ui/android/page_info/page_info_popup_android.h"
|
||||||
#include "chrome/browser/ui/android/snackbars/auto_signin_prompt_controller.h"
|
#include "chrome/browser/ui/android/snackbars/auto_signin_prompt_controller.h"
|
||||||
#include "chrome/browser/ui/android/ssl_client_certificate_request.h"
|
#include "chrome/browser/ui/android/ssl_client_certificate_request.h"
|
||||||
#include "chrome/browser/ui/android/tab_model/single_tab_model.h"
|
#include "chrome/browser/ui/android/tab_model/single_tab_model.h"
|
||||||
@@ -441,8 +441,8 @@ static base::android::RegistrationMethod kChromeRegisteredMethods[] = {
|
|||||||
{"WebApkUpdateDataFetcher", WebApkUpdateDataFetcher::Register},
|
{"WebApkUpdateDataFetcher", WebApkUpdateDataFetcher::Register},
|
||||||
{"WebContentsFactory", RegisterWebContentsFactory},
|
{"WebContentsFactory", RegisterWebContentsFactory},
|
||||||
{"WebsitePreferenceBridge", RegisterWebsitePreferenceBridge},
|
{"WebsitePreferenceBridge", RegisterWebsitePreferenceBridge},
|
||||||
{"WebsiteSettingsPopupAndroid",
|
{"PageInfoPopupAndroid",
|
||||||
WebsiteSettingsPopupAndroid::RegisterWebsiteSettingsPopupAndroid},
|
PageInfoPopupAndroid::RegisterPageInfoPopupAndroid},
|
||||||
#if BUILDFLAG(ENABLE_PRINTING) && !BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
#if BUILDFLAG(ENABLE_PRINTING) && !BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||||
{"PrintingContext",
|
{"PrintingContext",
|
||||||
printing::PrintingContextAndroid::RegisterPrintingContext},
|
printing::PrintingContextAndroid::RegisterPrintingContext},
|
||||||
|
@@ -45,7 +45,7 @@ DECLARE_RESOURCE_ID(IDR_ANDROID_INFOBAR_SUBRESOURCE_FILTERING,
|
|||||||
R.drawable.infobar_subresource_filtering)
|
R.drawable.infobar_subresource_filtering)
|
||||||
DECLARE_RESOURCE_ID(IDR_ANDROID_INFOBAR_WARNING, R.drawable.infobar_warning)
|
DECLARE_RESOURCE_ID(IDR_ANDROID_INFOBAR_WARNING, R.drawable.infobar_warning)
|
||||||
|
|
||||||
// WebsiteSettingsUI images, used in ConnectionInfoPopup
|
// PageInfoUI images, used in ConnectionInfoPopup
|
||||||
// Good:
|
// Good:
|
||||||
LINK_RESOURCE_ID(IDR_PAGEINFO_GOOD, R.drawable.pageinfo_good)
|
LINK_RESOURCE_ID(IDR_PAGEINFO_GOOD, R.drawable.pageinfo_good)
|
||||||
// Warnings:
|
// Warnings:
|
||||||
|
@@ -295,8 +295,7 @@ SimpleWebViewDialog::GetContentSettingBubbleModelDelegate() {
|
|||||||
return bubble_model_delegate_.get();
|
return bubble_model_delegate_.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SimpleWebViewDialog::ShowWebsiteSettings(
|
void SimpleWebViewDialog::ShowPageInfo(content::WebContents* web_contents) {
|
||||||
content::WebContents* web_contents) {
|
|
||||||
NOTIMPLEMENTED();
|
NOTIMPLEMENTED();
|
||||||
// TODO (markusheintz@): implement this
|
// TODO (markusheintz@): implement this
|
||||||
}
|
}
|
||||||
|
@@ -78,7 +78,7 @@ class SimpleWebViewDialog : public views::ButtonListener,
|
|||||||
const ToolbarModel* GetToolbarModel() const override;
|
const ToolbarModel* GetToolbarModel() const override;
|
||||||
ContentSettingBubbleModelDelegate* GetContentSettingBubbleModelDelegate()
|
ContentSettingBubbleModelDelegate* GetContentSettingBubbleModelDelegate()
|
||||||
override;
|
override;
|
||||||
void ShowWebsiteSettings(content::WebContents* web_contents) override;
|
void ShowPageInfo(content::WebContents* web_contents) override;
|
||||||
|
|
||||||
// Implements ChromeToolbarModelDelegate:
|
// Implements ChromeToolbarModelDelegate:
|
||||||
content::WebContents* GetActiveWebContents() const override;
|
content::WebContents* GetActiveWebContents() const override;
|
||||||
|
@@ -116,10 +116,10 @@ split_static_library("ui") {
|
|||||||
"login/login_interstitial_delegate.h",
|
"login/login_interstitial_delegate.h",
|
||||||
"navigation_correction_tab_observer.cc",
|
"navigation_correction_tab_observer.cc",
|
||||||
"navigation_correction_tab_observer.h",
|
"navigation_correction_tab_observer.h",
|
||||||
"page_info/website_settings.cc",
|
"page_info/page_info.cc",
|
||||||
"page_info/website_settings.h",
|
"page_info/page_info.h",
|
||||||
"page_info/website_settings_ui.cc",
|
"page_info/page_info_ui.cc",
|
||||||
"page_info/website_settings_ui.h",
|
"page_info/page_info_ui.h",
|
||||||
"passwords/account_avatar_fetcher.cc",
|
"passwords/account_avatar_fetcher.cc",
|
||||||
"passwords/account_avatar_fetcher.h",
|
"passwords/account_avatar_fetcher.h",
|
||||||
"passwords/manage_passwords_state.cc",
|
"passwords/manage_passwords_state.cc",
|
||||||
@@ -774,10 +774,10 @@ split_static_library("ui") {
|
|||||||
"omnibox/chrome_omnibox_navigation_observer.h",
|
"omnibox/chrome_omnibox_navigation_observer.h",
|
||||||
"omnibox/clipboard_utils.cc",
|
"omnibox/clipboard_utils.cc",
|
||||||
"omnibox/clipboard_utils.h",
|
"omnibox/clipboard_utils.h",
|
||||||
|
"page_info/page_info_infobar_delegate.cc",
|
||||||
|
"page_info/page_info_infobar_delegate.h",
|
||||||
"page_info/permission_menu_model.cc",
|
"page_info/permission_menu_model.cc",
|
||||||
"page_info/permission_menu_model.h",
|
"page_info/permission_menu_model.h",
|
||||||
"page_info/website_settings_infobar_delegate.cc",
|
|
||||||
"page_info/website_settings_infobar_delegate.h",
|
|
||||||
"passwords/manage_passwords_bubble_model.cc",
|
"passwords/manage_passwords_bubble_model.cc",
|
||||||
"passwords/manage_passwords_bubble_model.h",
|
"passwords/manage_passwords_bubble_model.h",
|
||||||
"passwords/manage_passwords_icon_view.h",
|
"passwords/manage_passwords_icon_view.h",
|
||||||
@@ -1513,11 +1513,11 @@ split_static_library("ui") {
|
|||||||
"views/page_info/chosen_object_row_observer.h",
|
"views/page_info/chosen_object_row_observer.h",
|
||||||
"views/page_info/non_accessible_image_view.cc",
|
"views/page_info/non_accessible_image_view.cc",
|
||||||
"views/page_info/non_accessible_image_view.h",
|
"views/page_info/non_accessible_image_view.h",
|
||||||
|
"views/page_info/page_info_popup_view.cc",
|
||||||
|
"views/page_info/page_info_popup_view.h",
|
||||||
"views/page_info/permission_selector_row.cc",
|
"views/page_info/permission_selector_row.cc",
|
||||||
"views/page_info/permission_selector_row.h",
|
"views/page_info/permission_selector_row.h",
|
||||||
"views/page_info/permission_selector_row_observer.h",
|
"views/page_info/permission_selector_row_observer.h",
|
||||||
"views/page_info/website_settings_popup_view.cc",
|
|
||||||
"views/page_info/website_settings_popup_view.h",
|
|
||||||
"views/payments/credit_card_editor_view_controller.cc",
|
"views/payments/credit_card_editor_view_controller.cc",
|
||||||
"views/payments/credit_card_editor_view_controller.h",
|
"views/payments/credit_card_editor_view_controller.h",
|
||||||
"views/payments/editor_view_controller.cc",
|
"views/payments/editor_view_controller.cc",
|
||||||
@@ -2249,8 +2249,8 @@ split_static_library("ui") {
|
|||||||
"android/page_info/certificate_viewer_android.h",
|
"android/page_info/certificate_viewer_android.h",
|
||||||
"android/page_info/connection_info_popup_android.cc",
|
"android/page_info/connection_info_popup_android.cc",
|
||||||
"android/page_info/connection_info_popup_android.h",
|
"android/page_info/connection_info_popup_android.h",
|
||||||
"android/page_info/website_settings_popup_android.cc",
|
"android/page_info/page_info_popup_android.cc",
|
||||||
"android/page_info/website_settings_popup_android.h",
|
"android/page_info/page_info_popup_android.h",
|
||||||
"android/simple_message_box_android.cc",
|
"android/simple_message_box_android.cc",
|
||||||
"android/snackbars/auto_signin_prompt_controller.cc",
|
"android/snackbars/auto_signin_prompt_controller.cc",
|
||||||
"android/snackbars/auto_signin_prompt_controller.h",
|
"android/snackbars/auto_signin_prompt_controller.h",
|
||||||
@@ -2847,14 +2847,14 @@ split_static_library("ui") {
|
|||||||
"cocoa/one_click_signin_dialog_controller.mm",
|
"cocoa/one_click_signin_dialog_controller.mm",
|
||||||
"cocoa/one_click_signin_view_controller.h",
|
"cocoa/one_click_signin_view_controller.h",
|
||||||
"cocoa/one_click_signin_view_controller.mm",
|
"cocoa/one_click_signin_view_controller.mm",
|
||||||
|
"cocoa/page_info/page_info_bubble_controller.h",
|
||||||
|
"cocoa/page_info/page_info_bubble_controller.mm",
|
||||||
|
"cocoa/page_info/page_info_utils_cocoa.h",
|
||||||
|
"cocoa/page_info/page_info_utils_cocoa.mm",
|
||||||
"cocoa/page_info/permission_selector_button.h",
|
"cocoa/page_info/permission_selector_button.h",
|
||||||
"cocoa/page_info/permission_selector_button.mm",
|
"cocoa/page_info/permission_selector_button.mm",
|
||||||
"cocoa/page_info/split_block_button.h",
|
"cocoa/page_info/split_block_button.h",
|
||||||
"cocoa/page_info/split_block_button.mm",
|
"cocoa/page_info/split_block_button.mm",
|
||||||
"cocoa/page_info/website_settings_bubble_controller.h",
|
|
||||||
"cocoa/page_info/website_settings_bubble_controller.mm",
|
|
||||||
"cocoa/page_info/website_settings_utils_cocoa.h",
|
|
||||||
"cocoa/page_info/website_settings_utils_cocoa.mm",
|
|
||||||
"cocoa/passwords/account_avatar_fetcher_manager.h",
|
"cocoa/passwords/account_avatar_fetcher_manager.h",
|
||||||
"cocoa/passwords/account_avatar_fetcher_manager.mm",
|
"cocoa/passwords/account_avatar_fetcher_manager.mm",
|
||||||
"cocoa/passwords/account_chooser_view_controller.h",
|
"cocoa/passwords/account_chooser_view_controller.h",
|
||||||
|
@@ -11,7 +11,7 @@
|
|||||||
#include "chrome/browser/infobars/infobar_service.h"
|
#include "chrome/browser/infobars/infobar_service.h"
|
||||||
#include "chrome/browser/profiles/profile.h"
|
#include "chrome/browser/profiles/profile.h"
|
||||||
#include "chrome/browser/ssl/security_state_tab_helper.h"
|
#include "chrome/browser/ssl/security_state_tab_helper.h"
|
||||||
#include "chrome/browser/ui/page_info/website_settings.h"
|
#include "chrome/browser/ui/page_info/page_info.h"
|
||||||
#include "chrome/grit/generated_resources.h"
|
#include "chrome/grit/generated_resources.h"
|
||||||
#include "components/security_state/core/security_state.h"
|
#include "components/security_state/core/security_state.h"
|
||||||
#include "components/strings/grit/components_strings.h"
|
#include "components/strings/grit/components_strings.h"
|
||||||
@@ -46,7 +46,7 @@ static jlong Init(JNIEnv* env,
|
|||||||
|
|
||||||
ConnectionInfoPopupAndroid::ConnectionInfoPopupAndroid(
|
ConnectionInfoPopupAndroid::ConnectionInfoPopupAndroid(
|
||||||
JNIEnv* env,
|
JNIEnv* env,
|
||||||
jobject java_website_settings_pop,
|
jobject java_page_info_pop,
|
||||||
WebContents* web_contents) {
|
WebContents* web_contents) {
|
||||||
// Important to use GetVisibleEntry to match what's showing in the omnibox.
|
// Important to use GetVisibleEntry to match what's showing in the omnibox.
|
||||||
content::NavigationEntry* nav_entry =
|
content::NavigationEntry* nav_entry =
|
||||||
@@ -54,7 +54,7 @@ ConnectionInfoPopupAndroid::ConnectionInfoPopupAndroid(
|
|||||||
if (nav_entry == nullptr)
|
if (nav_entry == nullptr)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
popup_jobject_.Reset(env, java_website_settings_pop);
|
popup_jobject_.Reset(env, java_page_info_pop);
|
||||||
|
|
||||||
SecurityStateTabHelper* helper =
|
SecurityStateTabHelper* helper =
|
||||||
SecurityStateTabHelper::FromWebContents(web_contents);
|
SecurityStateTabHelper::FromWebContents(web_contents);
|
||||||
@@ -63,7 +63,7 @@ ConnectionInfoPopupAndroid::ConnectionInfoPopupAndroid(
|
|||||||
security_state::SecurityInfo security_info;
|
security_state::SecurityInfo security_info;
|
||||||
helper->GetSecurityInfo(&security_info);
|
helper->GetSecurityInfo(&security_info);
|
||||||
|
|
||||||
presenter_.reset(new WebsiteSettings(
|
presenter_.reset(new PageInfo(
|
||||||
this, Profile::FromBrowserContext(web_contents->GetBrowserContext()),
|
this, Profile::FromBrowserContext(web_contents->GetBrowserContext()),
|
||||||
TabSpecificContentSettings::FromWebContents(web_contents), web_contents,
|
TabSpecificContentSettings::FromWebContents(web_contents), web_contents,
|
||||||
nav_entry->GetURL(), security_info));
|
nav_entry->GetURL(), security_info));
|
||||||
@@ -90,7 +90,7 @@ void ConnectionInfoPopupAndroid::SetIdentityInfo(
|
|||||||
|
|
||||||
{
|
{
|
||||||
int icon_id = ResourceMapper::MapFromChromiumId(
|
int icon_id = ResourceMapper::MapFromChromiumId(
|
||||||
WebsiteSettingsUI::GetIdentityIconID(identity_info.identity_status));
|
PageInfoUI::GetIdentityIconID(identity_info.identity_status));
|
||||||
|
|
||||||
// The headline and the certificate dialog link of the site's identity
|
// The headline and the certificate dialog link of the site's identity
|
||||||
// section is only displayed if the site's identity was verified. If the
|
// section is only displayed if the site's identity was verified. If the
|
||||||
@@ -109,7 +109,7 @@ void ConnectionInfoPopupAndroid::SetIdentityInfo(
|
|||||||
// Only show the certificate viewer link if the connection actually used a
|
// Only show the certificate viewer link if the connection actually used a
|
||||||
// certificate.
|
// certificate.
|
||||||
if (identity_info.identity_status !=
|
if (identity_info.identity_status !=
|
||||||
WebsiteSettings::SITE_IDENTITY_STATUS_NO_CERT) {
|
PageInfo::SITE_IDENTITY_STATUS_NO_CERT) {
|
||||||
certificate_label =
|
certificate_label =
|
||||||
l10n_util::GetStringUTF16(IDS_PAGEINFO_CERT_INFO_BUTTON);
|
l10n_util::GetStringUTF16(IDS_PAGEINFO_CERT_INFO_BUTTON);
|
||||||
}
|
}
|
||||||
@@ -129,8 +129,7 @@ void ConnectionInfoPopupAndroid::SetIdentityInfo(
|
|||||||
|
|
||||||
{
|
{
|
||||||
int icon_id = ResourceMapper::MapFromChromiumId(
|
int icon_id = ResourceMapper::MapFromChromiumId(
|
||||||
WebsiteSettingsUI::GetConnectionIconID(
|
PageInfoUI::GetConnectionIconID(identity_info.connection_status));
|
||||||
identity_info.connection_status));
|
|
||||||
|
|
||||||
ScopedJavaLocalRef<jstring> description = ConvertUTF8ToJavaString(
|
ScopedJavaLocalRef<jstring> description = ConvertUTF8ToJavaString(
|
||||||
env, identity_info.connection_status_description);
|
env, identity_info.connection_status_description);
|
||||||
|
@@ -11,18 +11,18 @@
|
|||||||
|
|
||||||
#include "base/android/scoped_java_ref.h"
|
#include "base/android/scoped_java_ref.h"
|
||||||
#include "base/macros.h"
|
#include "base/macros.h"
|
||||||
#include "chrome/browser/ui/page_info/website_settings_ui.h"
|
#include "chrome/browser/ui/page_info/page_info_ui.h"
|
||||||
|
|
||||||
namespace content {
|
namespace content {
|
||||||
class WebContents;
|
class WebContents;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Android implementation of the website settings UI which displays detailed
|
// Android implementation of the page info UI which displays detailed
|
||||||
// connection and certificate information for the website.
|
// connection and certificate information for the website.
|
||||||
class ConnectionInfoPopupAndroid : public WebsiteSettingsUI {
|
class ConnectionInfoPopupAndroid : public PageInfoUI {
|
||||||
public:
|
public:
|
||||||
ConnectionInfoPopupAndroid(JNIEnv* env,
|
ConnectionInfoPopupAndroid(JNIEnv* env,
|
||||||
jobject java_website_settings,
|
jobject java_page_info,
|
||||||
content::WebContents* web_contents);
|
content::WebContents* web_contents);
|
||||||
~ConnectionInfoPopupAndroid() override;
|
~ConnectionInfoPopupAndroid() override;
|
||||||
void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
|
void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
|
||||||
@@ -34,7 +34,7 @@ class ConnectionInfoPopupAndroid : public WebsiteSettingsUI {
|
|||||||
const base::android::JavaParamRef<jobject>& obj,
|
const base::android::JavaParamRef<jobject>& obj,
|
||||||
const base::android::JavaParamRef<jobject>& java_web_contents);
|
const base::android::JavaParamRef<jobject>& java_web_contents);
|
||||||
|
|
||||||
// WebsiteSettingsUI implementations.
|
// PageInfoUI implementations.
|
||||||
void SetCookieInfo(const CookieInfoList& cookie_info_list) override;
|
void SetCookieInfo(const CookieInfoList& cookie_info_list) override;
|
||||||
void SetPermissionInfo(const PermissionInfoList& permission_info_list,
|
void SetPermissionInfo(const PermissionInfoList& permission_info_list,
|
||||||
ChosenObjectInfoList chosen_object_info_list) override;
|
ChosenObjectInfoList chosen_object_info_list) override;
|
||||||
@@ -43,8 +43,8 @@ class ConnectionInfoPopupAndroid : public WebsiteSettingsUI {
|
|||||||
static bool RegisterConnectionInfoPopupAndroid(JNIEnv* env);
|
static bool RegisterConnectionInfoPopupAndroid(JNIEnv* env);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// The presenter that controls the Website Settings UI.
|
// The presenter that controls the Page Info UI.
|
||||||
std::unique_ptr<WebsiteSettings> presenter_;
|
std::unique_ptr<PageInfo> presenter_;
|
||||||
|
|
||||||
// The java prompt implementation.
|
// The java prompt implementation.
|
||||||
base::android::ScopedJavaGlobalRef<jobject> popup_jobject_;
|
base::android::ScopedJavaGlobalRef<jobject> popup_jobject_;
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#include "chrome/browser/ui/android/page_info/website_settings_popup_android.h"
|
#include "chrome/browser/ui/android/page_info/page_info_popup_android.h"
|
||||||
|
|
||||||
#include "base/android/jni_android.h"
|
#include "base/android/jni_android.h"
|
||||||
#include "base/android/jni_array.h"
|
#include "base/android/jni_array.h"
|
||||||
@@ -12,8 +12,8 @@
|
|||||||
#include "chrome/browser/infobars/infobar_service.h"
|
#include "chrome/browser/infobars/infobar_service.h"
|
||||||
#include "chrome/browser/profiles/profile.h"
|
#include "chrome/browser/profiles/profile.h"
|
||||||
#include "chrome/browser/ssl/security_state_tab_helper.h"
|
#include "chrome/browser/ssl/security_state_tab_helper.h"
|
||||||
#include "chrome/browser/ui/page_info/website_settings.h"
|
#include "chrome/browser/ui/page_info/page_info.h"
|
||||||
#include "chrome/browser/ui/page_info/website_settings_ui.h"
|
#include "chrome/browser/ui/page_info/page_info_ui.h"
|
||||||
#include "components/content_settings/core/common/content_settings.h"
|
#include "components/content_settings/core/common/content_settings.h"
|
||||||
#include "components/content_settings/core/common/content_settings_types.h"
|
#include "components/content_settings/core/common/content_settings_types.h"
|
||||||
#include "components/security_state/core/security_state.h"
|
#include "components/security_state/core/security_state.h"
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
#include "content/public/browser/navigation_controller.h"
|
#include "content/public/browser/navigation_controller.h"
|
||||||
#include "content/public/browser/navigation_entry.h"
|
#include "content/public/browser/navigation_entry.h"
|
||||||
#include "content/public/browser/web_contents.h"
|
#include "content/public/browser/web_contents.h"
|
||||||
#include "jni/WebsiteSettingsPopup_jni.h"
|
#include "jni/PageInfoPopup_jni.h"
|
||||||
#include "url/origin.h"
|
#include "url/origin.h"
|
||||||
|
|
||||||
using base::android::ConvertUTF16ToJavaString;
|
using base::android::ConvertUTF16ToJavaString;
|
||||||
@@ -37,13 +37,12 @@ static jlong Init(JNIEnv* env,
|
|||||||
content::WebContents::FromJavaWebContents(java_web_contents);
|
content::WebContents::FromJavaWebContents(java_web_contents);
|
||||||
|
|
||||||
return reinterpret_cast<intptr_t>(
|
return reinterpret_cast<intptr_t>(
|
||||||
new WebsiteSettingsPopupAndroid(env, obj, web_contents));
|
new PageInfoPopupAndroid(env, obj, web_contents));
|
||||||
}
|
}
|
||||||
|
|
||||||
WebsiteSettingsPopupAndroid::WebsiteSettingsPopupAndroid(
|
PageInfoPopupAndroid::PageInfoPopupAndroid(JNIEnv* env,
|
||||||
JNIEnv* env,
|
jobject java_page_info_pop,
|
||||||
jobject java_website_settings_pop,
|
content::WebContents* web_contents)
|
||||||
content::WebContents* web_contents)
|
|
||||||
: search_geolocation_service_(nullptr) {
|
: search_geolocation_service_(nullptr) {
|
||||||
// Important to use GetVisibleEntry to match what's showing in the omnibox.
|
// Important to use GetVisibleEntry to match what's showing in the omnibox.
|
||||||
content::NavigationEntry* nav_entry =
|
content::NavigationEntry* nav_entry =
|
||||||
@@ -53,7 +52,7 @@ WebsiteSettingsPopupAndroid::WebsiteSettingsPopupAndroid(
|
|||||||
|
|
||||||
url_ = nav_entry->GetURL();
|
url_ = nav_entry->GetURL();
|
||||||
|
|
||||||
popup_jobject_.Reset(env, java_website_settings_pop);
|
popup_jobject_.Reset(env, java_page_info_pop);
|
||||||
|
|
||||||
SecurityStateTabHelper* helper =
|
SecurityStateTabHelper* helper =
|
||||||
SecurityStateTabHelper::FromWebContents(web_contents);
|
SecurityStateTabHelper::FromWebContents(web_contents);
|
||||||
@@ -65,45 +64,44 @@ WebsiteSettingsPopupAndroid::WebsiteSettingsPopupAndroid(
|
|||||||
SearchGeolocationService::Factory::GetForBrowserContext(
|
SearchGeolocationService::Factory::GetForBrowserContext(
|
||||||
web_contents->GetBrowserContext());
|
web_contents->GetBrowserContext());
|
||||||
|
|
||||||
presenter_.reset(new WebsiteSettings(
|
presenter_.reset(new PageInfo(
|
||||||
this, Profile::FromBrowserContext(web_contents->GetBrowserContext()),
|
this, Profile::FromBrowserContext(web_contents->GetBrowserContext()),
|
||||||
TabSpecificContentSettings::FromWebContents(web_contents), web_contents,
|
TabSpecificContentSettings::FromWebContents(web_contents), web_contents,
|
||||||
nav_entry->GetURL(), security_info));
|
nav_entry->GetURL(), security_info));
|
||||||
}
|
}
|
||||||
|
|
||||||
WebsiteSettingsPopupAndroid::~WebsiteSettingsPopupAndroid() {}
|
PageInfoPopupAndroid::~PageInfoPopupAndroid() {}
|
||||||
|
|
||||||
void WebsiteSettingsPopupAndroid::Destroy(JNIEnv* env,
|
void PageInfoPopupAndroid::Destroy(JNIEnv* env,
|
||||||
const JavaParamRef<jobject>& obj) {
|
const JavaParamRef<jobject>& obj) {
|
||||||
delete this;
|
delete this;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettingsPopupAndroid::RecordWebsiteSettingsAction(
|
void PageInfoPopupAndroid::RecordPageInfoAction(
|
||||||
JNIEnv* env,
|
JNIEnv* env,
|
||||||
const JavaParamRef<jobject>& obj,
|
const JavaParamRef<jobject>& obj,
|
||||||
jint action) {
|
jint action) {
|
||||||
presenter_->RecordWebsiteSettingsAction(
|
presenter_->RecordPageInfoAction(
|
||||||
static_cast<WebsiteSettings::WebsiteSettingsAction>(action));
|
static_cast<PageInfo::PageInfoAction>(action));
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettingsPopupAndroid::SetIdentityInfo(
|
void PageInfoPopupAndroid::SetIdentityInfo(const IdentityInfo& identity_info) {
|
||||||
const IdentityInfo& identity_info) {
|
|
||||||
JNIEnv* env = base::android::AttachCurrentThread();
|
JNIEnv* env = base::android::AttachCurrentThread();
|
||||||
std::unique_ptr<WebsiteSettingsUI::SecurityDescription> security_description =
|
std::unique_ptr<PageInfoUI::SecurityDescription> security_description =
|
||||||
identity_info.GetSecurityDescription();
|
identity_info.GetSecurityDescription();
|
||||||
|
|
||||||
Java_WebsiteSettingsPopup_setSecurityDescription(
|
Java_PageInfoPopup_setSecurityDescription(
|
||||||
env, popup_jobject_,
|
env, popup_jobject_,
|
||||||
ConvertUTF16ToJavaString(env, security_description->summary),
|
ConvertUTF16ToJavaString(env, security_description->summary),
|
||||||
ConvertUTF16ToJavaString(env, security_description->details));
|
ConvertUTF16ToJavaString(env, security_description->details));
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettingsPopupAndroid::SetCookieInfo(
|
void PageInfoPopupAndroid::SetCookieInfo(
|
||||||
const CookieInfoList& cookie_info_list) {
|
const CookieInfoList& cookie_info_list) {
|
||||||
NOTIMPLEMENTED();
|
NOTIMPLEMENTED();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettingsPopupAndroid::SetPermissionInfo(
|
void PageInfoPopupAndroid::SetPermissionInfo(
|
||||||
const PermissionInfoList& permission_info_list,
|
const PermissionInfoList& permission_info_list,
|
||||||
ChosenObjectInfoList chosen_object_info_list) {
|
ChosenObjectInfoList chosen_object_info_list) {
|
||||||
JNIEnv* env = base::android::AttachCurrentThread();
|
JNIEnv* env = base::android::AttachCurrentThread();
|
||||||
@@ -144,9 +142,9 @@ void WebsiteSettingsPopupAndroid::SetPermissionInfo(
|
|||||||
for (const auto& permission : permissions_to_display) {
|
for (const auto& permission : permissions_to_display) {
|
||||||
if (base::ContainsKey(user_specified_settings_to_display, permission)) {
|
if (base::ContainsKey(user_specified_settings_to_display, permission)) {
|
||||||
base::string16 setting_title =
|
base::string16 setting_title =
|
||||||
WebsiteSettingsUI::PermissionTypeToUIString(permission);
|
PageInfoUI::PermissionTypeToUIString(permission);
|
||||||
|
|
||||||
Java_WebsiteSettingsPopup_addPermissionSection(
|
Java_PageInfoPopup_addPermissionSection(
|
||||||
env, popup_jobject_, ConvertUTF16ToJavaString(env, setting_title),
|
env, popup_jobject_, ConvertUTF16ToJavaString(env, setting_title),
|
||||||
static_cast<jint>(permission),
|
static_cast<jint>(permission),
|
||||||
static_cast<jint>(user_specified_settings_to_display[permission]));
|
static_cast<jint>(user_specified_settings_to_display[permission]));
|
||||||
@@ -155,19 +153,18 @@ void WebsiteSettingsPopupAndroid::SetPermissionInfo(
|
|||||||
|
|
||||||
for (const auto& chosen_object : chosen_object_info_list) {
|
for (const auto& chosen_object : chosen_object_info_list) {
|
||||||
base::string16 object_title =
|
base::string16 object_title =
|
||||||
WebsiteSettingsUI::ChosenObjectToUIString(*chosen_object);
|
PageInfoUI::ChosenObjectToUIString(*chosen_object);
|
||||||
|
|
||||||
Java_WebsiteSettingsPopup_addPermissionSection(
|
Java_PageInfoPopup_addPermissionSection(
|
||||||
env, popup_jobject_, ConvertUTF16ToJavaString(env, object_title),
|
env, popup_jobject_, ConvertUTF16ToJavaString(env, object_title),
|
||||||
static_cast<jint>(chosen_object->ui_info.content_settings_type),
|
static_cast<jint>(chosen_object->ui_info.content_settings_type),
|
||||||
static_cast<jint>(CONTENT_SETTING_ALLOW));
|
static_cast<jint>(CONTENT_SETTING_ALLOW));
|
||||||
}
|
}
|
||||||
|
|
||||||
Java_WebsiteSettingsPopup_updatePermissionDisplay(env, popup_jobject_);
|
Java_PageInfoPopup_updatePermissionDisplay(env, popup_jobject_);
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
bool WebsiteSettingsPopupAndroid::RegisterWebsiteSettingsPopupAndroid(
|
bool PageInfoPopupAndroid::RegisterPageInfoPopupAndroid(JNIEnv* env) {
|
||||||
JNIEnv* env) {
|
|
||||||
return RegisterNativesImpl(env);
|
return RegisterNativesImpl(env);
|
||||||
}
|
}
|
@@ -2,8 +2,8 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#ifndef CHROME_BROWSER_UI_ANDROID_PAGE_INFO_WEBSITE_SETTINGS_POPUP_ANDROID_H_
|
#ifndef CHROME_BROWSER_UI_ANDROID_PAGE_INFO_PAGE_INFO_POPUP_ANDROID_H_
|
||||||
#define CHROME_BROWSER_UI_ANDROID_PAGE_INFO_WEBSITE_SETTINGS_POPUP_ANDROID_H_
|
#define CHROME_BROWSER_UI_ANDROID_PAGE_INFO_PAGE_INFO_POPUP_ANDROID_H_
|
||||||
|
|
||||||
#include <jni.h>
|
#include <jni.h>
|
||||||
|
|
||||||
@@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
#include "base/android/scoped_java_ref.h"
|
#include "base/android/scoped_java_ref.h"
|
||||||
#include "base/macros.h"
|
#include "base/macros.h"
|
||||||
#include "chrome/browser/ui/page_info/website_settings_ui.h"
|
#include "chrome/browser/ui/page_info/page_info_ui.h"
|
||||||
|
|
||||||
namespace content {
|
namespace content {
|
||||||
class WebContents;
|
class WebContents;
|
||||||
@@ -30,30 +30,29 @@ enum PageInfoConnectionType {
|
|||||||
CONNECTION_INTERNAL_PAGE,
|
CONNECTION_INTERNAL_PAGE,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Android implementation of the website settings UI.
|
// Android implementation of the page info UI.
|
||||||
class WebsiteSettingsPopupAndroid : public WebsiteSettingsUI {
|
class PageInfoPopupAndroid : public PageInfoUI {
|
||||||
public:
|
public:
|
||||||
WebsiteSettingsPopupAndroid(JNIEnv* env,
|
PageInfoPopupAndroid(JNIEnv* env,
|
||||||
jobject java_website_settings,
|
jobject java_page_info,
|
||||||
content::WebContents* web_contents);
|
content::WebContents* web_contents);
|
||||||
~WebsiteSettingsPopupAndroid() override;
|
~PageInfoPopupAndroid() override;
|
||||||
void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
|
void Destroy(JNIEnv* env, const base::android::JavaParamRef<jobject>& obj);
|
||||||
void RecordWebsiteSettingsAction(
|
void RecordPageInfoAction(JNIEnv* env,
|
||||||
JNIEnv* env,
|
const base::android::JavaParamRef<jobject>& obj,
|
||||||
const base::android::JavaParamRef<jobject>& obj,
|
jint action);
|
||||||
jint action);
|
|
||||||
|
|
||||||
// WebsiteSettingsUI implementations.
|
// PageInfoUI implementations.
|
||||||
void SetCookieInfo(const CookieInfoList& cookie_info_list) override;
|
void SetCookieInfo(const CookieInfoList& cookie_info_list) override;
|
||||||
void SetPermissionInfo(const PermissionInfoList& permission_info_list,
|
void SetPermissionInfo(const PermissionInfoList& permission_info_list,
|
||||||
ChosenObjectInfoList chosen_object_info_list) override;
|
ChosenObjectInfoList chosen_object_info_list) override;
|
||||||
void SetIdentityInfo(const IdentityInfo& identity_info) override;
|
void SetIdentityInfo(const IdentityInfo& identity_info) override;
|
||||||
|
|
||||||
static bool RegisterWebsiteSettingsPopupAndroid(JNIEnv* env);
|
static bool RegisterPageInfoPopupAndroid(JNIEnv* env);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// The presenter that controlls the Website Settings UI.
|
// The presenter that controlls the Page Info UI.
|
||||||
std::unique_ptr<WebsiteSettings> presenter_;
|
std::unique_ptr<PageInfo> presenter_;
|
||||||
|
|
||||||
// The java prompt implementation.
|
// The java prompt implementation.
|
||||||
base::android::ScopedJavaGlobalRef<jobject> popup_jobject_;
|
base::android::ScopedJavaGlobalRef<jobject> popup_jobject_;
|
||||||
@@ -63,7 +62,7 @@ class WebsiteSettingsPopupAndroid : public WebsiteSettingsUI {
|
|||||||
|
|
||||||
GURL url_;
|
GURL url_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsPopupAndroid);
|
DISALLOW_COPY_AND_ASSIGN(PageInfoPopupAndroid);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CHROME_BROWSER_UI_ANDROID_PAGE_INFO_WEBSITE_SETTINGS_POPUP_ANDROID_H_
|
#endif // CHROME_BROWSER_UI_ANDROID_PAGE_INFO_PAGE_INFO_POPUP_ANDROID_H_
|
@@ -378,7 +378,7 @@ void ChromeAutofillClient::ShowHttpNotSecureExplanation() {
|
|||||||
// On desktop platforms, open Page Info, which briefly explains the HTTP
|
// On desktop platforms, open Page Info, which briefly explains the HTTP
|
||||||
// warning message and provides a link to the Help Center for more details.
|
// warning message and provides a link to the Help Center for more details.
|
||||||
Browser* browser = chrome::FindBrowserWithWebContents(web_contents());
|
Browser* browser = chrome::FindBrowserWithWebContents(web_contents());
|
||||||
if (browser && chrome::ShowWebsiteSettings(browser, web_contents()))
|
if (browser && chrome::ShowPageInfo(browser, web_contents()))
|
||||||
return;
|
return;
|
||||||
// Otherwise fall through to the section below that opens the URL directly.
|
// Otherwise fall through to the section below that opens the URL directly.
|
||||||
#endif
|
#endif
|
||||||
|
@@ -897,7 +897,7 @@ void ShowFindBar(Browser* browser) {
|
|||||||
browser->GetFindBarController()->Show();
|
browser->GetFindBarController()->Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ShowWebsiteSettings(Browser* browser, content::WebContents* web_contents) {
|
bool ShowPageInfo(Browser* browser, content::WebContents* web_contents) {
|
||||||
content::NavigationEntry* entry =
|
content::NavigationEntry* entry =
|
||||||
web_contents->GetController().GetVisibleEntry();
|
web_contents->GetController().GetVisibleEntry();
|
||||||
if (!entry)
|
if (!entry)
|
||||||
@@ -908,7 +908,7 @@ bool ShowWebsiteSettings(Browser* browser, content::WebContents* web_contents) {
|
|||||||
security_state::SecurityInfo security_info;
|
security_state::SecurityInfo security_info;
|
||||||
helper->GetSecurityInfo(&security_info);
|
helper->GetSecurityInfo(&security_info);
|
||||||
|
|
||||||
browser->window()->ShowWebsiteSettings(
|
browser->window()->ShowPageInfo(
|
||||||
Profile::FromBrowserContext(web_contents->GetBrowserContext()),
|
Profile::FromBrowserContext(web_contents->GetBrowserContext()),
|
||||||
web_contents, entry->GetVirtualURL(), security_info);
|
web_contents, entry->GetVirtualURL(), security_info);
|
||||||
return true;
|
return true;
|
||||||
|
@@ -102,7 +102,7 @@ void ManagePasswordsForPage(Browser* browser);
|
|||||||
void SavePage(Browser* browser);
|
void SavePage(Browser* browser);
|
||||||
bool CanSavePage(const Browser* browser);
|
bool CanSavePage(const Browser* browser);
|
||||||
void ShowFindBar(Browser* browser);
|
void ShowFindBar(Browser* browser);
|
||||||
bool ShowWebsiteSettings(Browser* browser, content::WebContents* web_contents);
|
bool ShowPageInfo(Browser* browser, content::WebContents* web_contents);
|
||||||
void Print(Browser* browser);
|
void Print(Browser* browser);
|
||||||
bool CanPrint(Browser* browser);
|
bool CanPrint(Browser* browser);
|
||||||
#if BUILDFLAG(ENABLE_BASIC_PRINTING)
|
#if BUILDFLAG(ENABLE_BASIC_PRINTING)
|
||||||
|
@@ -117,8 +117,8 @@ content::ColorChooser* ShowColorChooser(content::WebContents* web_contents,
|
|||||||
|
|
||||||
#if defined(OS_MACOSX)
|
#if defined(OS_MACOSX)
|
||||||
|
|
||||||
// Shows a Views website settings bubble at the given anchor point.
|
// Shows a Views page info bubble at the given anchor point.
|
||||||
void ShowWebsiteSettingsBubbleViewsAtPoint(
|
void ShowPageInfoBubbleViewsAtPoint(
|
||||||
const gfx::Point& anchor_point,
|
const gfx::Point& anchor_point,
|
||||||
Profile* profile,
|
Profile* profile,
|
||||||
content::WebContents* web_contents,
|
content::WebContents* web_contents,
|
||||||
|
@@ -294,11 +294,11 @@ class BrowserWindow : public ui::BaseWindow {
|
|||||||
// that it's time to redraw everything.
|
// that it's time to redraw everything.
|
||||||
virtual void UserChangedTheme() = 0;
|
virtual void UserChangedTheme() = 0;
|
||||||
|
|
||||||
// Shows the website settings using the specified information. |virtual_url|
|
// Shows Page Info using the specified information. |virtual_url|
|
||||||
// is the virtual url of the page/frame the info applies to, |ssl| is the SSL
|
// is the virtual url of the page/frame the info applies to, |ssl| is the SSL
|
||||||
// information for that page/frame. If |show_history| is true, a section
|
// information for that page/frame. If |show_history| is true, a section
|
||||||
// showing how many times that URL has been visited is added to the page info.
|
// showing how many times that URL has been visited is added to the page info.
|
||||||
virtual void ShowWebsiteSettings(
|
virtual void ShowPageInfo(
|
||||||
Profile* profile,
|
Profile* profile,
|
||||||
content::WebContents* web_contents,
|
content::WebContents* web_contents,
|
||||||
const GURL& virtual_url,
|
const GURL& virtual_url,
|
||||||
|
@@ -129,11 +129,10 @@ class BrowserWindowCocoa
|
|||||||
bool app_modal,
|
bool app_modal,
|
||||||
const base::Callback<void(bool)>& callback) override;
|
const base::Callback<void(bool)>& callback) override;
|
||||||
void UserChangedTheme() override;
|
void UserChangedTheme() override;
|
||||||
void ShowWebsiteSettings(
|
void ShowPageInfo(Profile* profile,
|
||||||
Profile* profile,
|
content::WebContents* web_contents,
|
||||||
content::WebContents* web_contents,
|
const GURL& virtual_url,
|
||||||
const GURL& virtual_url,
|
const security_state::SecurityInfo& security_info) override;
|
||||||
const security_state::SecurityInfo& security_info) override;
|
|
||||||
void ShowAppMenu() override;
|
void ShowAppMenu() override;
|
||||||
content::KeyboardEventProcessingResult PreHandleKeyboardEvent(
|
content::KeyboardEventProcessingResult PreHandleKeyboardEvent(
|
||||||
const content::NativeWebKeyboardEvent& event) override;
|
const content::NativeWebKeyboardEvent& event) override;
|
||||||
|
@@ -40,7 +40,7 @@
|
|||||||
#include "chrome/browser/ui/cocoa/key_equivalent_constants.h"
|
#include "chrome/browser/ui/cocoa/key_equivalent_constants.h"
|
||||||
#import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h"
|
#import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h"
|
||||||
#import "chrome/browser/ui/cocoa/nsmenuitem_additions.h"
|
#import "chrome/browser/ui/cocoa/nsmenuitem_additions.h"
|
||||||
#import "chrome/browser/ui/cocoa/page_info/website_settings_bubble_controller.h"
|
#import "chrome/browser/ui/cocoa/page_info/page_info_bubble_controller.h"
|
||||||
#import "chrome/browser/ui/cocoa/profiles/avatar_base_controller.h"
|
#import "chrome/browser/ui/cocoa/profiles/avatar_base_controller.h"
|
||||||
#include "chrome/browser/ui/cocoa/restart_browser.h"
|
#include "chrome/browser/ui/cocoa/restart_browser.h"
|
||||||
#include "chrome/browser/ui/cocoa/status_bubble_mac.h"
|
#include "chrome/browser/ui/cocoa/status_bubble_mac.h"
|
||||||
@@ -436,7 +436,7 @@ bool BrowserWindowCocoa::IsFullscreen() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool BrowserWindowCocoa::IsFullscreenBubbleVisible() const {
|
bool BrowserWindowCocoa::IsFullscreenBubbleVisible() const {
|
||||||
return false; // Currently only called from toolkit-views website_settings.
|
return false; // Currently only called from toolkit-views page_info.
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserWindowCocoa::MaybeShowNewBackShortcutBubble(bool forward) {
|
void BrowserWindowCocoa::MaybeShowNewBackShortcutBubble(bool forward) {
|
||||||
@@ -682,13 +682,13 @@ void BrowserWindowCocoa::UserChangedTheme() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserWindowCocoa::ShowWebsiteSettings(
|
void BrowserWindowCocoa::ShowPageInfo(
|
||||||
Profile* profile,
|
Profile* profile,
|
||||||
content::WebContents* web_contents,
|
content::WebContents* web_contents,
|
||||||
const GURL& virtual_url,
|
const GURL& virtual_url,
|
||||||
const security_state::SecurityInfo& security_info) {
|
const security_state::SecurityInfo& security_info) {
|
||||||
WebsiteSettingsUIBridge::Show(window(), profile, web_contents, virtual_url,
|
PageInfoUIBridge::Show(window(), profile, web_contents, virtual_url,
|
||||||
security_info);
|
security_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserWindowCocoa::ShowAppMenu() {
|
void BrowserWindowCocoa::ShowAppMenu() {
|
||||||
|
@@ -123,7 +123,7 @@ bool LocationIconDecoration::OnMousePressed(NSRect frame, NSPoint location) {
|
|||||||
|
|
||||||
WebContents* tab = owner_->GetWebContents();
|
WebContents* tab = owner_->GetWebContents();
|
||||||
Browser* browser = chrome::FindBrowserWithWebContents(tab);
|
Browser* browser = chrome::FindBrowserWithWebContents(tab);
|
||||||
chrome::ShowWebsiteSettings(browser, tab);
|
chrome::ShowPageInfo(browser, tab);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -2,8 +2,8 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#ifndef CHROME_BROWSER_UI_COCOA_WEBSITE_SETTINGS_WEBSITE_SETTINGS_BUBBLE_CONTROLLER_H_
|
#ifndef CHROME_BROWSER_UI_COCOA_PAGE_INFO_PAGE_INFO_BUBBLE_CONTROLLER_H_
|
||||||
#define CHROME_BROWSER_UI_COCOA_WEBSITE_SETTINGS_WEBSITE_SETTINGS_BUBBLE_CONTROLLER_H_
|
#define CHROME_BROWSER_UI_COCOA_PAGE_INFO_PAGE_INFO_BUBBLE_CONTROLLER_H_
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
@@ -12,10 +12,10 @@
|
|||||||
#include "base/mac/scoped_nsobject.h"
|
#include "base/mac/scoped_nsobject.h"
|
||||||
#include "base/macros.h"
|
#include "base/macros.h"
|
||||||
#import "chrome/browser/ui/cocoa/omnibox_decoration_bubble_controller.h"
|
#import "chrome/browser/ui/cocoa/omnibox_decoration_bubble_controller.h"
|
||||||
#include "chrome/browser/ui/page_info/website_settings_ui.h"
|
#include "chrome/browser/ui/page_info/page_info_ui.h"
|
||||||
#include "content/public/browser/web_contents_observer.h"
|
#include "content/public/browser/web_contents_observer.h"
|
||||||
|
|
||||||
class WebsiteSettingsUIBridge;
|
class PageInfoUIBridge;
|
||||||
|
|
||||||
namespace content {
|
namespace content {
|
||||||
class WebContents;
|
class WebContents;
|
||||||
@@ -31,10 +31,7 @@ struct SecurityInfo;
|
|||||||
|
|
||||||
// This NSWindowController subclass manages the InfoBubbleWindow and view that
|
// This NSWindowController subclass manages the InfoBubbleWindow and view that
|
||||||
// are displayed when the user clicks the favicon or security lock icon.
|
// are displayed when the user clicks the favicon or security lock icon.
|
||||||
//
|
@interface PageInfoBubbleController : OmniboxDecorationBubbleController {
|
||||||
// TODO(palmer): Normalize all WebsiteSettings*, SiteSettings*, PageInfo*, et c.
|
|
||||||
// to OriginInfo*.
|
|
||||||
@interface WebsiteSettingsBubbleController : OmniboxDecorationBubbleController {
|
|
||||||
@private
|
@private
|
||||||
content::WebContents* webContents_;
|
content::WebContents* webContents_;
|
||||||
|
|
||||||
@@ -92,20 +89,20 @@ struct SecurityInfo;
|
|||||||
|
|
||||||
// The UI translates user actions to specific events and forwards them to the
|
// The UI translates user actions to specific events and forwards them to the
|
||||||
// |presenter_|. The |presenter_| handles these events and updates the UI.
|
// |presenter_|. The |presenter_| handles these events and updates the UI.
|
||||||
std::unique_ptr<WebsiteSettings> presenter_;
|
std::unique_ptr<PageInfo> presenter_;
|
||||||
|
|
||||||
// Bridge which implements the WebsiteSettingsUI interface and forwards
|
// Bridge which implements the PageInfoUI interface and forwards
|
||||||
// methods on to this class.
|
// methods on to this class.
|
||||||
std::unique_ptr<WebsiteSettingsUIBridge> bridge_;
|
std::unique_ptr<PageInfoUIBridge> bridge_;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Designated initializer. The controller will release itself when the bubble
|
// Designated initializer. The controller will release itself when the bubble
|
||||||
// is closed. |parentWindow| cannot be nil. |webContents| may be nil for
|
// is closed. |parentWindow| cannot be nil. |webContents| may be nil for
|
||||||
// testing purposes.
|
// testing purposes.
|
||||||
- (id)initWithParentWindow:(NSWindow*)parentWindow
|
- (id)initWithParentWindow:(NSWindow*)parentWindow
|
||||||
websiteSettingsUIBridge:(WebsiteSettingsUIBridge*)bridge
|
pageInfoUIBridge:(PageInfoUIBridge*)bridge
|
||||||
webContents:(content::WebContents*)webContents
|
webContents:(content::WebContents*)webContents
|
||||||
url:(const GURL&)url;
|
url:(const GURL&)url;
|
||||||
|
|
||||||
// Return the default width of the window. It may be wider to fit the content.
|
// Return the default width of the window. It may be wider to fit the content.
|
||||||
// This may be overriden by a subclass for testing purposes.
|
// This may be overriden by a subclass for testing purposes.
|
||||||
@@ -113,15 +110,15 @@ struct SecurityInfo;
|
|||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
// Provides a bridge between the WebSettingsUI C++ interface and the Cocoa
|
// Provides a bridge between the PageInfoUI C++ interface and the Cocoa
|
||||||
// implementation in WebsiteSettingsBubbleController.
|
// implementation in PageInfoBubbleController.
|
||||||
class WebsiteSettingsUIBridge : public content::WebContentsObserver,
|
class PageInfoUIBridge : public content::WebContentsObserver,
|
||||||
public WebsiteSettingsUI {
|
public PageInfoUI {
|
||||||
public:
|
public:
|
||||||
explicit WebsiteSettingsUIBridge(content::WebContents* web_contents);
|
explicit PageInfoUIBridge(content::WebContents* web_contents);
|
||||||
~WebsiteSettingsUIBridge() override;
|
~PageInfoUIBridge() override;
|
||||||
|
|
||||||
// Creates a |WebsiteSettingsBubbleController| and displays the UI. |parent|
|
// Creates a |PageInfoBubbleController| and displays the UI. |parent|
|
||||||
// is the currently active window. |profile| points to the currently active
|
// is the currently active window. |profile| points to the currently active
|
||||||
// profile. |web_contents| points to the WebContents that wraps the currently
|
// profile. |web_contents| points to the WebContents that wraps the currently
|
||||||
// active tab. |virtual_url| is the virtual GURL of the currently active
|
// active tab. |virtual_url| is the virtual GURL of the currently active
|
||||||
@@ -133,13 +130,12 @@ class WebsiteSettingsUIBridge : public content::WebContentsObserver,
|
|||||||
const GURL& virtual_url,
|
const GURL& virtual_url,
|
||||||
const security_state::SecurityInfo& security_info);
|
const security_state::SecurityInfo& security_info);
|
||||||
|
|
||||||
void set_bubble_controller(
|
void set_bubble_controller(PageInfoBubbleController* bubble_controller);
|
||||||
WebsiteSettingsBubbleController* bubble_controller);
|
|
||||||
|
|
||||||
// WebContentsObserver implementation.
|
// WebContentsObserver implementation.
|
||||||
void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override;
|
void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override;
|
||||||
|
|
||||||
// WebsiteSettingsUI implementations.
|
// PageInfoUI implementations.
|
||||||
void SetCookieInfo(const CookieInfoList& cookie_info_list) override;
|
void SetCookieInfo(const CookieInfoList& cookie_info_list) override;
|
||||||
void SetPermissionInfo(const PermissionInfoList& permission_info_list,
|
void SetPermissionInfo(const PermissionInfoList& permission_info_list,
|
||||||
ChosenObjectInfoList chosen_object_info_list) override;
|
ChosenObjectInfoList chosen_object_info_list) override;
|
||||||
@@ -150,9 +146,9 @@ class WebsiteSettingsUIBridge : public content::WebContentsObserver,
|
|||||||
content::WebContents* web_contents_;
|
content::WebContents* web_contents_;
|
||||||
|
|
||||||
// The Cocoa controller for the bubble UI.
|
// The Cocoa controller for the bubble UI.
|
||||||
WebsiteSettingsBubbleController* bubble_controller_;
|
PageInfoBubbleController* bubble_controller_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsUIBridge);
|
DISALLOW_COPY_AND_ASSIGN(PageInfoUIBridge);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CHROME_BROWSER_UI_COCOA_WEBSITE_SETTINGS_WEBSITE_SETTINGS_BUBBLE_CONTROLLER_H_
|
#endif // CHROME_BROWSER_UI_COCOA_PAGE_INFO_PAGE_INFO_BUBBLE_CONTROLLER_H_
|
@@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#import "chrome/browser/ui/cocoa/page_info/website_settings_bubble_controller.h"
|
#import "chrome/browser/ui/cocoa/page_info/page_info_bubble_controller.h"
|
||||||
|
|
||||||
#import <AppKit/AppKit.h>
|
#import <AppKit/AppKit.h>
|
||||||
|
|
||||||
@@ -49,10 +49,9 @@
|
|||||||
#include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
|
#include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
|
||||||
#include "ui/resources/grit/ui_resources.h"
|
#include "ui/resources/grit/ui_resources.h"
|
||||||
|
|
||||||
using ChosenObjectInfoPtr =
|
using ChosenObjectInfoPtr = std::unique_ptr<PageInfoUI::ChosenObjectInfo>;
|
||||||
std::unique_ptr<WebsiteSettingsUI::ChosenObjectInfo>;
|
|
||||||
using ChosenObjectDeleteCallback =
|
using ChosenObjectDeleteCallback =
|
||||||
base::Callback<void(const WebsiteSettingsUI::ChosenObjectInfo&)>;
|
base::Callback<void(const PageInfoUI::ChosenObjectInfo&)>;
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
@@ -113,9 +112,9 @@ const CGFloat kInternalPageImageSpacing = 10;
|
|||||||
|
|
||||||
// -----------------------------------------------------------------------------
|
// -----------------------------------------------------------------------------
|
||||||
|
|
||||||
// NOTE: This assumes that there will never be more than one website settings
|
// NOTE: This assumes that there will never be more than one page info
|
||||||
// popup shown, and that the one that is shown is associated with the current
|
// popup shown, and that the one that is shown is associated with the current
|
||||||
// window. This matches the behaviour in views: see WebsiteSettingsPopupView.
|
// window. This matches the behaviour in views: see PageInfoPopupView.
|
||||||
bool g_is_popup_showing = false;
|
bool g_is_popup_showing = false;
|
||||||
|
|
||||||
// Takes in the parent window, which should be a BrowserWindow, and gets the
|
// Takes in the parent window, which should be a BrowserWindow, and gets the
|
||||||
@@ -181,7 +180,7 @@ NSPoint AnchorPointForWindow(NSWindow* parent) {
|
|||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation WebsiteSettingsBubbleController
|
@implementation PageInfoBubbleController
|
||||||
|
|
||||||
- (CGFloat)defaultWindowWidth {
|
- (CGFloat)defaultWindowWidth {
|
||||||
return kDefaultWindowWidth;
|
return kDefaultWindowWidth;
|
||||||
@@ -195,9 +194,9 @@ bool IsInternalURL(const GURL& url) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
- (id)initWithParentWindow:(NSWindow*)parentWindow
|
- (id)initWithParentWindow:(NSWindow*)parentWindow
|
||||||
websiteSettingsUIBridge:(WebsiteSettingsUIBridge*)bridge
|
pageInfoUIBridge:(PageInfoUIBridge*)bridge
|
||||||
webContents:(content::WebContents*)webContents
|
webContents:(content::WebContents*)webContents
|
||||||
url:(const GURL&)url {
|
url:(const GURL&)url {
|
||||||
DCHECK(parentWindow);
|
DCHECK(parentWindow);
|
||||||
|
|
||||||
webContents_ = webContents;
|
webContents_ = webContents;
|
||||||
@@ -255,7 +254,7 @@ bool IsInternalURL(const GURL& url) {
|
|||||||
[super windowWillClose:notification];
|
[super windowWillClose:notification];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setPresenter:(WebsiteSettings*)presenter {
|
- (void)setPresenter:(PageInfo*)presenter {
|
||||||
presenter_.reset(presenter);
|
presenter_.reset(presenter);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -311,7 +310,7 @@ bool IsInternalURL(const GURL& url) {
|
|||||||
[self sizeAndPositionWindow];
|
[self sizeAndPositionWindow];
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the subviews for the website settings bubble.
|
// Create the subviews for the page info bubble.
|
||||||
- (void)initializeContents {
|
- (void)initializeContents {
|
||||||
securitySectionView_ = [self addSecuritySectionToView:contentView_];
|
securitySectionView_ = [self addSecuritySectionToView:contentView_];
|
||||||
separatorAfterSecuritySection_ = [self addSeparatorToView:contentView_];
|
separatorAfterSecuritySection_ = [self addSeparatorToView:contentView_];
|
||||||
@@ -393,8 +392,7 @@ bool IsInternalURL(const GURL& url) {
|
|||||||
- (void)showCookiesAndSiteData:(id)sender {
|
- (void)showCookiesAndSiteData:(id)sender {
|
||||||
DCHECK(webContents_);
|
DCHECK(webContents_);
|
||||||
DCHECK(presenter_);
|
DCHECK(presenter_);
|
||||||
presenter_->RecordWebsiteSettingsAction(
|
presenter_->RecordPageInfoAction(PageInfo::PAGE_INFO_COOKIES_DIALOG_OPENED);
|
||||||
WebsiteSettings::WEBSITE_SETTINGS_COOKIES_DIALOG_OPENED);
|
|
||||||
TabDialogs::FromWebContents(webContents_)->ShowCollectedCookies();
|
TabDialogs::FromWebContents(webContents_)->ShowCollectedCookies();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -402,8 +400,7 @@ bool IsInternalURL(const GURL& url) {
|
|||||||
- (void)showSiteSettingsData:(id)sender {
|
- (void)showSiteSettingsData:(id)sender {
|
||||||
DCHECK(webContents_);
|
DCHECK(webContents_);
|
||||||
DCHECK(presenter_);
|
DCHECK(presenter_);
|
||||||
presenter_->RecordWebsiteSettingsAction(
|
presenter_->RecordPageInfoAction(PageInfo::PAGE_INFO_SITE_SETTINGS_OPENED);
|
||||||
WebsiteSettings::WEBSITE_SETTINGS_SITE_SETTINGS_OPENED);
|
|
||||||
webContents_->OpenURL(content::OpenURLParams(
|
webContents_->OpenURL(content::OpenURLParams(
|
||||||
GURL(chrome::kChromeUIContentSettingsURL), content::Referrer(),
|
GURL(chrome::kChromeUIContentSettingsURL), content::Referrer(),
|
||||||
WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK,
|
WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK,
|
||||||
@@ -415,8 +412,7 @@ bool IsInternalURL(const GURL& url) {
|
|||||||
- (void)openConnectionHelp:(id)sender {
|
- (void)openConnectionHelp:(id)sender {
|
||||||
DCHECK(webContents_);
|
DCHECK(webContents_);
|
||||||
DCHECK(presenter_);
|
DCHECK(presenter_);
|
||||||
presenter_->RecordWebsiteSettingsAction(
|
presenter_->RecordPageInfoAction(PageInfo::PAGE_INFO_CONNECTION_HELP_OPENED);
|
||||||
WebsiteSettings::WEBSITE_SETTINGS_CONNECTION_HELP_OPENED);
|
|
||||||
webContents_->OpenURL(content::OpenURLParams(
|
webContents_->OpenURL(content::OpenURLParams(
|
||||||
GURL(chrome::kPageInfoHelpCenterURL), content::Referrer(),
|
GURL(chrome::kPageInfoHelpCenterURL), content::Referrer(),
|
||||||
WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK,
|
WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK,
|
||||||
@@ -427,8 +423,8 @@ bool IsInternalURL(const GURL& url) {
|
|||||||
- (void)showCertificateInfo:(id)sender {
|
- (void)showCertificateInfo:(id)sender {
|
||||||
DCHECK(certificate_.get());
|
DCHECK(certificate_.get());
|
||||||
DCHECK(presenter_);
|
DCHECK(presenter_);
|
||||||
presenter_->RecordWebsiteSettingsAction(
|
presenter_->RecordPageInfoAction(
|
||||||
WebsiteSettings::WEBSITE_SETTINGS_CERTIFICATE_DIALOG_OPENED);
|
PageInfo::PAGE_INFO_CERTIFICATE_DIALOG_OPENED);
|
||||||
ShowCertificateViewer(webContents_, [self parentWindow], certificate_.get());
|
ShowCertificateViewer(webContents_, [self parentWindow], certificate_.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -687,8 +683,8 @@ bool IsInternalURL(const GURL& url) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set the content of the identity and identity status fields.
|
// Set the content of the identity and identity status fields.
|
||||||
- (void)setIdentityInfo:(const WebsiteSettingsUI::IdentityInfo&)identityInfo {
|
- (void)setIdentityInfo:(const PageInfoUI::IdentityInfo&)identityInfo {
|
||||||
std::unique_ptr<WebsiteSettingsUI::SecurityDescription> security_description =
|
std::unique_ptr<PageInfoUI::SecurityDescription> security_description =
|
||||||
identityInfo.GetSecurityDescription();
|
identityInfo.GetSecurityDescription();
|
||||||
[securitySummaryField_
|
[securitySummaryField_
|
||||||
setStringValue:base::SysUTF16ToNSString(security_description->summary)];
|
setStringValue:base::SysUTF16ToNSString(security_description->summary)];
|
||||||
@@ -724,13 +720,13 @@ bool IsInternalURL(const GURL& url) {
|
|||||||
|
|
||||||
// Add a pop-up button for |permissionInfo| to the given view.
|
// Add a pop-up button for |permissionInfo| to the given view.
|
||||||
- (NSPopUpButton*)addPopUpButtonForPermission:
|
- (NSPopUpButton*)addPopUpButtonForPermission:
|
||||||
(const WebsiteSettingsUI::PermissionInfo&)permissionInfo
|
(const PageInfoUI::PermissionInfo&)permissionInfo
|
||||||
toView:(NSView*)view
|
toView:(NSView*)view
|
||||||
atPoint:(NSPoint)point {
|
atPoint:(NSPoint)point {
|
||||||
GURL url = webContents_ ? webContents_->GetURL() : GURL();
|
GURL url = webContents_ ? webContents_->GetURL() : GURL();
|
||||||
__block WebsiteSettingsBubbleController* weakSelf = self;
|
__block PageInfoBubbleController* weakSelf = self;
|
||||||
PermissionMenuModel::ChangeCallback callback =
|
PermissionMenuModel::ChangeCallback callback =
|
||||||
base::BindBlock(^(const WebsiteSettingsUI::PermissionInfo& permission) {
|
base::BindBlock(^(const PageInfoUI::PermissionInfo& permission) {
|
||||||
[weakSelf onPermissionChanged:permission.type to:permission.setting];
|
[weakSelf onPermissionChanged:permission.type to:permission.setting];
|
||||||
});
|
});
|
||||||
base::scoped_nsobject<PermissionSelectorButton> button(
|
base::scoped_nsobject<PermissionSelectorButton> button(
|
||||||
@@ -760,9 +756,9 @@ bool IsInternalURL(const GURL& url) {
|
|||||||
- (NSButton*)addDeleteButtonForChosenObject:(ChosenObjectInfoPtr)objectInfo
|
- (NSButton*)addDeleteButtonForChosenObject:(ChosenObjectInfoPtr)objectInfo
|
||||||
toView:(NSView*)view
|
toView:(NSView*)view
|
||||||
atPoint:(NSPoint)point {
|
atPoint:(NSPoint)point {
|
||||||
__block WebsiteSettingsBubbleController* weakSelf = self;
|
__block PageInfoBubbleController* weakSelf = self;
|
||||||
auto callback =
|
auto callback =
|
||||||
base::BindBlock(^(const WebsiteSettingsUI::ChosenObjectInfo& objectInfo) {
|
base::BindBlock(^(const PageInfoUI::ChosenObjectInfo& objectInfo) {
|
||||||
[weakSelf onChosenObjectDeleted:objectInfo];
|
[weakSelf onChosenObjectDeleted:objectInfo];
|
||||||
});
|
});
|
||||||
base::scoped_nsobject<ChosenObjectDeleteButton> button(
|
base::scoped_nsobject<ChosenObjectDeleteButton> button(
|
||||||
@@ -789,7 +785,7 @@ bool IsInternalURL(const GURL& url) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Called when the user revokes permission for a previously chosen object.
|
// Called when the user revokes permission for a previously chosen object.
|
||||||
- (void)onChosenObjectDeleted:(const WebsiteSettingsUI::ChosenObjectInfo&)info {
|
- (void)onChosenObjectDeleted:(const PageInfoUI::ChosenObjectInfo&)info {
|
||||||
if (presenter_)
|
if (presenter_)
|
||||||
presenter_->OnSiteChosenObjectDeleted(info.ui_info, *info.object);
|
presenter_->OnSiteChosenObjectDeleted(info.ui_info, *info.object);
|
||||||
}
|
}
|
||||||
@@ -797,16 +793,14 @@ bool IsInternalURL(const GURL& url) {
|
|||||||
// Adds a new row to the UI listing the permissions. Returns the NSPoint of the
|
// Adds a new row to the UI listing the permissions. Returns the NSPoint of the
|
||||||
// last UI element added (either the permission button, in LTR, or the text
|
// last UI element added (either the permission button, in LTR, or the text
|
||||||
// label, in RTL).
|
// label, in RTL).
|
||||||
- (NSPoint)addPermission:
|
- (NSPoint)addPermission:(const PageInfoUI::PermissionInfo&)permissionInfo
|
||||||
(const WebsiteSettingsUI::PermissionInfo&)permissionInfo
|
|
||||||
toView:(NSView*)view
|
toView:(NSView*)view
|
||||||
atPoint:(NSPoint)point {
|
atPoint:(NSPoint)point {
|
||||||
base::string16 labelText =
|
base::string16 labelText =
|
||||||
WebsiteSettingsUI::PermissionTypeToUIString(permissionInfo.type);
|
PageInfoUI::PermissionTypeToUIString(permissionInfo.type);
|
||||||
bool isRTL = base::i18n::IsRTL();
|
bool isRTL = base::i18n::IsRTL();
|
||||||
base::scoped_nsobject<NSImage> image(
|
base::scoped_nsobject<NSImage> image(
|
||||||
[WebsiteSettingsUI::GetPermissionIcon(permissionInfo)
|
[PageInfoUI::GetPermissionIcon(permissionInfo).ToNSImage() retain]);
|
||||||
.ToNSImage() retain]);
|
|
||||||
|
|
||||||
NSPoint position;
|
NSPoint position;
|
||||||
NSImageView* imageView;
|
NSImageView* imageView;
|
||||||
@@ -918,11 +912,10 @@ bool IsInternalURL(const GURL& url) {
|
|||||||
atPoint:(NSPoint)point {
|
atPoint:(NSPoint)point {
|
||||||
base::string16 labelText = l10n_util::GetStringFUTF16(
|
base::string16 labelText = l10n_util::GetStringFUTF16(
|
||||||
objectInfo->ui_info.label_string_id,
|
objectInfo->ui_info.label_string_id,
|
||||||
WebsiteSettingsUI::ChosenObjectToUIString(*objectInfo));
|
PageInfoUI::ChosenObjectToUIString(*objectInfo));
|
||||||
bool isRTL = base::i18n::IsRTL();
|
bool isRTL = base::i18n::IsRTL();
|
||||||
base::scoped_nsobject<NSImage> image(
|
base::scoped_nsobject<NSImage> image(
|
||||||
[WebsiteSettingsUI::GetChosenObjectIcon(*objectInfo, false)
|
[PageInfoUI::GetChosenObjectIcon(*objectInfo, false).ToNSImage() retain]);
|
||||||
.ToNSImage() retain]);
|
|
||||||
|
|
||||||
NSPoint position;
|
NSPoint position;
|
||||||
NSImageView* imageView;
|
NSImageView* imageView;
|
||||||
@@ -1010,11 +1003,11 @@ bool IsInternalURL(const GURL& url) {
|
|||||||
for (const auto& i : cookieInfoList) {
|
for (const auto& i : cookieInfoList) {
|
||||||
totalAllowed += i.allowed;
|
totalAllowed += i.allowed;
|
||||||
}
|
}
|
||||||
base::string16 label_text = l10n_util::GetPluralStringFUTF16(
|
base::string16 label_text =
|
||||||
IDS_WEBSITE_SETTINGS_NUM_COOKIES, totalAllowed);
|
l10n_util::GetPluralStringFUTF16(IDS_PAGE_INFO_NUM_COOKIES, totalAllowed);
|
||||||
|
|
||||||
base::string16 sectionTitle =
|
base::string16 sectionTitle =
|
||||||
l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_TITLE_SITE_DATA);
|
l10n_util::GetStringUTF16(IDS_PAGE_INFO_TITLE_SITE_DATA);
|
||||||
bool isRTL = base::i18n::IsRTL();
|
bool isRTL = base::i18n::IsRTL();
|
||||||
|
|
||||||
[cookiesView_ setSubviews:[NSArray array]];
|
[cookiesView_ setSubviews:[NSArray array]];
|
||||||
@@ -1028,12 +1021,12 @@ bool IsInternalURL(const GURL& url) {
|
|||||||
kPermissionImageSpacing - kSectionHorizontalPadding;
|
kPermissionImageSpacing - kSectionHorizontalPadding;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebsiteSettingsUI::PermissionInfo info;
|
PageInfoUI::PermissionInfo info;
|
||||||
info.type = CONTENT_SETTINGS_TYPE_COOKIES;
|
info.type = CONTENT_SETTINGS_TYPE_COOKIES;
|
||||||
info.setting = CONTENT_SETTING_ALLOW;
|
info.setting = CONTENT_SETTING_ALLOW;
|
||||||
// info.default_setting, info.source, and info.is_incognito have not been set,
|
// info.default_setting, info.source, and info.is_incognito have not been set,
|
||||||
// but GetPermissionIcon doesn't use any of those.
|
// but GetPermissionIcon doesn't use any of those.
|
||||||
NSImage* image = WebsiteSettingsUI::GetPermissionIcon(info).ToNSImage();
|
NSImage* image = PageInfoUI::GetPermissionIcon(info).ToNSImage();
|
||||||
NSImageView* imageView = [self addImageWithSize:[image size]
|
NSImageView* imageView = [self addImageWithSize:[image size]
|
||||||
toView:cookiesView_
|
toView:cookiesView_
|
||||||
atPoint:controlOrigin];
|
atPoint:controlOrigin];
|
||||||
@@ -1099,7 +1092,7 @@ bool IsInternalURL(const GURL& url) {
|
|||||||
|
|
||||||
if (permissionInfoList.size() > 0 || chosenObjectInfoList.size() > 0) {
|
if (permissionInfoList.size() > 0 || chosenObjectInfoList.size() > 0) {
|
||||||
base::string16 sectionTitle =
|
base::string16 sectionTitle =
|
||||||
l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_TITLE_SITE_PERMISSIONS);
|
l10n_util::GetStringUTF16(IDS_PAGE_INFO_TITLE_SITE_PERMISSIONS);
|
||||||
|
|
||||||
for (const auto& permission : permissionInfoList) {
|
for (const auto& permission : permissionInfoList) {
|
||||||
controlOrigin.y += kPermissionsVerticalSpacing;
|
controlOrigin.y += kPermissionsVerticalSpacing;
|
||||||
@@ -1127,8 +1120,7 @@ bool IsInternalURL(const GURL& url) {
|
|||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
WebsiteSettingsUIBridge::WebsiteSettingsUIBridge(
|
PageInfoUIBridge::PageInfoUIBridge(content::WebContents* web_contents)
|
||||||
content::WebContents* web_contents)
|
|
||||||
: content::WebContentsObserver(web_contents),
|
: content::WebContentsObserver(web_contents),
|
||||||
web_contents_(web_contents),
|
web_contents_(web_contents),
|
||||||
bubble_controller_(nil) {
|
bubble_controller_(nil) {
|
||||||
@@ -1136,24 +1128,23 @@ WebsiteSettingsUIBridge::WebsiteSettingsUIBridge(
|
|||||||
g_is_popup_showing = true;
|
g_is_popup_showing = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebsiteSettingsUIBridge::~WebsiteSettingsUIBridge() {
|
PageInfoUIBridge::~PageInfoUIBridge() {
|
||||||
DCHECK(g_is_popup_showing);
|
DCHECK(g_is_popup_showing);
|
||||||
g_is_popup_showing = false;
|
g_is_popup_showing = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettingsUIBridge::set_bubble_controller(
|
void PageInfoUIBridge::set_bubble_controller(
|
||||||
WebsiteSettingsBubbleController* controller) {
|
PageInfoBubbleController* controller) {
|
||||||
bubble_controller_ = controller;
|
bubble_controller_ = controller;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettingsUIBridge::Show(
|
void PageInfoUIBridge::Show(gfx::NativeWindow parent,
|
||||||
gfx::NativeWindow parent,
|
Profile* profile,
|
||||||
Profile* profile,
|
content::WebContents* web_contents,
|
||||||
content::WebContents* web_contents,
|
const GURL& virtual_url,
|
||||||
const GURL& virtual_url,
|
const security_state::SecurityInfo& security_info) {
|
||||||
const security_state::SecurityInfo& security_info) {
|
|
||||||
if (ui::MaterialDesignController::IsSecondaryUiMaterial()) {
|
if (ui::MaterialDesignController::IsSecondaryUiMaterial()) {
|
||||||
chrome::ShowWebsiteSettingsBubbleViewsAtPoint(
|
chrome::ShowPageInfoBubbleViewsAtPoint(
|
||||||
gfx::ScreenPointFromNSPoint(AnchorPointForWindow(parent)), profile,
|
gfx::ScreenPointFromNSPoint(AnchorPointForWindow(parent)), profile,
|
||||||
web_contents, virtual_url, security_info);
|
web_contents, virtual_url, security_info);
|
||||||
return;
|
return;
|
||||||
@@ -1166,47 +1157,46 @@ void WebsiteSettingsUIBridge::Show(
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// Create the bridge. This will be owned by the bubble controller.
|
// Create the bridge. This will be owned by the bubble controller.
|
||||||
WebsiteSettingsUIBridge* bridge = new WebsiteSettingsUIBridge(web_contents);
|
PageInfoUIBridge* bridge = new PageInfoUIBridge(web_contents);
|
||||||
|
|
||||||
// Create the bubble controller. It will dealloc itself when it closes,
|
// Create the bubble controller. It will dealloc itself when it closes,
|
||||||
// resetting |g_is_popup_showing|.
|
// resetting |g_is_popup_showing|.
|
||||||
WebsiteSettingsBubbleController* bubble_controller = [
|
PageInfoBubbleController* bubble_controller =
|
||||||
[WebsiteSettingsBubbleController alloc] initWithParentWindow:parent
|
[[PageInfoBubbleController alloc] initWithParentWindow:parent
|
||||||
websiteSettingsUIBridge:bridge
|
pageInfoUIBridge:bridge
|
||||||
webContents:web_contents
|
webContents:web_contents
|
||||||
url:virtual_url];
|
url:virtual_url];
|
||||||
|
|
||||||
if (!IsInternalURL(virtual_url)) {
|
if (!IsInternalURL(virtual_url)) {
|
||||||
// Initialize the presenter, which holds the model and controls the UI.
|
// Initialize the presenter, which holds the model and controls the UI.
|
||||||
// This is also owned by the bubble controller.
|
// This is also owned by the bubble controller.
|
||||||
WebsiteSettings* presenter = new WebsiteSettings(
|
PageInfo* presenter =
|
||||||
bridge, profile,
|
new PageInfo(bridge, profile,
|
||||||
TabSpecificContentSettings::FromWebContents(web_contents), web_contents,
|
TabSpecificContentSettings::FromWebContents(web_contents),
|
||||||
virtual_url, security_info);
|
web_contents, virtual_url, security_info);
|
||||||
[bubble_controller setPresenter:presenter];
|
[bubble_controller setPresenter:presenter];
|
||||||
}
|
}
|
||||||
|
|
||||||
[bubble_controller showWindow:nil];
|
[bubble_controller showWindow:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettingsUIBridge::SetIdentityInfo(
|
void PageInfoUIBridge::SetIdentityInfo(
|
||||||
const WebsiteSettingsUI::IdentityInfo& identity_info) {
|
const PageInfoUI::IdentityInfo& identity_info) {
|
||||||
[bubble_controller_ setIdentityInfo:identity_info];
|
[bubble_controller_ setIdentityInfo:identity_info];
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettingsUIBridge::RenderFrameDeleted(
|
void PageInfoUIBridge::RenderFrameDeleted(
|
||||||
content::RenderFrameHost* render_frame_host) {
|
content::RenderFrameHost* render_frame_host) {
|
||||||
if (render_frame_host == web_contents_->GetMainFrame()) {
|
if (render_frame_host == web_contents_->GetMainFrame()) {
|
||||||
[bubble_controller_ close];
|
[bubble_controller_ close];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettingsUIBridge::SetCookieInfo(
|
void PageInfoUIBridge::SetCookieInfo(const CookieInfoList& cookie_info_list) {
|
||||||
const CookieInfoList& cookie_info_list) {
|
|
||||||
[bubble_controller_ setCookieInfo:cookie_info_list];
|
[bubble_controller_ setCookieInfo:cookie_info_list];
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettingsUIBridge::SetPermissionInfo(
|
void PageInfoUIBridge::SetPermissionInfo(
|
||||||
const PermissionInfoList& permission_info_list,
|
const PermissionInfoList& permission_info_list,
|
||||||
ChosenObjectInfoList chosen_object_info_list) {
|
ChosenObjectInfoList chosen_object_info_list) {
|
||||||
[bubble_controller_ setPermissionInfo:permission_info_list
|
[bubble_controller_ setPermissionInfo:permission_info_list
|
@@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#import "chrome/browser/ui/cocoa/page_info/website_settings_bubble_controller.h"
|
#import "chrome/browser/ui/cocoa/page_info/page_info_bubble_controller.h"
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
@@ -16,13 +16,13 @@
|
|||||||
#include "net/test/test_certificate_data.h"
|
#include "net/test/test_certificate_data.h"
|
||||||
#include "testing/gtest_mac.h"
|
#include "testing/gtest_mac.h"
|
||||||
|
|
||||||
@interface WebsiteSettingsBubbleController (ExposedForTesting)
|
@interface PageInfoBubbleController (ExposedForTesting)
|
||||||
- (NSView*)permissionsView;
|
- (NSView*)permissionsView;
|
||||||
- (NSButton*)resetDecisionsButton;
|
- (NSButton*)resetDecisionsButton;
|
||||||
- (NSButton*)connectionHelpButton;
|
- (NSButton*)connectionHelpButton;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation WebsiteSettingsBubbleController (ExposedForTesting)
|
@implementation PageInfoBubbleController (ExposedForTesting)
|
||||||
- (NSView*)permissionsView {
|
- (NSView*)permissionsView {
|
||||||
return permissionsView_;
|
return permissionsView_;
|
||||||
}
|
}
|
||||||
@@ -34,14 +34,13 @@
|
|||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@interface WebsiteSettingsBubbleControllerForTesting
|
@interface PageInfoBubbleControllerForTesting : PageInfoBubbleController {
|
||||||
: WebsiteSettingsBubbleController {
|
|
||||||
@private
|
@private
|
||||||
CGFloat defaultWindowWidth_;
|
CGFloat defaultWindowWidth_;
|
||||||
}
|
}
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation WebsiteSettingsBubbleControllerForTesting
|
@implementation PageInfoBubbleControllerForTesting
|
||||||
- (void)setDefaultWindowWidth:(CGFloat)width {
|
- (void)setDefaultWindowWidth:(CGFloat)width {
|
||||||
defaultWindowWidth_ = width;
|
defaultWindowWidth_ = width;
|
||||||
}
|
}
|
||||||
@@ -83,9 +82,9 @@ const content_settings::SettingSource kTestSettingSources[] = {
|
|||||||
content_settings::SETTING_SOURCE_POLICY,
|
content_settings::SETTING_SOURCE_POLICY,
|
||||||
content_settings::SETTING_SOURCE_EXTENSION};
|
content_settings::SETTING_SOURCE_EXTENSION};
|
||||||
|
|
||||||
class WebsiteSettingsBubbleControllerTest : public CocoaTest {
|
class PageInfoBubbleControllerTest : public CocoaTest {
|
||||||
public:
|
public:
|
||||||
WebsiteSettingsBubbleControllerTest() { controller_ = nil; }
|
PageInfoBubbleControllerTest() { controller_ = nil; }
|
||||||
|
|
||||||
void TearDown() override {
|
void TearDown() override {
|
||||||
[controller_ close];
|
[controller_ close];
|
||||||
@@ -93,23 +92,23 @@ class WebsiteSettingsBubbleControllerTest : public CocoaTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
WebsiteSettingsUIBridge* bridge_; // Weak, owned by controller.
|
PageInfoUIBridge* bridge_; // Weak, owned by controller.
|
||||||
|
|
||||||
enum MatchType { TEXT_EQUAL = 0, TEXT_NOT_EQUAL };
|
enum MatchType { TEXT_EQUAL = 0, TEXT_NOT_EQUAL };
|
||||||
|
|
||||||
// Creates a new website settings bubble, with the given default width.
|
// Creates a new page info bubble, with the given default width.
|
||||||
// If |default_width| is 0, the *default* default width will be used.
|
// If |default_width| is 0, the *default* default width will be used.
|
||||||
void CreateBubbleWithWidth(CGFloat default_width) {
|
void CreateBubbleWithWidth(CGFloat default_width) {
|
||||||
bridge_ = new WebsiteSettingsUIBridge(nullptr);
|
bridge_ = new PageInfoUIBridge(nullptr);
|
||||||
|
|
||||||
// The controller cleans up after itself when the window closes.
|
// The controller cleans up after itself when the window closes.
|
||||||
controller_ = [WebsiteSettingsBubbleControllerForTesting alloc];
|
controller_ = [PageInfoBubbleControllerForTesting alloc];
|
||||||
[controller_ setDefaultWindowWidth:default_width];
|
[controller_ setDefaultWindowWidth:default_width];
|
||||||
[controller_ initWithParentWindow:test_window()
|
[controller_
|
||||||
websiteSettingsUIBridge:bridge_
|
initWithParentWindow:test_window()
|
||||||
webContents:web_contents_factory_.CreateWebContents(
|
pageInfoUIBridge:bridge_
|
||||||
&profile_)
|
webContents:web_contents_factory_.CreateWebContents(&profile_)
|
||||||
url:GURL("https://www.google.com")];
|
url:GURL("https://www.google.com")];
|
||||||
window_ = [controller_ window];
|
window_ = [controller_ window];
|
||||||
[controller_ showWindow:nil];
|
[controller_ showWindow:nil];
|
||||||
}
|
}
|
||||||
@@ -162,7 +161,7 @@ class WebsiteSettingsBubbleControllerTest : public CocoaTest {
|
|||||||
// - [allow, block, ask] by default
|
// - [allow, block, ask] by default
|
||||||
// - [block, allow] * [by user, by policy, by extension]
|
// - [block, allow] * [by user, by policy, by extension]
|
||||||
PermissionInfoList permission_info_list;
|
PermissionInfoList permission_info_list;
|
||||||
WebsiteSettingsUI::PermissionInfo info;
|
PageInfoUI::PermissionInfo info;
|
||||||
for (size_t i = 0; i < arraysize(kTestPermissionTypes); ++i) {
|
for (size_t i = 0; i < arraysize(kTestPermissionTypes); ++i) {
|
||||||
info.type = kTestPermissionTypes[i];
|
info.type = kTestPermissionTypes[i];
|
||||||
info.setting = kTestSettings[i];
|
info.setting = kTestSettings[i];
|
||||||
@@ -181,33 +180,33 @@ class WebsiteSettingsBubbleControllerTest : public CocoaTest {
|
|||||||
TestingProfile profile_;
|
TestingProfile profile_;
|
||||||
content::TestWebContentsFactory web_contents_factory_;
|
content::TestWebContentsFactory web_contents_factory_;
|
||||||
|
|
||||||
WebsiteSettingsBubbleControllerForTesting* controller_; // Weak, owns self.
|
PageInfoBubbleControllerForTesting* controller_; // Weak, owns self.
|
||||||
NSWindow* window_; // Weak, owned by controller.
|
NSWindow* window_; // Weak, owned by controller.
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST_F(WebsiteSettingsBubbleControllerTest, ConnectionHelpButton) {
|
TEST_F(PageInfoBubbleControllerTest, ConnectionHelpButton) {
|
||||||
WebsiteSettingsUI::IdentityInfo info;
|
PageInfoUI::IdentityInfo info;
|
||||||
info.site_identity = std::string("example.com");
|
info.site_identity = std::string("example.com");
|
||||||
info.identity_status = WebsiteSettings::SITE_IDENTITY_STATUS_UNKNOWN;
|
info.identity_status = PageInfo::SITE_IDENTITY_STATUS_UNKNOWN;
|
||||||
|
|
||||||
CreateBubble();
|
CreateBubble();
|
||||||
|
|
||||||
bridge_->SetIdentityInfo(const_cast<WebsiteSettingsUI::IdentityInfo&>(info));
|
bridge_->SetIdentityInfo(const_cast<PageInfoUI::IdentityInfo&>(info));
|
||||||
|
|
||||||
EXPECT_EQ([[controller_ connectionHelpButton] action],
|
EXPECT_EQ([[controller_ connectionHelpButton] action],
|
||||||
@selector(openConnectionHelp:));
|
@selector(openConnectionHelp:));
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(WebsiteSettingsBubbleControllerTest, ResetDecisionsButton) {
|
TEST_F(PageInfoBubbleControllerTest, ResetDecisionsButton) {
|
||||||
WebsiteSettingsUI::IdentityInfo info;
|
PageInfoUI::IdentityInfo info;
|
||||||
info.site_identity = std::string("example.com");
|
info.site_identity = std::string("example.com");
|
||||||
info.identity_status = WebsiteSettings::SITE_IDENTITY_STATUS_UNKNOWN;
|
info.identity_status = PageInfo::SITE_IDENTITY_STATUS_UNKNOWN;
|
||||||
|
|
||||||
CreateBubble();
|
CreateBubble();
|
||||||
|
|
||||||
// Set identity info, specifying that the button should not be shown.
|
// Set identity info, specifying that the button should not be shown.
|
||||||
info.show_ssl_decision_revoke_button = false;
|
info.show_ssl_decision_revoke_button = false;
|
||||||
bridge_->SetIdentityInfo(const_cast<WebsiteSettingsUI::IdentityInfo&>(info));
|
bridge_->SetIdentityInfo(const_cast<PageInfoUI::IdentityInfo&>(info));
|
||||||
EXPECT_EQ([controller_ resetDecisionsButton], nil);
|
EXPECT_EQ([controller_ resetDecisionsButton], nil);
|
||||||
|
|
||||||
// Set identity info, specifying that the button should be shown.
|
// Set identity info, specifying that the button should be shown.
|
||||||
@@ -215,7 +214,7 @@ TEST_F(WebsiteSettingsBubbleControllerTest, ResetDecisionsButton) {
|
|||||||
reinterpret_cast<const char*>(google_der), sizeof(google_der));
|
reinterpret_cast<const char*>(google_der), sizeof(google_der));
|
||||||
ASSERT_TRUE(info.certificate);
|
ASSERT_TRUE(info.certificate);
|
||||||
info.show_ssl_decision_revoke_button = true;
|
info.show_ssl_decision_revoke_button = true;
|
||||||
bridge_->SetIdentityInfo(const_cast<WebsiteSettingsUI::IdentityInfo&>(info));
|
bridge_->SetIdentityInfo(const_cast<PageInfoUI::IdentityInfo&>(info));
|
||||||
EXPECT_NE([controller_ resetDecisionsButton], nil);
|
EXPECT_NE([controller_ resetDecisionsButton], nil);
|
||||||
|
|
||||||
// Check that clicking the button calls the right selector.
|
// Check that clicking the button calls the right selector.
|
||||||
@@ -228,7 +227,7 @@ TEST_F(WebsiteSettingsBubbleControllerTest, ResetDecisionsButton) {
|
|||||||
// again.
|
// again.
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(WebsiteSettingsBubbleControllerTest, SetPermissionInfo) {
|
TEST_F(PageInfoBubbleControllerTest, SetPermissionInfo) {
|
||||||
CreateBubble();
|
CreateBubble();
|
||||||
SetTestPermissions();
|
SetTestPermissions();
|
||||||
|
|
||||||
@@ -264,7 +263,7 @@ TEST_F(WebsiteSettingsBubbleControllerTest, SetPermissionInfo) {
|
|||||||
EXPECT_EQ(3, disabled_count);
|
EXPECT_EQ(3, disabled_count);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(WebsiteSettingsBubbleControllerTest, WindowWidth) {
|
TEST_F(PageInfoBubbleControllerTest, WindowWidth) {
|
||||||
const CGFloat kBigEnoughBubbleWidth = 310;
|
const CGFloat kBigEnoughBubbleWidth = 310;
|
||||||
// Creating a window that should fit everything.
|
// Creating a window that should fit everything.
|
||||||
CreateBubbleWithWidth(kBigEnoughBubbleWidth);
|
CreateBubbleWithWidth(kBigEnoughBubbleWidth);
|
12
chrome/browser/ui/cocoa/page_info/page_info_utils_cocoa.h
Normal file
12
chrome/browser/ui/cocoa/page_info/page_info_utils_cocoa.h
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
// Copyright 2014 The Chromium Authors. All rights reserved.
|
||||||
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
|
// found in the LICENSE file.
|
||||||
|
|
||||||
|
#ifndef CHROME_BROWSER_UI_COCOA_PAGE_INFO_PAGE_INFO_UTILS_COCOA_H_
|
||||||
|
#define CHROME_BROWSER_UI_COCOA_PAGE_INFO_PAGE_INFO_UTILS_COCOA_H_
|
||||||
|
|
||||||
|
#import <Cocoa/Cocoa.h>
|
||||||
|
|
||||||
|
NSSize SizeForPageInfoButtonTitle(NSPopUpButton* button, NSString* title);
|
||||||
|
|
||||||
|
#endif // CHROME_BROWSER_UI_COCOA_PAGE_INFO_PAGE_INFO_UTILS_COCOA_H_
|
@@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#include "chrome/browser/ui/cocoa/page_info/website_settings_utils_cocoa.h"
|
#include "chrome/browser/ui/cocoa/page_info/page_info_utils_cocoa.h"
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
// The amount of horizontal space between the button's title and its arrow icon.
|
// The amount of horizontal space between the button's title and its arrow icon.
|
||||||
@@ -10,8 +10,7 @@ const CGFloat kButtonTitleRightPadding = 4.0f;
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Determine the size of a popup button with the given title.
|
// Determine the size of a popup button with the given title.
|
||||||
NSSize SizeForWebsiteSettingsButtonTitle(NSPopUpButton* button,
|
NSSize SizeForPageInfoButtonTitle(NSPopUpButton* button, NSString* title) {
|
||||||
NSString* title) {
|
|
||||||
NSDictionary* textAttributes =
|
NSDictionary* textAttributes =
|
||||||
[[button attributedTitle] attributesAtIndex:0 effectiveRange:NULL];
|
[[button attributedTitle] attributesAtIndex:0 effectiveRange:NULL];
|
||||||
NSSize titleSize = [title sizeWithAttributes:textAttributes];
|
NSSize titleSize = [title sizeWithAttributes:textAttributes];
|
@@ -24,8 +24,7 @@ class Profile;
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Designated initializer.
|
// Designated initializer.
|
||||||
- (id)initWithPermissionInfo:
|
- (id)initWithPermissionInfo:(const PageInfoUI::PermissionInfo&)permissionInfo
|
||||||
(const WebsiteSettingsUI::PermissionInfo&)permissionInfo
|
|
||||||
forURL:(const GURL&)url
|
forURL:(const GURL&)url
|
||||||
withCallback:(PermissionMenuModel::ChangeCallback)callback
|
withCallback:(PermissionMenuModel::ChangeCallback)callback
|
||||||
profile:(Profile*)profile;
|
profile:(Profile*)profile;
|
||||||
|
@@ -5,14 +5,13 @@
|
|||||||
#import "chrome/browser/ui/cocoa/page_info/permission_selector_button.h"
|
#import "chrome/browser/ui/cocoa/page_info/permission_selector_button.h"
|
||||||
|
|
||||||
#include "base/strings/sys_string_conversions.h"
|
#include "base/strings/sys_string_conversions.h"
|
||||||
#include "chrome/browser/ui/cocoa/page_info/website_settings_utils_cocoa.h"
|
#include "chrome/browser/ui/cocoa/page_info/page_info_utils_cocoa.h"
|
||||||
#include "chrome/browser/ui/page_info/website_settings_ui.h"
|
#include "chrome/browser/ui/page_info/page_info_ui.h"
|
||||||
#import "ui/base/cocoa/menu_controller.h"
|
#import "ui/base/cocoa/menu_controller.h"
|
||||||
|
|
||||||
@implementation PermissionSelectorButton
|
@implementation PermissionSelectorButton
|
||||||
|
|
||||||
- (id)initWithPermissionInfo:
|
- (id)initWithPermissionInfo:(const PageInfoUI::PermissionInfo&)permissionInfo
|
||||||
(const WebsiteSettingsUI::PermissionInfo&)permissionInfo
|
|
||||||
forURL:(const GURL&)url
|
forURL:(const GURL&)url
|
||||||
withCallback:(PermissionMenuModel::ChangeCallback)callback
|
withCallback:(PermissionMenuModel::ChangeCallback)callback
|
||||||
profile:(Profile*)profile {
|
profile:(Profile*)profile {
|
||||||
@@ -31,7 +30,7 @@
|
|||||||
|
|
||||||
// Set the button title.
|
// Set the button title.
|
||||||
base::scoped_nsobject<NSMenuItem> titleItem([[NSMenuItem alloc] init]);
|
base::scoped_nsobject<NSMenuItem> titleItem([[NSMenuItem alloc] init]);
|
||||||
base::string16 buttonTitle = WebsiteSettingsUI::PermissionActionToUIString(
|
base::string16 buttonTitle = PageInfoUI::PermissionActionToUIString(
|
||||||
profile, permissionInfo.type, permissionInfo.setting,
|
profile, permissionInfo.type, permissionInfo.setting,
|
||||||
permissionInfo.default_setting, permissionInfo.source);
|
permissionInfo.default_setting, permissionInfo.source);
|
||||||
[titleItem setTitle:base::SysUTF16ToNSString(buttonTitle)];
|
[titleItem setTitle:base::SysUTF16ToNSString(buttonTitle)];
|
||||||
@@ -41,7 +40,7 @@
|
|||||||
[self sizeToFit];
|
[self sizeToFit];
|
||||||
|
|
||||||
// Size the button to just fit the visible title - not all of its items.
|
// Size the button to just fit the visible title - not all of its items.
|
||||||
[self setFrameSize:SizeForWebsiteSettingsButtonTitle(self, [self title])];
|
[self setFrameSize:SizeForPageInfoButtonTitle(self, [self title])];
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
@@ -53,10 +52,10 @@
|
|||||||
CGFloat maxTitleWidth = 0;
|
CGFloat maxTitleWidth = 0;
|
||||||
for (NSMenuItem* item in [self itemArray]) {
|
for (NSMenuItem* item in [self itemArray]) {
|
||||||
NSString* title =
|
NSString* title =
|
||||||
base::SysUTF16ToNSString(WebsiteSettingsUI::PermissionActionToUIString(
|
base::SysUTF16ToNSString(PageInfoUI::PermissionActionToUIString(
|
||||||
profile, type, static_cast<ContentSetting>([item tag]),
|
profile, type, static_cast<ContentSetting>([item tag]),
|
||||||
defaultSetting, content_settings::SETTING_SOURCE_USER));
|
defaultSetting, content_settings::SETTING_SOURCE_USER));
|
||||||
NSSize size = SizeForWebsiteSettingsButtonTitle(self, title);
|
NSSize size = SizeForPageInfoButtonTitle(self, title);
|
||||||
maxTitleWidth = std::max(maxTitleWidth, size.width);
|
maxTitleWidth = std::max(maxTitleWidth, size.width);
|
||||||
}
|
}
|
||||||
return maxTitleWidth;
|
return maxTitleWidth;
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
#include "base/mac/scoped_nsobject.h"
|
#include "base/mac/scoped_nsobject.h"
|
||||||
#import "chrome/browser/ui/cocoa/test/cocoa_test_helper.h"
|
#import "chrome/browser/ui/cocoa/test/cocoa_test_helper.h"
|
||||||
#include "chrome/browser/ui/page_info/website_settings_ui.h"
|
#include "chrome/browser/ui/page_info/page_info_ui.h"
|
||||||
#include "chrome/test/base/testing_profile.h"
|
#include "chrome/test/base/testing_profile.h"
|
||||||
#include "content/public/test/test_browser_thread_bundle.h"
|
#include "content/public/test/test_browser_thread_bundle.h"
|
||||||
|
|
||||||
@@ -23,7 +23,7 @@ class PermissionSelectorButtonTest : public CocoaTest {
|
|||||||
public:
|
public:
|
||||||
PermissionSelectorButtonTest() {
|
PermissionSelectorButtonTest() {
|
||||||
got_callback_ = false;
|
got_callback_ = false;
|
||||||
WebsiteSettingsUI::PermissionInfo test_info;
|
PageInfoUI::PermissionInfo test_info;
|
||||||
test_info.type = kTestPermissionType;
|
test_info.type = kTestPermissionType;
|
||||||
test_info.setting = CONTENT_SETTING_BLOCK;
|
test_info.setting = CONTENT_SETTING_BLOCK;
|
||||||
test_info.source = content_settings::SETTING_SOURCE_USER;
|
test_info.source = content_settings::SETTING_SOURCE_USER;
|
||||||
@@ -39,7 +39,7 @@ class PermissionSelectorButtonTest : public CocoaTest {
|
|||||||
[[test_window() contentView] addSubview:view_];
|
[[test_window() contentView] addSubview:view_];
|
||||||
}
|
}
|
||||||
|
|
||||||
void Callback(const WebsiteSettingsUI::PermissionInfo& permission) {
|
void Callback(const PageInfoUI::PermissionInfo& permission) {
|
||||||
EXPECT_TRUE(permission.type == kTestPermissionType);
|
EXPECT_TRUE(permission.type == kTestPermissionType);
|
||||||
got_callback_ = true;
|
got_callback_ = true;
|
||||||
}
|
}
|
||||||
|
@@ -1,13 +0,0 @@
|
|||||||
// Copyright 2014 The Chromium Authors. All rights reserved.
|
|
||||||
// Use of this source code is governed by a BSD-style license that can be
|
|
||||||
// found in the LICENSE file.
|
|
||||||
|
|
||||||
#ifndef CHROME_BROWSER_UI_COCOA_PAGE_INFO_WEBSITE_SETTINGS_UTILS_COCOA_H_
|
|
||||||
#define CHROME_BROWSER_UI_COCOA_PAGE_INFO_WEBSITE_SETTINGS_UTILS_COCOA_H_
|
|
||||||
|
|
||||||
#import <Cocoa/Cocoa.h>
|
|
||||||
|
|
||||||
NSSize SizeForWebsiteSettingsButtonTitle(NSPopUpButton* button,
|
|
||||||
NSString* title);
|
|
||||||
|
|
||||||
#endif // CHROME_BROWSER_UI_COCOA_PAGE_INFO_WEBSITE_SETTINGS_UTILS_COCOA_H_
|
|
@@ -23,9 +23,9 @@
|
|||||||
#import "chrome/browser/ui/cocoa/info_bubble_window.h"
|
#import "chrome/browser/ui/cocoa/info_bubble_window.h"
|
||||||
#import "chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h"
|
#import "chrome/browser/ui/cocoa/location_bar/location_bar_decoration.h"
|
||||||
#import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h"
|
#import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h"
|
||||||
|
#include "chrome/browser/ui/cocoa/page_info/page_info_utils_cocoa.h"
|
||||||
#include "chrome/browser/ui/cocoa/page_info/permission_selector_button.h"
|
#include "chrome/browser/ui/cocoa/page_info/permission_selector_button.h"
|
||||||
#include "chrome/browser/ui/cocoa/page_info/split_block_button.h"
|
#include "chrome/browser/ui/cocoa/page_info/split_block_button.h"
|
||||||
#include "chrome/browser/ui/cocoa/page_info/website_settings_utils_cocoa.h"
|
|
||||||
#include "chrome/browser/ui/cocoa/permission_bubble/permission_bubble_cocoa.h"
|
#include "chrome/browser/ui/cocoa/permission_bubble/permission_bubble_cocoa.h"
|
||||||
#include "chrome/browser/ui/exclusive_access/exclusive_access_context.h"
|
#include "chrome/browser/ui/exclusive_access/exclusive_access_context.h"
|
||||||
#include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h"
|
#include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h"
|
||||||
@@ -109,12 +109,11 @@ const NSInteger kFullscreenLeftOffset = 40;
|
|||||||
__block PermissionPrompt::Delegate* blockDelegate = delegate;
|
__block PermissionPrompt::Delegate* blockDelegate = delegate;
|
||||||
__block AllowBlockMenuButton* blockSelf = self;
|
__block AllowBlockMenuButton* blockSelf = self;
|
||||||
PermissionMenuModel::ChangeCallback changeCallback =
|
PermissionMenuModel::ChangeCallback changeCallback =
|
||||||
base::BindBlock(^(const WebsiteSettingsUI::PermissionInfo& permission) {
|
base::BindBlock(^(const PageInfoUI::PermissionInfo& permission) {
|
||||||
blockDelegate->ToggleAccept(
|
blockDelegate->ToggleAccept(
|
||||||
index, permission.setting == CONTENT_SETTING_ALLOW);
|
index, permission.setting == CONTENT_SETTING_ALLOW);
|
||||||
[blockSelf setFrameSize:
|
[blockSelf setFrameSize:SizeForPageInfoButtonTitle(
|
||||||
SizeForWebsiteSettingsButtonTitle(blockSelf,
|
blockSelf, [blockSelf title])];
|
||||||
[blockSelf title])];
|
|
||||||
});
|
});
|
||||||
|
|
||||||
menuModel_.reset(
|
menuModel_.reset(
|
||||||
@@ -128,7 +127,7 @@ const NSInteger kFullscreenLeftOffset = 40;
|
|||||||
// Adjust the size to fit the current title. Using only -sizeToFit leaves
|
// Adjust the size to fit the current title. Using only -sizeToFit leaves
|
||||||
// an ugly amount of whitespace between the title and the arrows because it
|
// an ugly amount of whitespace between the title and the arrows because it
|
||||||
// will fit to the largest element in the menu, not just the selected item.
|
// will fit to the largest element in the menu, not just the selected item.
|
||||||
[self setFrameSize:SizeForWebsiteSettingsButtonTitle(self, [self title])];
|
[self setFrameSize:SizeForPageInfoButtonTitle(self, [self title])];
|
||||||
}
|
}
|
||||||
return self;
|
return self;
|
||||||
}
|
}
|
||||||
@@ -136,7 +135,7 @@ const NSInteger kFullscreenLeftOffset = 40;
|
|||||||
- (CGFloat)maximumTitleWidth {
|
- (CGFloat)maximumTitleWidth {
|
||||||
CGFloat maxTitleWidth = 0;
|
CGFloat maxTitleWidth = 0;
|
||||||
for (NSMenuItem* item in [self itemArray]) {
|
for (NSMenuItem* item in [self itemArray]) {
|
||||||
NSSize size = SizeForWebsiteSettingsButtonTitle(self, [item title]);
|
NSSize size = SizeForPageInfoButtonTitle(self, [item title]);
|
||||||
maxTitleWidth = std::max(maxTitleWidth, size.width);
|
maxTitleWidth = std::max(maxTitleWidth, size.width);
|
||||||
}
|
}
|
||||||
return maxTitleWidth;
|
return maxTitleWidth;
|
||||||
|
@@ -519,7 +519,7 @@ void LoginHandler::GetDialogStrings(const GURL& request_url,
|
|||||||
// TODO(asanka): The string should be different for proxies and servers.
|
// TODO(asanka): The string should be different for proxies and servers.
|
||||||
// http://crbug.com/620756
|
// http://crbug.com/620756
|
||||||
*explanation =
|
*explanation =
|
||||||
l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_NON_SECURE_TRANSPORT);
|
l10n_util::GetStringUTF16(IDS_PAGE_INFO_NON_SECURE_TRANSPORT);
|
||||||
} else {
|
} else {
|
||||||
explanation->clear();
|
explanation->clear();
|
||||||
}
|
}
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#include "chrome/browser/ui/page_info/website_settings.h"
|
#include "chrome/browser/ui/page_info/page_info.h"
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
#include "chrome/browser/profiles/profile.h"
|
#include "chrome/browser/profiles/profile.h"
|
||||||
#include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h"
|
#include "chrome/browser/ssl/chrome_ssl_host_state_delegate.h"
|
||||||
#include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h"
|
#include "chrome/browser/ssl/chrome_ssl_host_state_delegate_factory.h"
|
||||||
#include "chrome/browser/ui/page_info/website_settings_ui.h"
|
#include "chrome/browser/ui/page_info/page_info_ui.h"
|
||||||
#include "chrome/browser/usb/usb_chooser_context.h"
|
#include "chrome/browser/usb/usb_chooser_context.h"
|
||||||
#include "chrome/browser/usb/usb_chooser_context_factory.h"
|
#include "chrome/browser/usb/usb_chooser_context_factory.h"
|
||||||
#include "chrome/common/chrome_switches.h"
|
#include "chrome/common/chrome_switches.h"
|
||||||
@@ -75,7 +75,7 @@
|
|||||||
|
|
||||||
#if !defined(OS_ANDROID)
|
#if !defined(OS_ANDROID)
|
||||||
#include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h"
|
#include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h"
|
||||||
#include "chrome/browser/ui/page_info/website_settings_infobar_delegate.h"
|
#include "chrome/browser/ui/page_info/page_info_infobar_delegate.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using base::ASCIIToUTF16;
|
using base::ASCIIToUTF16;
|
||||||
@@ -92,7 +92,7 @@ enum SSLCertificateDecisionsDidRevoke {
|
|||||||
END_OF_SSL_CERTIFICATE_DECISIONS_DID_REVOKE_ENUM
|
END_OF_SSL_CERTIFICATE_DECISIONS_DID_REVOKE_ENUM
|
||||||
};
|
};
|
||||||
|
|
||||||
// The list of content settings types to display on the Website Settings UI. THE
|
// The list of content settings types to display on the Page Info UI. THE
|
||||||
// ORDER OF THESE ITEMS IS IMPORTANT. To propose changing it, email
|
// ORDER OF THESE ITEMS IS IMPORTANT. To propose changing it, email
|
||||||
// security-dev@chromium.org.
|
// security-dev@chromium.org.
|
||||||
ContentSettingsType kPermissionType[] = {
|
ContentSettingsType kPermissionType[] = {
|
||||||
@@ -112,7 +112,7 @@ ContentSettingsType kPermissionType[] = {
|
|||||||
CONTENT_SETTINGS_TYPE_MIDI_SYSEX,
|
CONTENT_SETTINGS_TYPE_MIDI_SYSEX,
|
||||||
};
|
};
|
||||||
|
|
||||||
// Determines whether to show permission |type| in the Website Settings UI. Only
|
// Determines whether to show permission |type| in the Page Info UI. Only
|
||||||
// applies to permissions listed in |kPermissionType|.
|
// applies to permissions listed in |kPermissionType|.
|
||||||
bool ShouldShowPermission(ContentSettingsType type) {
|
bool ShouldShowPermission(ContentSettingsType type) {
|
||||||
#if !defined(OS_ANDROID)
|
#if !defined(OS_ANDROID)
|
||||||
@@ -163,23 +163,23 @@ void CheckForInsecureContent(const security_state::SecurityInfo& security_info,
|
|||||||
|
|
||||||
void GetSiteIdentityByMaliciousContentStatus(
|
void GetSiteIdentityByMaliciousContentStatus(
|
||||||
security_state::MaliciousContentStatus malicious_content_status,
|
security_state::MaliciousContentStatus malicious_content_status,
|
||||||
WebsiteSettings::SiteIdentityStatus* status,
|
PageInfo::SiteIdentityStatus* status,
|
||||||
base::string16* details) {
|
base::string16* details) {
|
||||||
switch (malicious_content_status) {
|
switch (malicious_content_status) {
|
||||||
case security_state::MALICIOUS_CONTENT_STATUS_NONE:
|
case security_state::MALICIOUS_CONTENT_STATUS_NONE:
|
||||||
NOTREACHED();
|
NOTREACHED();
|
||||||
break;
|
break;
|
||||||
case security_state::MALICIOUS_CONTENT_STATUS_MALWARE:
|
case security_state::MALICIOUS_CONTENT_STATUS_MALWARE:
|
||||||
*status = WebsiteSettings::SITE_IDENTITY_STATUS_MALWARE;
|
*status = PageInfo::SITE_IDENTITY_STATUS_MALWARE;
|
||||||
*details = l10n_util::GetStringUTF16(IDS_PAGEINFO_MALWARE_DETAILS);
|
*details = l10n_util::GetStringUTF16(IDS_PAGEINFO_MALWARE_DETAILS);
|
||||||
break;
|
break;
|
||||||
case security_state::MALICIOUS_CONTENT_STATUS_SOCIAL_ENGINEERING:
|
case security_state::MALICIOUS_CONTENT_STATUS_SOCIAL_ENGINEERING:
|
||||||
*status = WebsiteSettings::SITE_IDENTITY_STATUS_SOCIAL_ENGINEERING;
|
*status = PageInfo::SITE_IDENTITY_STATUS_SOCIAL_ENGINEERING;
|
||||||
*details =
|
*details =
|
||||||
l10n_util::GetStringUTF16(IDS_PAGEINFO_SOCIAL_ENGINEERING_DETAILS);
|
l10n_util::GetStringUTF16(IDS_PAGEINFO_SOCIAL_ENGINEERING_DETAILS);
|
||||||
break;
|
break;
|
||||||
case security_state::MALICIOUS_CONTENT_STATUS_UNWANTED_SOFTWARE:
|
case security_state::MALICIOUS_CONTENT_STATUS_UNWANTED_SOFTWARE:
|
||||||
*status = WebsiteSettings::SITE_IDENTITY_STATUS_UNWANTED_SOFTWARE;
|
*status = PageInfo::SITE_IDENTITY_STATUS_UNWANTED_SOFTWARE;
|
||||||
*details =
|
*details =
|
||||||
l10n_util::GetStringUTF16(IDS_PAGEINFO_UNWANTED_SOFTWARE_DETAILS);
|
l10n_util::GetStringUTF16(IDS_PAGEINFO_UNWANTED_SOFTWARE_DETAILS);
|
||||||
break;
|
break;
|
||||||
@@ -198,21 +198,20 @@ ChooserContextBase* GetUsbChooserContext(Profile* profile) {
|
|||||||
// The list of chooser types that need to display entries in the Website
|
// The list of chooser types that need to display entries in the Website
|
||||||
// Settings UI. THE ORDER OF THESE ITEMS IS IMPORTANT. To propose changing it,
|
// Settings UI. THE ORDER OF THESE ITEMS IS IMPORTANT. To propose changing it,
|
||||||
// email security-dev@chromium.org.
|
// email security-dev@chromium.org.
|
||||||
WebsiteSettings::ChooserUIInfo kChooserUIInfo[] = {
|
PageInfo::ChooserUIInfo kChooserUIInfo[] = {
|
||||||
{CONTENT_SETTINGS_TYPE_USB_CHOOSER_DATA, &GetUsbChooserContext,
|
{CONTENT_SETTINGS_TYPE_USB_CHOOSER_DATA, &GetUsbChooserContext,
|
||||||
IDR_BLOCKED_USB, IDR_ALLOWED_USB, IDS_WEBSITE_SETTINGS_USB_DEVICE_LABEL,
|
IDR_BLOCKED_USB, IDR_ALLOWED_USB, IDS_PAGE_INFO_USB_DEVICE_LABEL,
|
||||||
IDS_WEBSITE_SETTINGS_DELETE_USB_DEVICE, "name"},
|
IDS_PAGE_INFO_DELETE_USB_DEVICE, "name"},
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
WebsiteSettings::WebsiteSettings(
|
PageInfo::PageInfo(PageInfoUI* ui,
|
||||||
WebsiteSettingsUI* ui,
|
Profile* profile,
|
||||||
Profile* profile,
|
TabSpecificContentSettings* tab_specific_content_settings,
|
||||||
TabSpecificContentSettings* tab_specific_content_settings,
|
content::WebContents* web_contents,
|
||||||
content::WebContents* web_contents,
|
const GURL& url,
|
||||||
const GURL& url,
|
const security_state::SecurityInfo& security_info)
|
||||||
const security_state::SecurityInfo& security_info)
|
|
||||||
: TabSpecificContentSettings::SiteDataObserver(
|
: TabSpecificContentSettings::SiteDataObserver(
|
||||||
tab_specific_content_settings),
|
tab_specific_content_settings),
|
||||||
content::WebContentsObserver(web_contents),
|
content::WebContentsObserver(web_contents),
|
||||||
@@ -234,17 +233,15 @@ WebsiteSettings::WebsiteSettings(
|
|||||||
PresentSiteData();
|
PresentSiteData();
|
||||||
PresentSiteIdentity();
|
PresentSiteIdentity();
|
||||||
|
|
||||||
// Every time the Website Settings UI is opened a |WebsiteSettings| object is
|
// Every time the Page Info UI is opened a |PageInfo| object is
|
||||||
// created. So this counts how ofter the Website Settings UI is opened.
|
// created. So this counts how ofter the Page Info UI is opened.
|
||||||
RecordWebsiteSettingsAction(WEBSITE_SETTINGS_OPENED);
|
RecordPageInfoAction(PAGE_INFO_OPENED);
|
||||||
}
|
}
|
||||||
|
|
||||||
WebsiteSettings::~WebsiteSettings() {}
|
PageInfo::~PageInfo() {}
|
||||||
|
|
||||||
void WebsiteSettings::RecordWebsiteSettingsAction(
|
void PageInfo::RecordPageInfoAction(PageInfoAction action) {
|
||||||
WebsiteSettingsAction action) {
|
UMA_HISTOGRAM_ENUMERATION("WebsiteSettings.Action", action, PAGE_INFO_COUNT);
|
||||||
UMA_HISTOGRAM_ENUMERATION("WebsiteSettings.Action", action,
|
|
||||||
WEBSITE_SETTINGS_COUNT);
|
|
||||||
|
|
||||||
std::string histogram_name;
|
std::string histogram_name;
|
||||||
|
|
||||||
@@ -252,33 +249,33 @@ void WebsiteSettings::RecordWebsiteSettingsAction(
|
|||||||
if (security_level_ == security_state::SECURE ||
|
if (security_level_ == security_state::SECURE ||
|
||||||
security_level_ == security_state::EV_SECURE) {
|
security_level_ == security_state::EV_SECURE) {
|
||||||
UMA_HISTOGRAM_ENUMERATION("Security.PageInfo.Action.HttpsUrl.Valid",
|
UMA_HISTOGRAM_ENUMERATION("Security.PageInfo.Action.HttpsUrl.Valid",
|
||||||
action, WEBSITE_SETTINGS_COUNT);
|
action, PAGE_INFO_COUNT);
|
||||||
} else if (security_level_ == security_state::NONE) {
|
} else if (security_level_ == security_state::NONE) {
|
||||||
UMA_HISTOGRAM_ENUMERATION("Security.PageInfo.Action.HttpsUrl.Downgraded",
|
UMA_HISTOGRAM_ENUMERATION("Security.PageInfo.Action.HttpsUrl.Downgraded",
|
||||||
action, WEBSITE_SETTINGS_COUNT);
|
action, PAGE_INFO_COUNT);
|
||||||
} else if (security_level_ == security_state::DANGEROUS) {
|
} else if (security_level_ == security_state::DANGEROUS) {
|
||||||
UMA_HISTOGRAM_ENUMERATION("Security.PageInfo.Action.HttpsUrl.Dangerous",
|
UMA_HISTOGRAM_ENUMERATION("Security.PageInfo.Action.HttpsUrl.Dangerous",
|
||||||
action, WEBSITE_SETTINGS_COUNT);
|
action, PAGE_INFO_COUNT);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (security_level_ == security_state::HTTP_SHOW_WARNING) {
|
if (security_level_ == security_state::HTTP_SHOW_WARNING) {
|
||||||
UMA_HISTOGRAM_ENUMERATION("Security.PageInfo.Action.HttpUrl.Warning",
|
UMA_HISTOGRAM_ENUMERATION("Security.PageInfo.Action.HttpUrl.Warning",
|
||||||
action, WEBSITE_SETTINGS_COUNT);
|
action, PAGE_INFO_COUNT);
|
||||||
} else if (security_level_ == security_state::DANGEROUS) {
|
} else if (security_level_ == security_state::DANGEROUS) {
|
||||||
UMA_HISTOGRAM_ENUMERATION("Security.PageInfo.Action.HttpUrl.Dangerous",
|
UMA_HISTOGRAM_ENUMERATION("Security.PageInfo.Action.HttpUrl.Dangerous",
|
||||||
action, WEBSITE_SETTINGS_COUNT);
|
action, PAGE_INFO_COUNT);
|
||||||
} else {
|
} else {
|
||||||
UMA_HISTOGRAM_ENUMERATION("Security.PageInfo.Action.HttpUrl.Neutral",
|
UMA_HISTOGRAM_ENUMERATION("Security.PageInfo.Action.HttpUrl.Neutral",
|
||||||
action, WEBSITE_SETTINGS_COUNT);
|
action, PAGE_INFO_COUNT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettings::OnSitePermissionChanged(ContentSettingsType type,
|
void PageInfo::OnSitePermissionChanged(ContentSettingsType type,
|
||||||
ContentSetting setting) {
|
ContentSetting setting) {
|
||||||
// Count how often a permission for a specific content type is changed using
|
// Count how often a permission for a specific content type is changed using
|
||||||
// the Website Settings UI.
|
// the Page Info UI.
|
||||||
size_t num_values;
|
size_t num_values;
|
||||||
int histogram_value = ContentSettingTypeToHistogramValue(type, &num_values);
|
int histogram_value = ContentSettingTypeToHistogramValue(type, &num_values);
|
||||||
UMA_HISTOGRAM_ENUMERATION("WebsiteSettings.OriginInfo.PermissionChanged",
|
UMA_HISTOGRAM_ENUMERATION("WebsiteSettings.OriginInfo.PermissionChanged",
|
||||||
@@ -302,8 +299,8 @@ void WebsiteSettings::OnSitePermissionChanged(ContentSettingsType type,
|
|||||||
|
|
||||||
// This is technically redundant given the histogram above, but putting the
|
// This is technically redundant given the histogram above, but putting the
|
||||||
// total count of permission changes in another histogram makes it easier to
|
// total count of permission changes in another histogram makes it easier to
|
||||||
// compare it against other kinds of actions in WebsiteSettings[PopupView].
|
// compare it against other kinds of actions in PageInfo[PopupView].
|
||||||
RecordWebsiteSettingsAction(WEBSITE_SETTINGS_CHANGED_PERMISSION);
|
RecordPageInfoAction(PAGE_INFO_CHANGED_PERMISSION);
|
||||||
|
|
||||||
PermissionUtil::ScopedRevocationReporter scoped_revocation_reporter(
|
PermissionUtil::ScopedRevocationReporter scoped_revocation_reporter(
|
||||||
this->profile_, this->site_url_, this->site_url_, type,
|
this->profile_, this->site_url_, this->site_url_, type,
|
||||||
@@ -318,9 +315,8 @@ void WebsiteSettings::OnSitePermissionChanged(ContentSettingsType type,
|
|||||||
PresentSitePermissions();
|
PresentSitePermissions();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettings::OnSiteChosenObjectDeleted(
|
void PageInfo::OnSiteChosenObjectDeleted(const ChooserUIInfo& ui_info,
|
||||||
const ChooserUIInfo& ui_info,
|
const base::DictionaryValue& object) {
|
||||||
const base::DictionaryValue& object) {
|
|
||||||
// TODO(reillyg): Create metrics for revocations. crbug.com/556845
|
// TODO(reillyg): Create metrics for revocations. crbug.com/556845
|
||||||
ChooserContextBase* context = ui_info.get_context(profile_);
|
ChooserContextBase* context = ui_info.get_context(profile_);
|
||||||
const GURL origin = site_url_.GetOrigin();
|
const GURL origin = site_url_.GetOrigin();
|
||||||
@@ -332,11 +328,11 @@ void WebsiteSettings::OnSiteChosenObjectDeleted(
|
|||||||
PresentSitePermissions();
|
PresentSitePermissions();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettings::OnSiteDataAccessed() {
|
void PageInfo::OnSiteDataAccessed() {
|
||||||
PresentSiteData();
|
PresentSiteData();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettings::OnUIClosing() {
|
void PageInfo::OnUIClosing() {
|
||||||
#if defined(OS_ANDROID)
|
#if defined(OS_ANDROID)
|
||||||
NOTREACHED();
|
NOTREACHED();
|
||||||
#else
|
#else
|
||||||
@@ -344,7 +340,7 @@ void WebsiteSettings::OnUIClosing() {
|
|||||||
InfoBarService* infobar_service =
|
InfoBarService* infobar_service =
|
||||||
InfoBarService::FromWebContents(web_contents());
|
InfoBarService::FromWebContents(web_contents());
|
||||||
if (infobar_service)
|
if (infobar_service)
|
||||||
WebsiteSettingsInfoBarDelegate::Create(infobar_service);
|
PageInfoInfoBarDelegate::Create(infobar_service);
|
||||||
}
|
}
|
||||||
|
|
||||||
SSLCertificateDecisionsDidRevoke user_decision =
|
SSLCertificateDecisionsDidRevoke user_decision =
|
||||||
@@ -357,15 +353,15 @@ void WebsiteSettings::OnUIClosing() {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettings::OnRevokeSSLErrorBypassButtonPressed() {
|
void PageInfo::OnRevokeSSLErrorBypassButtonPressed() {
|
||||||
DCHECK(chrome_ssl_host_state_delegate_);
|
DCHECK(chrome_ssl_host_state_delegate_);
|
||||||
chrome_ssl_host_state_delegate_->RevokeUserAllowExceptionsHard(
|
chrome_ssl_host_state_delegate_->RevokeUserAllowExceptionsHard(
|
||||||
site_url().host());
|
site_url().host());
|
||||||
did_revoke_user_ssl_decisions_ = true;
|
did_revoke_user_ssl_decisions_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettings::Init(const GURL& url,
|
void PageInfo::Init(const GURL& url,
|
||||||
const security_state::SecurityInfo& security_info) {
|
const security_state::SecurityInfo& security_info) {
|
||||||
#if !defined(OS_ANDROID) && !defined(OS_IOS)
|
#if !defined(OS_ANDROID) && !defined(OS_IOS)
|
||||||
// On desktop, internal URLs aren't handled by this class. Instead, a
|
// On desktop, internal URLs aren't handled by this class. Instead, a
|
||||||
// custom and simpler popup is shown.
|
// custom and simpler popup is shown.
|
||||||
@@ -635,11 +631,11 @@ void WebsiteSettings::Init(const GURL& url,
|
|||||||
show_ssl_decision_revoke_button_ = delegate->HasAllowException(url.host());
|
show_ssl_decision_revoke_button_ = delegate->HasAllowException(url.host());
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettings::PresentSitePermissions() {
|
void PageInfo::PresentSitePermissions() {
|
||||||
PermissionInfoList permission_info_list;
|
PermissionInfoList permission_info_list;
|
||||||
ChosenObjectInfoList chosen_object_info_list;
|
ChosenObjectInfoList chosen_object_info_list;
|
||||||
|
|
||||||
WebsiteSettingsUI::PermissionInfo permission_info;
|
PageInfoUI::PermissionInfo permission_info;
|
||||||
for (size_t i = 0; i < arraysize(kPermissionType); ++i) {
|
for (size_t i = 0; i < arraysize(kPermissionType); ++i) {
|
||||||
permission_info.type = kPermissionType[i];
|
permission_info.type = kPermissionType[i];
|
||||||
|
|
||||||
@@ -701,8 +697,8 @@ void WebsiteSettings::PresentSitePermissions() {
|
|||||||
auto chosen_objects = context->GetGrantedObjects(origin, origin);
|
auto chosen_objects = context->GetGrantedObjects(origin, origin);
|
||||||
for (std::unique_ptr<base::DictionaryValue>& object : chosen_objects) {
|
for (std::unique_ptr<base::DictionaryValue>& object : chosen_objects) {
|
||||||
chosen_object_info_list.push_back(
|
chosen_object_info_list.push_back(
|
||||||
base::MakeUnique<WebsiteSettingsUI::ChosenObjectInfo>(
|
base::MakeUnique<PageInfoUI::ChosenObjectInfo>(ui_info,
|
||||||
ui_info, std::move(object)));
|
std::move(object)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -710,7 +706,7 @@ void WebsiteSettings::PresentSitePermissions() {
|
|||||||
std::move(chosen_object_info_list));
|
std::move(chosen_object_info_list));
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettings::PresentSiteData() {
|
void PageInfo::PresentSiteData() {
|
||||||
CookieInfoList cookie_info_list;
|
CookieInfoList cookie_info_list;
|
||||||
const LocalSharedObjectsContainer& allowed_objects =
|
const LocalSharedObjectsContainer& allowed_objects =
|
||||||
tab_specific_content_settings()->allowed_local_shared_objects();
|
tab_specific_content_settings()->allowed_local_shared_objects();
|
||||||
@@ -718,7 +714,7 @@ void WebsiteSettings::PresentSiteData() {
|
|||||||
tab_specific_content_settings()->blocked_local_shared_objects();
|
tab_specific_content_settings()->blocked_local_shared_objects();
|
||||||
|
|
||||||
// Add first party cookie and site data counts.
|
// Add first party cookie and site data counts.
|
||||||
WebsiteSettingsUI::CookieInfo cookie_info;
|
PageInfoUI::CookieInfo cookie_info;
|
||||||
cookie_info.allowed = allowed_objects.GetObjectCountForDomain(site_url_);
|
cookie_info.allowed = allowed_objects.GetObjectCountForDomain(site_url_);
|
||||||
cookie_info.blocked = blocked_objects.GetObjectCountForDomain(site_url_);
|
cookie_info.blocked = blocked_objects.GetObjectCountForDomain(site_url_);
|
||||||
cookie_info.is_first_party = true;
|
cookie_info.is_first_party = true;
|
||||||
@@ -733,12 +729,12 @@ void WebsiteSettings::PresentSiteData() {
|
|||||||
ui_->SetCookieInfo(cookie_info_list);
|
ui_->SetCookieInfo(cookie_info_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettings::PresentSiteIdentity() {
|
void PageInfo::PresentSiteIdentity() {
|
||||||
// After initialization the status about the site's connection and its
|
// After initialization the status about the site's connection and its
|
||||||
// identity must be available.
|
// identity must be available.
|
||||||
DCHECK_NE(site_identity_status_, SITE_IDENTITY_STATUS_UNKNOWN);
|
DCHECK_NE(site_identity_status_, SITE_IDENTITY_STATUS_UNKNOWN);
|
||||||
DCHECK_NE(site_connection_status_, SITE_CONNECTION_STATUS_UNKNOWN);
|
DCHECK_NE(site_connection_status_, SITE_CONNECTION_STATUS_UNKNOWN);
|
||||||
WebsiteSettingsUI::IdentityInfo info;
|
PageInfoUI::IdentityInfo info;
|
||||||
if (site_identity_status_ == SITE_IDENTITY_STATUS_EV_CERT)
|
if (site_identity_status_ == SITE_IDENTITY_STATUS_EV_CERT)
|
||||||
info.site_identity = UTF16ToUTF8(organization_name());
|
info.site_identity = UTF16ToUTF8(organization_name());
|
||||||
else
|
else
|
@@ -2,8 +2,8 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#ifndef CHROME_BROWSER_UI_PAGE_INFO_WEBSITE_SETTINGS_H_
|
#ifndef CHROME_BROWSER_UI_PAGE_INFO_PAGE_INFO_H_
|
||||||
#define CHROME_BROWSER_UI_PAGE_INFO_WEBSITE_SETTINGS_H_
|
#define CHROME_BROWSER_UI_PAGE_INFO_PAGE_INFO_H_
|
||||||
|
|
||||||
#include "base/macros.h"
|
#include "base/macros.h"
|
||||||
#include "base/strings/string16.h"
|
#include "base/strings/string16.h"
|
||||||
@@ -26,15 +26,15 @@ class ChromeSSLHostStateDelegate;
|
|||||||
class ChooserContextBase;
|
class ChooserContextBase;
|
||||||
class HostContentSettingsMap;
|
class HostContentSettingsMap;
|
||||||
class Profile;
|
class Profile;
|
||||||
class WebsiteSettingsUI;
|
class PageInfoUI;
|
||||||
|
|
||||||
// The |WebsiteSettings| provides information about a website's permissions,
|
// The |PageInfo| provides information about a website's permissions,
|
||||||
// connection state and its identity. It owns a UI that displays the
|
// connection state and its identity. It owns a UI that displays the
|
||||||
// information and allows users to change the permissions. |WebsiteSettings|
|
// information and allows users to change the permissions. |PageInfo|
|
||||||
// objects must be created on the heap. They destroy themselves after the UI is
|
// objects must be created on the heap. They destroy themselves after the UI is
|
||||||
// closed.
|
// closed.
|
||||||
class WebsiteSettings : public TabSpecificContentSettings::SiteDataObserver,
|
class PageInfo : public TabSpecificContentSettings::SiteDataObserver,
|
||||||
public content::WebContentsObserver {
|
public content::WebContentsObserver {
|
||||||
public:
|
public:
|
||||||
// TODO(palmer): Figure out if it is possible to unify SiteConnectionStatus
|
// TODO(palmer): Figure out if it is possible to unify SiteConnectionStatus
|
||||||
// and SiteIdentityStatus.
|
// and SiteIdentityStatus.
|
||||||
@@ -83,25 +83,25 @@ class WebsiteSettings : public TabSpecificContentSettings::SiteDataObserver,
|
|||||||
SITE_IDENTITY_STATUS_UNWANTED_SOFTWARE,
|
SITE_IDENTITY_STATUS_UNWANTED_SOFTWARE,
|
||||||
};
|
};
|
||||||
|
|
||||||
// UMA statistics for WebsiteSettings. Do not reorder or remove existing
|
// UMA statistics for PageInfo. Do not reorder or remove existing
|
||||||
// fields. A Java counterpart will be generated for this enum.
|
// fields. A Java counterpart will be generated for this enum.
|
||||||
// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.page_info
|
// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.page_info
|
||||||
enum WebsiteSettingsAction {
|
enum PageInfoAction {
|
||||||
WEBSITE_SETTINGS_OPENED = 0,
|
PAGE_INFO_OPENED = 0,
|
||||||
// No longer used; indicated actions for the old version of Page Info that
|
// No longer used; indicated actions for the old version of Page Info that
|
||||||
// had a "Permissions" tab and a "Connection" tab.
|
// had a "Permissions" tab and a "Connection" tab.
|
||||||
// WEBSITE_SETTINGS_PERMISSIONS_TAB_SELECTED = 1,
|
// PAGE_INFO_PERMISSIONS_TAB_SELECTED = 1,
|
||||||
// WEBSITE_SETTINGS_CONNECTION_TAB_SELECTED = 2,
|
// PAGE_INFO_CONNECTION_TAB_SELECTED = 2,
|
||||||
// WEBSITE_SETTINGS_CONNECTION_TAB_SHOWN_IMMEDIATELY = 3,
|
// PAGE_INFO_CONNECTION_TAB_SHOWN_IMMEDIATELY = 3,
|
||||||
WEBSITE_SETTINGS_COOKIES_DIALOG_OPENED = 4,
|
PAGE_INFO_COOKIES_DIALOG_OPENED = 4,
|
||||||
WEBSITE_SETTINGS_CHANGED_PERMISSION = 5,
|
PAGE_INFO_CHANGED_PERMISSION = 5,
|
||||||
WEBSITE_SETTINGS_CERTIFICATE_DIALOG_OPENED = 6,
|
PAGE_INFO_CERTIFICATE_DIALOG_OPENED = 6,
|
||||||
// No longer used; indicated a UI viewer for SCTs.
|
// No longer used; indicated a UI viewer for SCTs.
|
||||||
// WEBSITE_SETTINGS_TRANSPARENCY_VIEWER_OPENED = 7,
|
// PAGE_INFO_TRANSPARENCY_VIEWER_OPENED = 7,
|
||||||
WEBSITE_SETTINGS_CONNECTION_HELP_OPENED = 8,
|
PAGE_INFO_CONNECTION_HELP_OPENED = 8,
|
||||||
WEBSITE_SETTINGS_SITE_SETTINGS_OPENED = 9,
|
PAGE_INFO_SITE_SETTINGS_OPENED = 9,
|
||||||
WEBSITE_SETTINGS_SECURITY_DETAILS_OPENED = 10,
|
PAGE_INFO_SECURITY_DETAILS_OPENED = 10,
|
||||||
WEBSITE_SETTINGS_COUNT
|
PAGE_INFO_COUNT
|
||||||
};
|
};
|
||||||
|
|
||||||
struct ChooserUIInfo {
|
struct ChooserUIInfo {
|
||||||
@@ -114,18 +114,18 @@ class WebsiteSettings : public TabSpecificContentSettings::SiteDataObserver,
|
|||||||
const char* ui_name_key;
|
const char* ui_name_key;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Creates a WebsiteSettings for the passed |url| using the given |ssl| status
|
// Creates a PageInfo for the passed |url| using the given |ssl| status
|
||||||
// object to determine the status of the site's connection. The
|
// object to determine the status of the site's connection. The
|
||||||
// |WebsiteSettings| takes ownership of the |ui|.
|
// |PageInfo| takes ownership of the |ui|.
|
||||||
WebsiteSettings(WebsiteSettingsUI* ui,
|
PageInfo(PageInfoUI* ui,
|
||||||
Profile* profile,
|
Profile* profile,
|
||||||
TabSpecificContentSettings* tab_specific_content_settings,
|
TabSpecificContentSettings* tab_specific_content_settings,
|
||||||
content::WebContents* web_contents,
|
content::WebContents* web_contents,
|
||||||
const GURL& url,
|
const GURL& url,
|
||||||
const security_state::SecurityInfo& security_info);
|
const security_state::SecurityInfo& security_info);
|
||||||
~WebsiteSettings() override;
|
~PageInfo() override;
|
||||||
|
|
||||||
void RecordWebsiteSettingsAction(WebsiteSettingsAction action);
|
void RecordPageInfoAction(PageInfoAction action);
|
||||||
|
|
||||||
// This method is called when ever a permission setting is changed.
|
// This method is called when ever a permission setting is changed.
|
||||||
void OnSitePermissionChanged(ContentSettingsType type, ContentSetting value);
|
void OnSitePermissionChanged(ContentSettingsType type, ContentSetting value);
|
||||||
@@ -157,7 +157,7 @@ class WebsiteSettings : public TabSpecificContentSettings::SiteDataObserver,
|
|||||||
void OnSiteDataAccessed() override;
|
void OnSiteDataAccessed() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Initializes the |WebsiteSettings|.
|
// Initializes the |PageInfo|.
|
||||||
void Init(const GURL& url, const security_state::SecurityInfo& security_info);
|
void Init(const GURL& url, const security_state::SecurityInfo& security_info);
|
||||||
|
|
||||||
// Sets (presents) the information about the site's permissions in the |ui_|.
|
// Sets (presents) the information about the site's permissions in the |ui_|.
|
||||||
@@ -170,11 +170,11 @@ class WebsiteSettings : public TabSpecificContentSettings::SiteDataObserver,
|
|||||||
// in the |ui_|.
|
// in the |ui_|.
|
||||||
void PresentSiteIdentity();
|
void PresentSiteIdentity();
|
||||||
|
|
||||||
// The website settings UI displays information and controls for site-
|
// The page info UI displays information and controls for site-
|
||||||
// specific data (local stored objects like cookies), site-specific
|
// specific data (local stored objects like cookies), site-specific
|
||||||
// permissions (location, pop-up, plugin, etc. permissions) and site-specific
|
// permissions (location, pop-up, plugin, etc. permissions) and site-specific
|
||||||
// information (identity, connection status, etc.).
|
// information (identity, connection status, etc.).
|
||||||
WebsiteSettingsUI* ui_;
|
PageInfoUI* ui_;
|
||||||
|
|
||||||
// The flag that controls whether an infobar is displayed after the website
|
// The flag that controls whether an infobar is displayed after the website
|
||||||
// settings UI is closed or not.
|
// settings UI is closed or not.
|
||||||
@@ -235,7 +235,7 @@ class WebsiteSettings : public TabSpecificContentSettings::SiteDataObserver,
|
|||||||
|
|
||||||
security_state::SecurityLevel security_level_;
|
security_state::SecurityLevel security_level_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(WebsiteSettings);
|
DISALLOW_COPY_AND_ASSIGN(PageInfo);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CHROME_BROWSER_UI_PAGE_INFO_WEBSITE_SETTINGS_H_
|
#endif // CHROME_BROWSER_UI_PAGE_INFO_PAGE_INFO_H_
|
@@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#include "chrome/browser/ui/page_info/website_settings_infobar_delegate.h"
|
#include "chrome/browser/ui/page_info/page_info_infobar_delegate.h"
|
||||||
|
|
||||||
#include "base/logging.h"
|
#include "base/logging.h"
|
||||||
#include "base/strings/utf_string_conversions.h"
|
#include "base/strings/utf_string_conversions.h"
|
||||||
@@ -16,46 +16,44 @@
|
|||||||
#include "ui/base/l10n/l10n_util.h"
|
#include "ui/base/l10n/l10n_util.h"
|
||||||
|
|
||||||
// static
|
// static
|
||||||
void WebsiteSettingsInfoBarDelegate::Create(InfoBarService* infobar_service) {
|
void PageInfoInfoBarDelegate::Create(InfoBarService* infobar_service) {
|
||||||
infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar(
|
infobar_service->AddInfoBar(infobar_service->CreateConfirmInfoBar(
|
||||||
std::unique_ptr<ConfirmInfoBarDelegate>(
|
std::unique_ptr<ConfirmInfoBarDelegate>(new PageInfoInfoBarDelegate())));
|
||||||
new WebsiteSettingsInfoBarDelegate())));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WebsiteSettingsInfoBarDelegate::WebsiteSettingsInfoBarDelegate()
|
PageInfoInfoBarDelegate::PageInfoInfoBarDelegate() : ConfirmInfoBarDelegate() {}
|
||||||
: ConfirmInfoBarDelegate() {}
|
|
||||||
|
|
||||||
WebsiteSettingsInfoBarDelegate::~WebsiteSettingsInfoBarDelegate() {}
|
PageInfoInfoBarDelegate::~PageInfoInfoBarDelegate() {}
|
||||||
|
|
||||||
infobars::InfoBarDelegate::Type WebsiteSettingsInfoBarDelegate::GetInfoBarType()
|
infobars::InfoBarDelegate::Type PageInfoInfoBarDelegate::GetInfoBarType()
|
||||||
const {
|
const {
|
||||||
return PAGE_ACTION_TYPE;
|
return PAGE_ACTION_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
infobars::InfoBarDelegate::InfoBarIdentifier
|
infobars::InfoBarDelegate::InfoBarIdentifier
|
||||||
WebsiteSettingsInfoBarDelegate::GetIdentifier() const {
|
PageInfoInfoBarDelegate::GetIdentifier() const {
|
||||||
return WEBSITE_SETTINGS_INFOBAR_DELEGATE;
|
return PAGE_INFO_INFOBAR_DELEGATE;
|
||||||
}
|
}
|
||||||
|
|
||||||
const gfx::VectorIcon& WebsiteSettingsInfoBarDelegate::GetVectorIcon() const {
|
const gfx::VectorIcon& PageInfoInfoBarDelegate::GetVectorIcon() const {
|
||||||
return kGlobeIcon;
|
return kGlobeIcon;
|
||||||
}
|
}
|
||||||
|
|
||||||
base::string16 WebsiteSettingsInfoBarDelegate::GetMessageText() const {
|
base::string16 PageInfoInfoBarDelegate::GetMessageText() const {
|
||||||
return l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_INFOBAR_TEXT);
|
return l10n_util::GetStringUTF16(IDS_PAGE_INFO_INFOBAR_TEXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
int WebsiteSettingsInfoBarDelegate::GetButtons() const {
|
int PageInfoInfoBarDelegate::GetButtons() const {
|
||||||
return BUTTON_OK;
|
return BUTTON_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
base::string16 WebsiteSettingsInfoBarDelegate::GetButtonLabel(
|
base::string16 PageInfoInfoBarDelegate::GetButtonLabel(
|
||||||
InfoBarButton button) const {
|
InfoBarButton button) const {
|
||||||
DCHECK_EQ(BUTTON_OK, button);
|
DCHECK_EQ(BUTTON_OK, button);
|
||||||
return l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_INFOBAR_BUTTON);
|
return l10n_util::GetStringUTF16(IDS_PAGE_INFO_INFOBAR_BUTTON);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WebsiteSettingsInfoBarDelegate::Accept() {
|
bool PageInfoInfoBarDelegate::Accept() {
|
||||||
content::WebContents* web_contents =
|
content::WebContents* web_contents =
|
||||||
InfoBarService::WebContentsFromInfoBar(infobar());
|
InfoBarService::WebContentsFromInfoBar(infobar());
|
||||||
web_contents->GetController().Reload(content::ReloadType::NORMAL, true);
|
web_contents->GetController().Reload(content::ReloadType::NORMAL, true);
|
@@ -2,28 +2,28 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#ifndef CHROME_BROWSER_UI_PAGE_INFO_WEBSITE_SETTINGS_INFOBAR_DELEGATE_H_
|
#ifndef CHROME_BROWSER_UI_PAGE_INFO_PAGE_INFO_INFOBAR_DELEGATE_H_
|
||||||
#define CHROME_BROWSER_UI_PAGE_INFO_WEBSITE_SETTINGS_INFOBAR_DELEGATE_H_
|
#define CHROME_BROWSER_UI_PAGE_INFO_PAGE_INFO_INFOBAR_DELEGATE_H_
|
||||||
|
|
||||||
#include "base/macros.h"
|
#include "base/macros.h"
|
||||||
#include "components/infobars/core/confirm_infobar_delegate.h"
|
#include "components/infobars/core/confirm_infobar_delegate.h"
|
||||||
|
|
||||||
class InfoBarService;
|
class InfoBarService;
|
||||||
|
|
||||||
// This class configures an infobar that is shown when the website settings UI
|
// This class configures an infobar that is shown when the page info UI
|
||||||
// is closed and the settings for one or more site permissions have been
|
// is closed and the settings for one or more site permissions have been
|
||||||
// changed. The user is shown a message indicating that a reload of the page is
|
// changed. The user is shown a message indicating that a reload of the page is
|
||||||
// required for the changes to take effect, and presented a button to perform
|
// required for the changes to take effect, and presented a button to perform
|
||||||
// the reload right from the infobar.
|
// the reload right from the infobar.
|
||||||
class WebsiteSettingsInfoBarDelegate : public ConfirmInfoBarDelegate {
|
class PageInfoInfoBarDelegate : public ConfirmInfoBarDelegate {
|
||||||
public:
|
public:
|
||||||
// Creates a website settings infobar and delegate and adds the infobar to
|
// Creates a page info infobar and delegate and adds the infobar to
|
||||||
// |infobar_service|.
|
// |infobar_service|.
|
||||||
static void Create(InfoBarService* infobar_service);
|
static void Create(InfoBarService* infobar_service);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
WebsiteSettingsInfoBarDelegate();
|
PageInfoInfoBarDelegate();
|
||||||
~WebsiteSettingsInfoBarDelegate() override;
|
~PageInfoInfoBarDelegate() override;
|
||||||
|
|
||||||
// ConfirmInfoBarDelegate:
|
// ConfirmInfoBarDelegate:
|
||||||
Type GetInfoBarType() const override;
|
Type GetInfoBarType() const override;
|
||||||
@@ -34,7 +34,7 @@ class WebsiteSettingsInfoBarDelegate : public ConfirmInfoBarDelegate {
|
|||||||
base::string16 GetButtonLabel(InfoBarButton button) const override;
|
base::string16 GetButtonLabel(InfoBarButton button) const override;
|
||||||
bool Accept() override;
|
bool Accept() override;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsInfoBarDelegate);
|
DISALLOW_COPY_AND_ASSIGN(PageInfoInfoBarDelegate);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CHROME_BROWSER_UI_PAGE_INFO_WEBSITE_SETTINGS_INFOBAR_DELEGATE_H_
|
#endif // CHROME_BROWSER_UI_PAGE_INFO_PAGE_INFO_INFOBAR_DELEGATE_H_
|
192
chrome/browser/ui/page_info/website_settings_ui.cc → chrome/browser/ui/page_info/page_info_ui.cc
192
chrome/browser/ui/page_info/website_settings_ui.cc → chrome/browser/ui/page_info/page_info_ui.cc
@@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#include "chrome/browser/ui/page_info/website_settings_ui.h"
|
#include "chrome/browser/ui/page_info/page_info_ui.h"
|
||||||
|
|
||||||
#include "base/macros.h"
|
#include "base/macros.h"
|
||||||
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
|
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
|
||||||
@@ -26,9 +26,9 @@ const int kInvalidResourceID = -1;
|
|||||||
// button if the permission setting is managed by policy.
|
// button if the permission setting is managed by policy.
|
||||||
const int kPermissionButtonTextIDPolicyManaged[] = {
|
const int kPermissionButtonTextIDPolicyManaged[] = {
|
||||||
kInvalidResourceID,
|
kInvalidResourceID,
|
||||||
IDS_WEBSITE_SETTINGS_BUTTON_TEXT_ALLOWED_BY_POLICY,
|
IDS_PAGE_INFO_BUTTON_TEXT_ALLOWED_BY_POLICY,
|
||||||
IDS_WEBSITE_SETTINGS_BUTTON_TEXT_BLOCKED_BY_POLICY,
|
IDS_PAGE_INFO_BUTTON_TEXT_BLOCKED_BY_POLICY,
|
||||||
IDS_WEBSITE_SETTINGS_BUTTON_TEXT_ASK_BY_POLICY,
|
IDS_PAGE_INFO_BUTTON_TEXT_ASK_BY_POLICY,
|
||||||
kInvalidResourceID,
|
kInvalidResourceID,
|
||||||
kInvalidResourceID};
|
kInvalidResourceID};
|
||||||
static_assert(arraysize(kPermissionButtonTextIDPolicyManaged) ==
|
static_assert(arraysize(kPermissionButtonTextIDPolicyManaged) ==
|
||||||
@@ -39,8 +39,8 @@ static_assert(arraysize(kPermissionButtonTextIDPolicyManaged) ==
|
|||||||
// button if the permission setting is managed by an extension.
|
// button if the permission setting is managed by an extension.
|
||||||
const int kPermissionButtonTextIDExtensionManaged[] = {
|
const int kPermissionButtonTextIDExtensionManaged[] = {
|
||||||
kInvalidResourceID,
|
kInvalidResourceID,
|
||||||
IDS_WEBSITE_SETTINGS_BUTTON_TEXT_ALLOWED_BY_EXTENSION,
|
IDS_PAGE_INFO_BUTTON_TEXT_ALLOWED_BY_EXTENSION,
|
||||||
IDS_WEBSITE_SETTINGS_BUTTON_TEXT_BLOCKED_BY_EXTENSION,
|
IDS_PAGE_INFO_BUTTON_TEXT_BLOCKED_BY_EXTENSION,
|
||||||
kInvalidResourceID,
|
kInvalidResourceID,
|
||||||
kInvalidResourceID,
|
kInvalidResourceID,
|
||||||
kInvalidResourceID};
|
kInvalidResourceID};
|
||||||
@@ -53,11 +53,11 @@ static_assert(arraysize(kPermissionButtonTextIDExtensionManaged) ==
|
|||||||
// button if the permission setting is managed by the user.
|
// button if the permission setting is managed by the user.
|
||||||
const int kPermissionButtonTextIDUserManaged[] = {
|
const int kPermissionButtonTextIDUserManaged[] = {
|
||||||
kInvalidResourceID,
|
kInvalidResourceID,
|
||||||
IDS_WEBSITE_SETTINGS_BUTTON_TEXT_ALLOWED_BY_USER,
|
IDS_PAGE_INFO_BUTTON_TEXT_ALLOWED_BY_USER,
|
||||||
IDS_WEBSITE_SETTINGS_BUTTON_TEXT_BLOCKED_BY_USER,
|
IDS_PAGE_INFO_BUTTON_TEXT_BLOCKED_BY_USER,
|
||||||
IDS_WEBSITE_SETTINGS_BUTTON_TEXT_ASK_BY_USER,
|
IDS_PAGE_INFO_BUTTON_TEXT_ASK_BY_USER,
|
||||||
kInvalidResourceID,
|
kInvalidResourceID,
|
||||||
IDS_WEBSITE_SETTINGS_BUTTON_TEXT_DETECT_IMPORTANT_CONTENT_BY_USER};
|
IDS_PAGE_INFO_BUTTON_TEXT_DETECT_IMPORTANT_CONTENT_BY_USER};
|
||||||
static_assert(arraysize(kPermissionButtonTextIDUserManaged) ==
|
static_assert(arraysize(kPermissionButtonTextIDUserManaged) ==
|
||||||
CONTENT_SETTING_NUM_SETTINGS,
|
CONTENT_SETTING_NUM_SETTINGS,
|
||||||
"kPermissionButtonTextIDUserManaged array size is incorrect");
|
"kPermissionButtonTextIDUserManaged array size is incorrect");
|
||||||
@@ -66,11 +66,11 @@ static_assert(arraysize(kPermissionButtonTextIDUserManaged) ==
|
|||||||
// button if the permission setting is the global default setting.
|
// button if the permission setting is the global default setting.
|
||||||
const int kPermissionButtonTextIDDefaultSetting[] = {
|
const int kPermissionButtonTextIDDefaultSetting[] = {
|
||||||
kInvalidResourceID,
|
kInvalidResourceID,
|
||||||
IDS_WEBSITE_SETTINGS_BUTTON_TEXT_ALLOWED_BY_DEFAULT,
|
IDS_PAGE_INFO_BUTTON_TEXT_ALLOWED_BY_DEFAULT,
|
||||||
IDS_WEBSITE_SETTINGS_BUTTON_TEXT_BLOCKED_BY_DEFAULT,
|
IDS_PAGE_INFO_BUTTON_TEXT_BLOCKED_BY_DEFAULT,
|
||||||
IDS_WEBSITE_SETTINGS_BUTTON_TEXT_ASK_BY_DEFAULT,
|
IDS_PAGE_INFO_BUTTON_TEXT_ASK_BY_DEFAULT,
|
||||||
kInvalidResourceID,
|
kInvalidResourceID,
|
||||||
IDS_WEBSITE_SETTINGS_BUTTON_TEXT_DETECT_IMPORTANT_CONTENT_BY_DEFAULT};
|
IDS_PAGE_INFO_BUTTON_TEXT_DETECT_IMPORTANT_CONTENT_BY_DEFAULT};
|
||||||
static_assert(arraysize(kPermissionButtonTextIDDefaultSetting) ==
|
static_assert(arraysize(kPermissionButtonTextIDDefaultSetting) ==
|
||||||
CONTENT_SETTING_NUM_SETTINGS,
|
CONTENT_SETTING_NUM_SETTINGS,
|
||||||
"kPermissionButtonTextIDDefaultSetting array size is incorrect");
|
"kPermissionButtonTextIDDefaultSetting array size is incorrect");
|
||||||
@@ -85,121 +85,117 @@ struct PermissionsUIInfo {
|
|||||||
const PermissionsUIInfo kPermissionsUIInfo[] = {
|
const PermissionsUIInfo kPermissionsUIInfo[] = {
|
||||||
{CONTENT_SETTINGS_TYPE_COOKIES, 0, IDR_BLOCKED_COOKIES,
|
{CONTENT_SETTINGS_TYPE_COOKIES, 0, IDR_BLOCKED_COOKIES,
|
||||||
IDR_ACCESSED_COOKIES},
|
IDR_ACCESSED_COOKIES},
|
||||||
{CONTENT_SETTINGS_TYPE_IMAGES, IDS_WEBSITE_SETTINGS_TYPE_IMAGES,
|
{CONTENT_SETTINGS_TYPE_IMAGES, IDS_PAGE_INFO_TYPE_IMAGES,
|
||||||
IDR_BLOCKED_IMAGES, IDR_ALLOWED_IMAGES},
|
IDR_BLOCKED_IMAGES, IDR_ALLOWED_IMAGES},
|
||||||
{CONTENT_SETTINGS_TYPE_JAVASCRIPT, IDS_WEBSITE_SETTINGS_TYPE_JAVASCRIPT,
|
{CONTENT_SETTINGS_TYPE_JAVASCRIPT, IDS_PAGE_INFO_TYPE_JAVASCRIPT,
|
||||||
IDR_BLOCKED_JAVASCRIPT, IDR_ALLOWED_JAVASCRIPT},
|
IDR_BLOCKED_JAVASCRIPT, IDR_ALLOWED_JAVASCRIPT},
|
||||||
{CONTENT_SETTINGS_TYPE_POPUPS, IDS_WEBSITE_SETTINGS_TYPE_POPUPS,
|
{CONTENT_SETTINGS_TYPE_POPUPS, IDS_PAGE_INFO_TYPE_POPUPS,
|
||||||
IDR_BLOCKED_POPUPS, IDR_ALLOWED_POPUPS},
|
IDR_BLOCKED_POPUPS, IDR_ALLOWED_POPUPS},
|
||||||
#if BUILDFLAG(ENABLE_PLUGINS)
|
#if BUILDFLAG(ENABLE_PLUGINS)
|
||||||
{CONTENT_SETTINGS_TYPE_PLUGINS, IDS_WEBSITE_SETTINGS_TYPE_FLASH,
|
{CONTENT_SETTINGS_TYPE_PLUGINS, IDS_PAGE_INFO_TYPE_FLASH,
|
||||||
IDR_BLOCKED_PLUGINS, IDR_ALLOWED_PLUGINS},
|
IDR_BLOCKED_PLUGINS, IDR_ALLOWED_PLUGINS},
|
||||||
#endif
|
#endif
|
||||||
{CONTENT_SETTINGS_TYPE_GEOLOCATION, IDS_WEBSITE_SETTINGS_TYPE_LOCATION,
|
{CONTENT_SETTINGS_TYPE_GEOLOCATION, IDS_PAGE_INFO_TYPE_LOCATION,
|
||||||
IDR_BLOCKED_LOCATION, IDR_ALLOWED_LOCATION},
|
IDR_BLOCKED_LOCATION, IDR_ALLOWED_LOCATION},
|
||||||
{CONTENT_SETTINGS_TYPE_NOTIFICATIONS,
|
{CONTENT_SETTINGS_TYPE_NOTIFICATIONS, IDS_PAGE_INFO_TYPE_NOTIFICATIONS,
|
||||||
IDS_WEBSITE_SETTINGS_TYPE_NOTIFICATIONS, IDR_BLOCKED_NOTIFICATION,
|
IDR_BLOCKED_NOTIFICATION, IDR_ALLOWED_NOTIFICATION},
|
||||||
IDR_ALLOWED_NOTIFICATION},
|
{CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, IDS_PAGE_INFO_TYPE_MIC,
|
||||||
{CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, IDS_WEBSITE_SETTINGS_TYPE_MIC,
|
|
||||||
IDR_BLOCKED_MIC, IDR_ALLOWED_MIC},
|
IDR_BLOCKED_MIC, IDR_ALLOWED_MIC},
|
||||||
{CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, IDS_WEBSITE_SETTINGS_TYPE_CAMERA,
|
{CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, IDS_PAGE_INFO_TYPE_CAMERA,
|
||||||
IDR_BLOCKED_CAMERA, IDR_ALLOWED_CAMERA},
|
IDR_BLOCKED_CAMERA, IDR_ALLOWED_CAMERA},
|
||||||
{CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS,
|
{CONTENT_SETTINGS_TYPE_AUTOMATIC_DOWNLOADS,
|
||||||
IDS_AUTOMATIC_DOWNLOADS_TAB_LABEL, IDR_BLOCKED_DOWNLOADS,
|
IDS_AUTOMATIC_DOWNLOADS_TAB_LABEL, IDR_BLOCKED_DOWNLOADS,
|
||||||
IDR_ALLOWED_DOWNLOADS},
|
IDR_ALLOWED_DOWNLOADS},
|
||||||
{CONTENT_SETTINGS_TYPE_MIDI_SYSEX, IDS_WEBSITE_SETTINGS_TYPE_MIDI_SYSEX,
|
{CONTENT_SETTINGS_TYPE_MIDI_SYSEX, IDS_PAGE_INFO_TYPE_MIDI_SYSEX,
|
||||||
IDR_BLOCKED_MIDI_SYSEX, IDR_ALLOWED_MIDI_SYSEX},
|
IDR_BLOCKED_MIDI_SYSEX, IDR_ALLOWED_MIDI_SYSEX},
|
||||||
{CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC,
|
{CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC, IDS_PAGE_INFO_TYPE_BACKGROUND_SYNC,
|
||||||
IDS_WEBSITE_SETTINGS_TYPE_BACKGROUND_SYNC, IDR_BLOCKED_BACKGROUND_SYNC,
|
IDR_BLOCKED_BACKGROUND_SYNC, IDR_ALLOWED_BACKGROUND_SYNC},
|
||||||
IDR_ALLOWED_BACKGROUND_SYNC},
|
|
||||||
// Autoplay is Android-only at the moment, and the Origin Info bubble in
|
// Autoplay is Android-only at the moment, and the Origin Info bubble in
|
||||||
// Android ignores these block/allow icon pairs, so we can specify 0 there.
|
// Android ignores these block/allow icon pairs, so we can specify 0 there.
|
||||||
{CONTENT_SETTINGS_TYPE_AUTOPLAY, IDS_WEBSITE_SETTINGS_TYPE_AUTOPLAY, 0, 0},
|
{CONTENT_SETTINGS_TYPE_AUTOPLAY, IDS_PAGE_INFO_TYPE_AUTOPLAY, 0, 0},
|
||||||
};
|
};
|
||||||
|
|
||||||
std::unique_ptr<WebsiteSettingsUI::SecurityDescription>
|
std::unique_ptr<PageInfoUI::SecurityDescription> CreateSecurityDescription(
|
||||||
CreateSecurityDescription(int summary_id, int details_id) {
|
int summary_id,
|
||||||
std::unique_ptr<WebsiteSettingsUI::SecurityDescription> security_description(
|
int details_id) {
|
||||||
new WebsiteSettingsUI::SecurityDescription());
|
std::unique_ptr<PageInfoUI::SecurityDescription> security_description(
|
||||||
|
new PageInfoUI::SecurityDescription());
|
||||||
security_description->summary = l10n_util::GetStringUTF16(summary_id);
|
security_description->summary = l10n_util::GetStringUTF16(summary_id);
|
||||||
security_description->details = l10n_util::GetStringUTF16(details_id);
|
security_description->details = l10n_util::GetStringUTF16(details_id);
|
||||||
return security_description;
|
return security_description;
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
WebsiteSettingsUI::CookieInfo::CookieInfo() : allowed(-1), blocked(-1) {}
|
PageInfoUI::CookieInfo::CookieInfo() : allowed(-1), blocked(-1) {}
|
||||||
|
|
||||||
WebsiteSettingsUI::PermissionInfo::PermissionInfo()
|
PageInfoUI::PermissionInfo::PermissionInfo()
|
||||||
: type(CONTENT_SETTINGS_TYPE_DEFAULT),
|
: type(CONTENT_SETTINGS_TYPE_DEFAULT),
|
||||||
setting(CONTENT_SETTING_DEFAULT),
|
setting(CONTENT_SETTING_DEFAULT),
|
||||||
default_setting(CONTENT_SETTING_DEFAULT),
|
default_setting(CONTENT_SETTING_DEFAULT),
|
||||||
source(content_settings::SETTING_SOURCE_NONE),
|
source(content_settings::SETTING_SOURCE_NONE),
|
||||||
is_incognito(false) {}
|
is_incognito(false) {}
|
||||||
|
|
||||||
WebsiteSettingsUI::ChosenObjectInfo::ChosenObjectInfo(
|
PageInfoUI::ChosenObjectInfo::ChosenObjectInfo(
|
||||||
const WebsiteSettings::ChooserUIInfo& ui_info,
|
const PageInfo::ChooserUIInfo& ui_info,
|
||||||
std::unique_ptr<base::DictionaryValue> object)
|
std::unique_ptr<base::DictionaryValue> object)
|
||||||
: ui_info(ui_info), object(std::move(object)) {}
|
: ui_info(ui_info), object(std::move(object)) {}
|
||||||
|
|
||||||
WebsiteSettingsUI::ChosenObjectInfo::~ChosenObjectInfo() {}
|
PageInfoUI::ChosenObjectInfo::~ChosenObjectInfo() {}
|
||||||
|
|
||||||
WebsiteSettingsUI::IdentityInfo::IdentityInfo()
|
PageInfoUI::IdentityInfo::IdentityInfo()
|
||||||
: identity_status(WebsiteSettings::SITE_IDENTITY_STATUS_UNKNOWN),
|
: identity_status(PageInfo::SITE_IDENTITY_STATUS_UNKNOWN),
|
||||||
connection_status(WebsiteSettings::SITE_CONNECTION_STATUS_UNKNOWN),
|
connection_status(PageInfo::SITE_CONNECTION_STATUS_UNKNOWN),
|
||||||
show_ssl_decision_revoke_button(false) {}
|
show_ssl_decision_revoke_button(false) {}
|
||||||
|
|
||||||
WebsiteSettingsUI::IdentityInfo::~IdentityInfo() {}
|
PageInfoUI::IdentityInfo::~IdentityInfo() {}
|
||||||
|
|
||||||
std::unique_ptr<WebsiteSettingsUI::SecurityDescription>
|
std::unique_ptr<PageInfoUI::SecurityDescription>
|
||||||
WebsiteSettingsUI::IdentityInfo::GetSecurityDescription() const {
|
PageInfoUI::IdentityInfo::GetSecurityDescription() const {
|
||||||
std::unique_ptr<WebsiteSettingsUI::SecurityDescription> security_description(
|
std::unique_ptr<PageInfoUI::SecurityDescription> security_description(
|
||||||
new WebsiteSettingsUI::SecurityDescription());
|
new PageInfoUI::SecurityDescription());
|
||||||
|
|
||||||
switch (identity_status) {
|
switch (identity_status) {
|
||||||
case WebsiteSettings::SITE_IDENTITY_STATUS_INTERNAL_PAGE:
|
case PageInfo::SITE_IDENTITY_STATUS_INTERNAL_PAGE:
|
||||||
// Internal pages have their own UI implementations which should never
|
// Internal pages have their own UI implementations which should never
|
||||||
// call this function.
|
// call this function.
|
||||||
NOTREACHED();
|
NOTREACHED();
|
||||||
case WebsiteSettings::SITE_IDENTITY_STATUS_CERT:
|
case PageInfo::SITE_IDENTITY_STATUS_CERT:
|
||||||
case WebsiteSettings::SITE_IDENTITY_STATUS_EV_CERT:
|
case PageInfo::SITE_IDENTITY_STATUS_EV_CERT:
|
||||||
case WebsiteSettings::SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN:
|
case PageInfo::SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN:
|
||||||
case WebsiteSettings::SITE_IDENTITY_STATUS_ADMIN_PROVIDED_CERT:
|
case PageInfo::SITE_IDENTITY_STATUS_ADMIN_PROVIDED_CERT:
|
||||||
switch (connection_status) {
|
switch (connection_status) {
|
||||||
case WebsiteSettings::
|
case PageInfo::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE:
|
||||||
SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE:
|
|
||||||
return CreateSecurityDescription(IDS_PAGEINFO_NOT_SECURE_SUMMARY,
|
return CreateSecurityDescription(IDS_PAGEINFO_NOT_SECURE_SUMMARY,
|
||||||
IDS_PAGEINFO_NOT_SECURE_DETAILS);
|
IDS_PAGEINFO_NOT_SECURE_DETAILS);
|
||||||
case WebsiteSettings::
|
case PageInfo::SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE:
|
||||||
SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE:
|
|
||||||
return CreateSecurityDescription(IDS_PAGEINFO_MIXED_CONTENT_SUMMARY,
|
return CreateSecurityDescription(IDS_PAGEINFO_MIXED_CONTENT_SUMMARY,
|
||||||
IDS_PAGEINFO_MIXED_CONTENT_DETAILS);
|
IDS_PAGEINFO_MIXED_CONTENT_DETAILS);
|
||||||
default:
|
default:
|
||||||
return CreateSecurityDescription(IDS_PAGEINFO_SECURE_SUMMARY,
|
return CreateSecurityDescription(IDS_PAGEINFO_SECURE_SUMMARY,
|
||||||
IDS_PAGEINFO_SECURE_DETAILS);
|
IDS_PAGEINFO_SECURE_DETAILS);
|
||||||
}
|
}
|
||||||
case WebsiteSettings::SITE_IDENTITY_STATUS_MALWARE:
|
case PageInfo::SITE_IDENTITY_STATUS_MALWARE:
|
||||||
return CreateSecurityDescription(IDS_PAGEINFO_MALWARE_SUMMARY,
|
return CreateSecurityDescription(IDS_PAGEINFO_MALWARE_SUMMARY,
|
||||||
IDS_PAGEINFO_MALWARE_DETAILS);
|
IDS_PAGEINFO_MALWARE_DETAILS);
|
||||||
case WebsiteSettings::SITE_IDENTITY_STATUS_SOCIAL_ENGINEERING:
|
case PageInfo::SITE_IDENTITY_STATUS_SOCIAL_ENGINEERING:
|
||||||
return CreateSecurityDescription(IDS_PAGEINFO_SOCIAL_ENGINEERING_SUMMARY,
|
return CreateSecurityDescription(IDS_PAGEINFO_SOCIAL_ENGINEERING_SUMMARY,
|
||||||
IDS_PAGEINFO_SOCIAL_ENGINEERING_DETAILS);
|
IDS_PAGEINFO_SOCIAL_ENGINEERING_DETAILS);
|
||||||
case WebsiteSettings::SITE_IDENTITY_STATUS_UNWANTED_SOFTWARE:
|
case PageInfo::SITE_IDENTITY_STATUS_UNWANTED_SOFTWARE:
|
||||||
return CreateSecurityDescription(IDS_PAGEINFO_UNWANTED_SOFTWARE_SUMMARY,
|
return CreateSecurityDescription(IDS_PAGEINFO_UNWANTED_SOFTWARE_SUMMARY,
|
||||||
IDS_PAGEINFO_UNWANTED_SOFTWARE_DETAILS);
|
IDS_PAGEINFO_UNWANTED_SOFTWARE_DETAILS);
|
||||||
case WebsiteSettings::SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM:
|
case PageInfo::SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM:
|
||||||
case WebsiteSettings::SITE_IDENTITY_STATUS_UNKNOWN:
|
case PageInfo::SITE_IDENTITY_STATUS_UNKNOWN:
|
||||||
case WebsiteSettings::SITE_IDENTITY_STATUS_NO_CERT:
|
case PageInfo::SITE_IDENTITY_STATUS_NO_CERT:
|
||||||
default:
|
default:
|
||||||
return CreateSecurityDescription(IDS_PAGEINFO_NOT_SECURE_SUMMARY,
|
return CreateSecurityDescription(IDS_PAGEINFO_NOT_SECURE_SUMMARY,
|
||||||
IDS_PAGEINFO_NOT_SECURE_DETAILS);
|
IDS_PAGEINFO_NOT_SECURE_DETAILS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WebsiteSettingsUI::~WebsiteSettingsUI() {}
|
PageInfoUI::~PageInfoUI() {}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
base::string16 WebsiteSettingsUI::PermissionTypeToUIString(
|
base::string16 PageInfoUI::PermissionTypeToUIString(ContentSettingsType type) {
|
||||||
ContentSettingsType type) {
|
|
||||||
for (const PermissionsUIInfo& info : kPermissionsUIInfo) {
|
for (const PermissionsUIInfo& info : kPermissionsUIInfo) {
|
||||||
if (info.type == type)
|
if (info.type == type)
|
||||||
return l10n_util::GetStringUTF16(info.string_id);
|
return l10n_util::GetStringUTF16(info.string_id);
|
||||||
@@ -209,15 +205,14 @@ base::string16 WebsiteSettingsUI::PermissionTypeToUIString(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
base::string16 WebsiteSettingsUI::PermissionValueToUIString(
|
base::string16 PageInfoUI::PermissionValueToUIString(ContentSetting value) {
|
||||||
ContentSetting value) {
|
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case CONTENT_SETTING_ALLOW:
|
case CONTENT_SETTING_ALLOW:
|
||||||
return l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_PERMISSION_ALLOW);
|
return l10n_util::GetStringUTF16(IDS_PAGE_INFO_PERMISSION_ALLOW);
|
||||||
case CONTENT_SETTING_BLOCK:
|
case CONTENT_SETTING_BLOCK:
|
||||||
return l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_PERMISSION_BLOCK);
|
return l10n_util::GetStringUTF16(IDS_PAGE_INFO_PERMISSION_BLOCK);
|
||||||
case CONTENT_SETTING_ASK:
|
case CONTENT_SETTING_ASK:
|
||||||
return l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_PERMISSION_ASK);
|
return l10n_util::GetStringUTF16(IDS_PAGE_INFO_PERMISSION_ASK);
|
||||||
default:
|
default:
|
||||||
NOTREACHED();
|
NOTREACHED();
|
||||||
return base::string16();
|
return base::string16();
|
||||||
@@ -225,7 +220,7 @@ base::string16 WebsiteSettingsUI::PermissionValueToUIString(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
base::string16 WebsiteSettingsUI::PermissionActionToUIString(
|
base::string16 PageInfoUI::PermissionActionToUIString(
|
||||||
Profile* profile,
|
Profile* profile,
|
||||||
ContentSettingsType type,
|
ContentSettingsType type,
|
||||||
ContentSetting setting,
|
ContentSetting setting,
|
||||||
@@ -276,8 +271,8 @@ base::string16 WebsiteSettingsUI::PermissionActionToUIString(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
int WebsiteSettingsUI::GetPermissionIconID(ContentSettingsType type,
|
int PageInfoUI::GetPermissionIconID(ContentSettingsType type,
|
||||||
ContentSetting setting) {
|
ContentSetting setting) {
|
||||||
bool use_blocked = (setting == CONTENT_SETTING_BLOCK);
|
bool use_blocked = (setting == CONTENT_SETTING_BLOCK);
|
||||||
for (const PermissionsUIInfo& info : kPermissionsUIInfo) {
|
for (const PermissionsUIInfo& info : kPermissionsUIInfo) {
|
||||||
if (info.type == type)
|
if (info.type == type)
|
||||||
@@ -288,8 +283,7 @@ int WebsiteSettingsUI::GetPermissionIconID(ContentSettingsType type,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
const gfx::Image& WebsiteSettingsUI::GetPermissionIcon(
|
const gfx::Image& PageInfoUI::GetPermissionIcon(const PermissionInfo& info) {
|
||||||
const PermissionInfo& info) {
|
|
||||||
ContentSetting setting = info.setting;
|
ContentSetting setting = info.setting;
|
||||||
if (setting == CONTENT_SETTING_DEFAULT)
|
if (setting == CONTENT_SETTING_DEFAULT)
|
||||||
setting = info.default_setting;
|
setting = info.default_setting;
|
||||||
@@ -298,7 +292,7 @@ const gfx::Image& WebsiteSettingsUI::GetPermissionIcon(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
base::string16 WebsiteSettingsUI::ChosenObjectToUIString(
|
base::string16 PageInfoUI::ChosenObjectToUIString(
|
||||||
const ChosenObjectInfo& object) {
|
const ChosenObjectInfo& object) {
|
||||||
base::string16 name;
|
base::string16 name;
|
||||||
object.object->GetString(object.ui_info.ui_name_key, &name);
|
object.object->GetString(object.ui_info.ui_name_key, &name);
|
||||||
@@ -306,7 +300,7 @@ base::string16 WebsiteSettingsUI::ChosenObjectToUIString(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
const gfx::Image& WebsiteSettingsUI::GetChosenObjectIcon(
|
const gfx::Image& PageInfoUI::GetChosenObjectIcon(
|
||||||
const ChosenObjectInfo& object,
|
const ChosenObjectInfo& object,
|
||||||
bool deleted) {
|
bool deleted) {
|
||||||
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
|
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
|
||||||
@@ -315,30 +309,29 @@ const gfx::Image& WebsiteSettingsUI::GetChosenObjectIcon(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
int WebsiteSettingsUI::GetIdentityIconID(
|
int PageInfoUI::GetIdentityIconID(PageInfo::SiteIdentityStatus status) {
|
||||||
WebsiteSettings::SiteIdentityStatus status) {
|
|
||||||
int resource_id = IDR_PAGEINFO_INFO;
|
int resource_id = IDR_PAGEINFO_INFO;
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case WebsiteSettings::SITE_IDENTITY_STATUS_UNKNOWN:
|
case PageInfo::SITE_IDENTITY_STATUS_UNKNOWN:
|
||||||
case WebsiteSettings::SITE_IDENTITY_STATUS_INTERNAL_PAGE:
|
case PageInfo::SITE_IDENTITY_STATUS_INTERNAL_PAGE:
|
||||||
break;
|
break;
|
||||||
case WebsiteSettings::SITE_IDENTITY_STATUS_CERT:
|
case PageInfo::SITE_IDENTITY_STATUS_CERT:
|
||||||
case WebsiteSettings::SITE_IDENTITY_STATUS_EV_CERT:
|
case PageInfo::SITE_IDENTITY_STATUS_EV_CERT:
|
||||||
resource_id = IDR_PAGEINFO_GOOD;
|
resource_id = IDR_PAGEINFO_GOOD;
|
||||||
break;
|
break;
|
||||||
case WebsiteSettings::SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN:
|
case PageInfo::SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN:
|
||||||
resource_id = IDR_PAGEINFO_WARNING_MINOR;
|
resource_id = IDR_PAGEINFO_WARNING_MINOR;
|
||||||
break;
|
break;
|
||||||
case WebsiteSettings::SITE_IDENTITY_STATUS_NO_CERT:
|
case PageInfo::SITE_IDENTITY_STATUS_NO_CERT:
|
||||||
resource_id = IDR_PAGEINFO_WARNING_MAJOR;
|
resource_id = IDR_PAGEINFO_WARNING_MAJOR;
|
||||||
break;
|
break;
|
||||||
case WebsiteSettings::SITE_IDENTITY_STATUS_ERROR:
|
case PageInfo::SITE_IDENTITY_STATUS_ERROR:
|
||||||
resource_id = IDR_PAGEINFO_BAD;
|
resource_id = IDR_PAGEINFO_BAD;
|
||||||
break;
|
break;
|
||||||
case WebsiteSettings::SITE_IDENTITY_STATUS_ADMIN_PROVIDED_CERT:
|
case PageInfo::SITE_IDENTITY_STATUS_ADMIN_PROVIDED_CERT:
|
||||||
resource_id = IDR_PAGEINFO_ENTERPRISE_MANAGED;
|
resource_id = IDR_PAGEINFO_ENTERPRISE_MANAGED;
|
||||||
break;
|
break;
|
||||||
case WebsiteSettings::SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM:
|
case PageInfo::SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM:
|
||||||
resource_id = IDR_PAGEINFO_WARNING_MINOR;
|
resource_id = IDR_PAGEINFO_WARNING_MINOR;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -349,31 +342,30 @@ int WebsiteSettingsUI::GetIdentityIconID(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
const gfx::Image& WebsiteSettingsUI::GetIdentityIcon(
|
const gfx::Image& PageInfoUI::GetIdentityIcon(
|
||||||
WebsiteSettings::SiteIdentityStatus status) {
|
PageInfo::SiteIdentityStatus status) {
|
||||||
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
|
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
|
||||||
return rb.GetNativeImageNamed(GetIdentityIconID(status));
|
return rb.GetNativeImageNamed(GetIdentityIconID(status));
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
int WebsiteSettingsUI::GetConnectionIconID(
|
int PageInfoUI::GetConnectionIconID(PageInfo::SiteConnectionStatus status) {
|
||||||
WebsiteSettings::SiteConnectionStatus status) {
|
|
||||||
int resource_id = IDR_PAGEINFO_INFO;
|
int resource_id = IDR_PAGEINFO_INFO;
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case WebsiteSettings::SITE_CONNECTION_STATUS_UNKNOWN:
|
case PageInfo::SITE_CONNECTION_STATUS_UNKNOWN:
|
||||||
case WebsiteSettings::SITE_CONNECTION_STATUS_INTERNAL_PAGE:
|
case PageInfo::SITE_CONNECTION_STATUS_INTERNAL_PAGE:
|
||||||
break;
|
break;
|
||||||
case WebsiteSettings::SITE_CONNECTION_STATUS_ENCRYPTED:
|
case PageInfo::SITE_CONNECTION_STATUS_ENCRYPTED:
|
||||||
resource_id = IDR_PAGEINFO_GOOD;
|
resource_id = IDR_PAGEINFO_GOOD;
|
||||||
break;
|
break;
|
||||||
case WebsiteSettings::SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE:
|
case PageInfo::SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE:
|
||||||
resource_id = IDR_PAGEINFO_WARNING_MINOR;
|
resource_id = IDR_PAGEINFO_WARNING_MINOR;
|
||||||
break;
|
break;
|
||||||
case WebsiteSettings::SITE_CONNECTION_STATUS_UNENCRYPTED:
|
case PageInfo::SITE_CONNECTION_STATUS_UNENCRYPTED:
|
||||||
resource_id = IDR_PAGEINFO_WARNING_MAJOR;
|
resource_id = IDR_PAGEINFO_WARNING_MAJOR;
|
||||||
break;
|
break;
|
||||||
case WebsiteSettings::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE:
|
case PageInfo::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE:
|
||||||
case WebsiteSettings::SITE_CONNECTION_STATUS_ENCRYPTED_ERROR:
|
case PageInfo::SITE_CONNECTION_STATUS_ENCRYPTED_ERROR:
|
||||||
resource_id = IDR_PAGEINFO_BAD;
|
resource_id = IDR_PAGEINFO_BAD;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -381,8 +373,8 @@ int WebsiteSettingsUI::GetConnectionIconID(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
const gfx::Image& WebsiteSettingsUI::GetConnectionIcon(
|
const gfx::Image& PageInfoUI::GetConnectionIcon(
|
||||||
WebsiteSettings::SiteConnectionStatus status) {
|
PageInfo::SiteConnectionStatus status) {
|
||||||
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
|
ResourceBundle& rb = ResourceBundle::GetSharedInstance();
|
||||||
return rb.GetNativeImageNamed(GetConnectionIconID(status));
|
return rb.GetNativeImageNamed(GetConnectionIconID(status));
|
||||||
}
|
}
|
@@ -2,21 +2,21 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#ifndef CHROME_BROWSER_UI_PAGE_INFO_WEBSITE_SETTINGS_UI_H_
|
#ifndef CHROME_BROWSER_UI_PAGE_INFO_PAGE_INFO_UI_H_
|
||||||
#define CHROME_BROWSER_UI_PAGE_INFO_WEBSITE_SETTINGS_UI_H_
|
#define CHROME_BROWSER_UI_PAGE_INFO_PAGE_INFO_UI_H_
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#include "base/strings/string16.h"
|
#include "base/strings/string16.h"
|
||||||
#include "chrome/browser/ui/page_info/website_settings.h"
|
#include "chrome/browser/ui/page_info/page_info.h"
|
||||||
#include "components/content_settings/core/common/content_settings.h"
|
#include "components/content_settings/core/common/content_settings.h"
|
||||||
#include "components/content_settings/core/common/content_settings_types.h"
|
#include "components/content_settings/core/common/content_settings_types.h"
|
||||||
#include "ui/gfx/native_widget_types.h"
|
#include "ui/gfx/native_widget_types.h"
|
||||||
|
|
||||||
class Profile;
|
class Profile;
|
||||||
class WebsiteSettings;
|
class PageInfo;
|
||||||
|
|
||||||
namespace gfx {
|
namespace gfx {
|
||||||
class Image;
|
class Image;
|
||||||
@@ -26,15 +26,15 @@ namespace net {
|
|||||||
class X509Certificate;
|
class X509Certificate;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The class |WebsiteSettingsUI| specifies the platform independent
|
// The class |PageInfoUI| specifies the platform independent
|
||||||
// interface of the website settings UI. The website settings UI displays
|
// interface of the page info UI. The page info UI displays
|
||||||
// information and controls for site specific data (local stored objects like
|
// information and controls for site specific data (local stored objects like
|
||||||
// cookies), site specific permissions (location, popup, plugin, etc.
|
// cookies), site specific permissions (location, popup, plugin, etc.
|
||||||
// permissions) and site specific information (identity, connection status,
|
// permissions) and site specific information (identity, connection status,
|
||||||
// etc.).
|
// etc.).
|
||||||
class WebsiteSettingsUI {
|
class PageInfoUI {
|
||||||
public:
|
public:
|
||||||
// The Website Settings UI contains several tabs. Each tab is associated with
|
// The Page Info UI contains several tabs. Each tab is associated with
|
||||||
// a unique tab id. The enum |TabId| contains all the ids for the tabs.
|
// a unique tab id. The enum |TabId| contains all the ids for the tabs.
|
||||||
enum TabId {
|
enum TabId {
|
||||||
TAB_ID_PERMISSIONS = 0,
|
TAB_ID_PERMISSIONS = 0,
|
||||||
@@ -89,11 +89,11 @@ class WebsiteSettingsUI {
|
|||||||
// |ChosenObjectInfo| contains information about a single |object| of a
|
// |ChosenObjectInfo| contains information about a single |object| of a
|
||||||
// chooser |type| that the current website has been granted access to.
|
// chooser |type| that the current website has been granted access to.
|
||||||
struct ChosenObjectInfo {
|
struct ChosenObjectInfo {
|
||||||
ChosenObjectInfo(const WebsiteSettings::ChooserUIInfo& ui_info,
|
ChosenObjectInfo(const PageInfo::ChooserUIInfo& ui_info,
|
||||||
std::unique_ptr<base::DictionaryValue> object);
|
std::unique_ptr<base::DictionaryValue> object);
|
||||||
~ChosenObjectInfo();
|
~ChosenObjectInfo();
|
||||||
// |ui_info| for this chosen object type.
|
// |ui_info| for this chosen object type.
|
||||||
const WebsiteSettings::ChooserUIInfo& ui_info;
|
const PageInfo::ChooserUIInfo& ui_info;
|
||||||
// The opaque |object| representing the thing the user selected.
|
// The opaque |object| representing the thing the user selected.
|
||||||
std::unique_ptr<base::DictionaryValue> object;
|
std::unique_ptr<base::DictionaryValue> object;
|
||||||
};
|
};
|
||||||
@@ -109,7 +109,7 @@ class WebsiteSettingsUI {
|
|||||||
// sites.
|
// sites.
|
||||||
std::string site_identity;
|
std::string site_identity;
|
||||||
// Status of the site's identity.
|
// Status of the site's identity.
|
||||||
WebsiteSettings::SiteIdentityStatus identity_status;
|
PageInfo::SiteIdentityStatus identity_status;
|
||||||
// Helper to get security description info to display to the user.
|
// Helper to get security description info to display to the user.
|
||||||
std::unique_ptr<SecurityDescription> GetSecurityDescription() const;
|
std::unique_ptr<SecurityDescription> GetSecurityDescription() const;
|
||||||
// Textual description of the site's identity status that is displayed to
|
// Textual description of the site's identity status that is displayed to
|
||||||
@@ -118,7 +118,7 @@ class WebsiteSettingsUI {
|
|||||||
// The server certificate if a secure connection.
|
// The server certificate if a secure connection.
|
||||||
scoped_refptr<net::X509Certificate> certificate;
|
scoped_refptr<net::X509Certificate> certificate;
|
||||||
// Status of the site's connection.
|
// Status of the site's connection.
|
||||||
WebsiteSettings::SiteConnectionStatus connection_status;
|
PageInfo::SiteConnectionStatus connection_status;
|
||||||
// Textual description of the site's connection status that is displayed to
|
// Textual description of the site's connection status that is displayed to
|
||||||
// the user.
|
// the user.
|
||||||
std::string connection_status_description;
|
std::string connection_status_description;
|
||||||
@@ -134,7 +134,7 @@ class WebsiteSettingsUI {
|
|||||||
using PermissionInfoList = std::vector<PermissionInfo>;
|
using PermissionInfoList = std::vector<PermissionInfo>;
|
||||||
using ChosenObjectInfoList = std::vector<std::unique_ptr<ChosenObjectInfo>>;
|
using ChosenObjectInfoList = std::vector<std::unique_ptr<ChosenObjectInfo>>;
|
||||||
|
|
||||||
virtual ~WebsiteSettingsUI();
|
virtual ~PageInfoUI();
|
||||||
|
|
||||||
// Returns the UI string for the given permission |type|.
|
// Returns the UI string for the given permission |type|.
|
||||||
static base::string16 PermissionTypeToUIString(ContentSettingsType type);
|
static base::string16 PermissionTypeToUIString(ContentSettingsType type);
|
||||||
@@ -172,18 +172,17 @@ class WebsiteSettingsUI {
|
|||||||
bool deleted);
|
bool deleted);
|
||||||
|
|
||||||
// Returns the identity icon ID for the given identity |status|.
|
// Returns the identity icon ID for the given identity |status|.
|
||||||
static int GetIdentityIconID(WebsiteSettings::SiteIdentityStatus status);
|
static int GetIdentityIconID(PageInfo::SiteIdentityStatus status);
|
||||||
|
|
||||||
// Returns the identity icon for the given identity |status|.
|
// Returns the identity icon for the given identity |status|.
|
||||||
static const gfx::Image& GetIdentityIcon(
|
static const gfx::Image& GetIdentityIcon(PageInfo::SiteIdentityStatus status);
|
||||||
WebsiteSettings::SiteIdentityStatus status);
|
|
||||||
|
|
||||||
// Returns the connection icon ID for the given connection |status|.
|
// Returns the connection icon ID for the given connection |status|.
|
||||||
static int GetConnectionIconID(WebsiteSettings::SiteConnectionStatus status);
|
static int GetConnectionIconID(PageInfo::SiteConnectionStatus status);
|
||||||
|
|
||||||
// Returns the connection icon for the given connection |status|.
|
// Returns the connection icon for the given connection |status|.
|
||||||
static const gfx::Image& GetConnectionIcon(
|
static const gfx::Image& GetConnectionIcon(
|
||||||
WebsiteSettings::SiteConnectionStatus status);
|
PageInfo::SiteConnectionStatus status);
|
||||||
|
|
||||||
// Sets cookie information.
|
// Sets cookie information.
|
||||||
virtual void SetCookieInfo(const CookieInfoList& cookie_info_list) = 0;
|
virtual void SetCookieInfo(const CookieInfoList& cookie_info_list) = 0;
|
||||||
@@ -197,8 +196,8 @@ class WebsiteSettingsUI {
|
|||||||
virtual void SetIdentityInfo(const IdentityInfo& identity_info) = 0;
|
virtual void SetIdentityInfo(const IdentityInfo& identity_info) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef WebsiteSettingsUI::CookieInfoList CookieInfoList;
|
typedef PageInfoUI::CookieInfoList CookieInfoList;
|
||||||
typedef WebsiteSettingsUI::PermissionInfoList PermissionInfoList;
|
typedef PageInfoUI::PermissionInfoList PermissionInfoList;
|
||||||
typedef WebsiteSettingsUI::ChosenObjectInfoList ChosenObjectInfoList;
|
typedef PageInfoUI::ChosenObjectInfoList ChosenObjectInfoList;
|
||||||
|
|
||||||
#endif // CHROME_BROWSER_UI_PAGE_INFO_WEBSITE_SETTINGS_UI_H_
|
#endif // CHROME_BROWSER_UI_PAGE_INFO_PAGE_INFO_UI_H_
|
@@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#include "chrome/browser/ui/page_info/website_settings.h"
|
#include "chrome/browser/ui/page_info/page_info.h"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
#include "build/build_config.h"
|
#include "build/build_config.h"
|
||||||
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
|
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
|
||||||
#include "chrome/browser/infobars/infobar_service.h"
|
#include "chrome/browser/infobars/infobar_service.h"
|
||||||
#include "chrome/browser/ui/page_info/website_settings_ui.h"
|
#include "chrome/browser/ui/page_info/page_info_ui.h"
|
||||||
#include "chrome/browser/usb/usb_chooser_context.h"
|
#include "chrome/browser/usb/usb_chooser_context.h"
|
||||||
#include "chrome/browser/usb/usb_chooser_context_factory.h"
|
#include "chrome/browser/usb/usb_chooser_context_factory.h"
|
||||||
#include "chrome/grit/theme_resources.h"
|
#include "chrome/grit/theme_resources.h"
|
||||||
@@ -68,9 +68,9 @@ int SetSSLCipherSuite(int connection_status, int cipher_suite) {
|
|||||||
return cipher_suite | connection_status;
|
return cipher_suite | connection_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
class MockWebsiteSettingsUI : public WebsiteSettingsUI {
|
class MockPageInfoUI : public PageInfoUI {
|
||||||
public:
|
public:
|
||||||
virtual ~MockWebsiteSettingsUI() {}
|
virtual ~MockPageInfoUI() {}
|
||||||
MOCK_METHOD1(SetCookieInfo, void(const CookieInfoList& cookie_info_list));
|
MOCK_METHOD1(SetCookieInfo, void(const CookieInfoList& cookie_info_list));
|
||||||
MOCK_METHOD0(SetPermissionInfoStub, void());
|
MOCK_METHOD0(SetPermissionInfoStub, void());
|
||||||
MOCK_METHOD1(SetIdentityInfo, void(const IdentityInfo& identity_info));
|
MOCK_METHOD1(SetIdentityInfo, void(const IdentityInfo& identity_info));
|
||||||
@@ -90,11 +90,11 @@ class MockWebsiteSettingsUI : public WebsiteSettingsUI {
|
|||||||
set_permission_info_callback_;
|
set_permission_info_callback_;
|
||||||
};
|
};
|
||||||
|
|
||||||
class WebsiteSettingsTest : public ChromeRenderViewHostTestHarness {
|
class PageInfoTest : public ChromeRenderViewHostTestHarness {
|
||||||
public:
|
public:
|
||||||
WebsiteSettingsTest() : url_("http://www.example.com") {}
|
PageInfoTest() : url_("http://www.example.com") {}
|
||||||
|
|
||||||
~WebsiteSettingsTest() override {}
|
~PageInfoTest() override {}
|
||||||
|
|
||||||
void SetUp() override {
|
void SetUp() override {
|
||||||
ChromeRenderViewHostTestHarness::SetUp();
|
ChromeRenderViewHostTestHarness::SetUp();
|
||||||
@@ -111,22 +111,21 @@ class WebsiteSettingsTest : public ChromeRenderViewHostTestHarness {
|
|||||||
InfoBarService::CreateForWebContents(web_contents());
|
InfoBarService::CreateForWebContents(web_contents());
|
||||||
|
|
||||||
// Setup mock ui.
|
// Setup mock ui.
|
||||||
mock_ui_.reset(new MockWebsiteSettingsUI());
|
mock_ui_.reset(new MockPageInfoUI());
|
||||||
// Use this rather than gmock's ON_CALL.WillByDefault(Invoke(... because
|
// Use this rather than gmock's ON_CALL.WillByDefault(Invoke(... because
|
||||||
// gmock doesn't handle move-only types well.
|
// gmock doesn't handle move-only types well.
|
||||||
mock_ui_->set_permission_info_callback_ = base::Bind(
|
mock_ui_->set_permission_info_callback_ =
|
||||||
&WebsiteSettingsTest::SetPermissionInfo, base::Unretained(this));
|
base::Bind(&PageInfoTest::SetPermissionInfo, base::Unretained(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
void TearDown() override {
|
void TearDown() override {
|
||||||
ASSERT_TRUE(website_settings_.get())
|
ASSERT_TRUE(page_info_.get()) << "No PageInfo instance created.";
|
||||||
<< "No WebsiteSettings instance created.";
|
|
||||||
RenderViewHostTestHarness::TearDown();
|
RenderViewHostTestHarness::TearDown();
|
||||||
website_settings_.reset();
|
page_info_.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetDefaultUIExpectations(MockWebsiteSettingsUI* mock_ui) {
|
void SetDefaultUIExpectations(MockPageInfoUI* mock_ui) {
|
||||||
// During creation |WebsiteSettings| makes the following calls to the ui.
|
// During creation |PageInfo| makes the following calls to the ui.
|
||||||
EXPECT_CALL(*mock_ui, SetPermissionInfoStub());
|
EXPECT_CALL(*mock_ui, SetPermissionInfoStub());
|
||||||
EXPECT_CALL(*mock_ui, SetIdentityInfo(_));
|
EXPECT_CALL(*mock_ui, SetIdentityInfo(_));
|
||||||
EXPECT_CALL(*mock_ui, SetCookieInfo(_));
|
EXPECT_CALL(*mock_ui, SetCookieInfo(_));
|
||||||
@@ -141,15 +140,15 @@ class WebsiteSettingsTest : public ChromeRenderViewHostTestHarness {
|
|||||||
last_chosen_object_info_.push_back(std::move(chosen_object_info));
|
last_chosen_object_info_.push_back(std::move(chosen_object_info));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ResetMockUI() { mock_ui_.reset(new MockWebsiteSettingsUI()); }
|
void ResetMockUI() { mock_ui_.reset(new MockPageInfoUI()); }
|
||||||
|
|
||||||
void ClearWebsiteSettings() { website_settings_.reset(nullptr); }
|
void ClearPageInfo() { page_info_.reset(nullptr); }
|
||||||
|
|
||||||
const GURL& url() const { return url_; }
|
const GURL& url() const { return url_; }
|
||||||
scoped_refptr<net::X509Certificate> cert() { return cert_; }
|
scoped_refptr<net::X509Certificate> cert() { return cert_; }
|
||||||
MockWebsiteSettingsUI* mock_ui() { return mock_ui_.get(); }
|
MockPageInfoUI* mock_ui() { return mock_ui_.get(); }
|
||||||
const security_state::SecurityInfo& security_info() { return security_info_; }
|
const security_state::SecurityInfo& security_info() { return security_info_; }
|
||||||
const std::vector<std::unique_ptr<WebsiteSettingsUI::ChosenObjectInfo>>&
|
const std::vector<std::unique_ptr<PageInfoUI::ChosenObjectInfo>>&
|
||||||
last_chosen_object_info() {
|
last_chosen_object_info() {
|
||||||
return last_chosen_object_info_;
|
return last_chosen_object_info_;
|
||||||
}
|
}
|
||||||
@@ -160,13 +159,13 @@ class WebsiteSettingsTest : public ChromeRenderViewHostTestHarness {
|
|||||||
return InfoBarService::FromWebContents(web_contents());
|
return InfoBarService::FromWebContents(web_contents());
|
||||||
}
|
}
|
||||||
|
|
||||||
WebsiteSettings* website_settings() {
|
PageInfo* page_info() {
|
||||||
if (!website_settings_.get()) {
|
if (!page_info_.get()) {
|
||||||
website_settings_.reset(new WebsiteSettings(
|
page_info_.reset(new PageInfo(mock_ui(), profile(),
|
||||||
mock_ui(), profile(), tab_specific_content_settings(), web_contents(),
|
tab_specific_content_settings(),
|
||||||
url(), security_info()));
|
web_contents(), url(), security_info()));
|
||||||
}
|
}
|
||||||
return website_settings_.get();
|
return page_info_.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
device::MockUsbService& usb_service() {
|
device::MockUsbService& usb_service() {
|
||||||
@@ -177,17 +176,17 @@ class WebsiteSettingsTest : public ChromeRenderViewHostTestHarness {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
device::MockDeviceClient device_client_;
|
device::MockDeviceClient device_client_;
|
||||||
std::unique_ptr<WebsiteSettings> website_settings_;
|
std::unique_ptr<PageInfo> page_info_;
|
||||||
std::unique_ptr<MockWebsiteSettingsUI> mock_ui_;
|
std::unique_ptr<MockPageInfoUI> mock_ui_;
|
||||||
scoped_refptr<net::X509Certificate> cert_;
|
scoped_refptr<net::X509Certificate> cert_;
|
||||||
GURL url_;
|
GURL url_;
|
||||||
std::vector<std::unique_ptr<WebsiteSettingsUI::ChosenObjectInfo>>
|
std::vector<std::unique_ptr<PageInfoUI::ChosenObjectInfo>>
|
||||||
last_chosen_object_info_;
|
last_chosen_object_info_;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
TEST_F(WebsiteSettingsTest, OnPermissionsChanged) {
|
TEST_F(PageInfoTest, OnPermissionsChanged) {
|
||||||
// Setup site permissions.
|
// Setup site permissions.
|
||||||
HostContentSettingsMap* content_settings =
|
HostContentSettingsMap* content_settings =
|
||||||
HostContentSettingsMapFactory::GetForProfile(profile());
|
HostContentSettingsMapFactory::GetForProfile(profile());
|
||||||
@@ -225,20 +224,20 @@ TEST_F(WebsiteSettingsTest, OnPermissionsChanged) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Execute code under tests.
|
// Execute code under tests.
|
||||||
website_settings()->OnSitePermissionChanged(CONTENT_SETTINGS_TYPE_POPUPS,
|
page_info()->OnSitePermissionChanged(CONTENT_SETTINGS_TYPE_POPUPS,
|
||||||
CONTENT_SETTING_ALLOW);
|
CONTENT_SETTING_ALLOW);
|
||||||
#if BUILDFLAG(ENABLE_PLUGINS)
|
#if BUILDFLAG(ENABLE_PLUGINS)
|
||||||
website_settings()->OnSitePermissionChanged(CONTENT_SETTINGS_TYPE_PLUGINS,
|
page_info()->OnSitePermissionChanged(CONTENT_SETTINGS_TYPE_PLUGINS,
|
||||||
CONTENT_SETTING_BLOCK);
|
CONTENT_SETTING_BLOCK);
|
||||||
#endif
|
#endif
|
||||||
website_settings()->OnSitePermissionChanged(CONTENT_SETTINGS_TYPE_GEOLOCATION,
|
page_info()->OnSitePermissionChanged(CONTENT_SETTINGS_TYPE_GEOLOCATION,
|
||||||
CONTENT_SETTING_ALLOW);
|
CONTENT_SETTING_ALLOW);
|
||||||
website_settings()->OnSitePermissionChanged(
|
page_info()->OnSitePermissionChanged(CONTENT_SETTINGS_TYPE_NOTIFICATIONS,
|
||||||
CONTENT_SETTINGS_TYPE_NOTIFICATIONS, CONTENT_SETTING_ALLOW);
|
CONTENT_SETTING_ALLOW);
|
||||||
website_settings()->OnSitePermissionChanged(
|
page_info()->OnSitePermissionChanged(CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC,
|
||||||
CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC, CONTENT_SETTING_ALLOW);
|
CONTENT_SETTING_ALLOW);
|
||||||
website_settings()->OnSitePermissionChanged(
|
page_info()->OnSitePermissionChanged(CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA,
|
||||||
CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA, CONTENT_SETTING_ALLOW);
|
CONTENT_SETTING_ALLOW);
|
||||||
|
|
||||||
// Verify that the site permissions were changed correctly.
|
// Verify that the site permissions were changed correctly.
|
||||||
setting = content_settings->GetContentSetting(
|
setting = content_settings->GetContentSetting(
|
||||||
@@ -263,15 +262,15 @@ TEST_F(WebsiteSettingsTest, OnPermissionsChanged) {
|
|||||||
EXPECT_EQ(setting, CONTENT_SETTING_ALLOW);
|
EXPECT_EQ(setting, CONTENT_SETTING_ALLOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(WebsiteSettingsTest, OnSiteDataAccessed) {
|
TEST_F(PageInfoTest, OnSiteDataAccessed) {
|
||||||
EXPECT_CALL(*mock_ui(), SetPermissionInfoStub());
|
EXPECT_CALL(*mock_ui(), SetPermissionInfoStub());
|
||||||
EXPECT_CALL(*mock_ui(), SetIdentityInfo(_));
|
EXPECT_CALL(*mock_ui(), SetIdentityInfo(_));
|
||||||
EXPECT_CALL(*mock_ui(), SetCookieInfo(_)).Times(2);
|
EXPECT_CALL(*mock_ui(), SetCookieInfo(_)).Times(2);
|
||||||
|
|
||||||
website_settings()->OnSiteDataAccessed();
|
page_info()->OnSiteDataAccessed();
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(WebsiteSettingsTest, OnChosenObjectDeleted) {
|
TEST_F(PageInfoTest, OnChosenObjectDeleted) {
|
||||||
scoped_refptr<device::UsbDevice> device =
|
scoped_refptr<device::UsbDevice> device =
|
||||||
new device::MockUsbDevice(0, 0, "Google", "Gizmo", "1234567890");
|
new device::MockUsbDevice(0, 0, "Google", "Gizmo", "1234567890");
|
||||||
usb_service().AddDevice(device);
|
usb_service().AddDevice(device);
|
||||||
@@ -281,67 +280,66 @@ TEST_F(WebsiteSettingsTest, OnChosenObjectDeleted) {
|
|||||||
EXPECT_CALL(*mock_ui(), SetIdentityInfo(_));
|
EXPECT_CALL(*mock_ui(), SetIdentityInfo(_));
|
||||||
EXPECT_CALL(*mock_ui(), SetCookieInfo(_));
|
EXPECT_CALL(*mock_ui(), SetCookieInfo(_));
|
||||||
|
|
||||||
// Access WebsiteSettings so that SetPermissionInfo is called once to populate
|
// Access PageInfo so that SetPermissionInfo is called once to populate
|
||||||
// |last_chosen_object_info_|. It will be called again by
|
// |last_chosen_object_info_|. It will be called again by
|
||||||
// OnSiteChosenObjectDeleted.
|
// OnSiteChosenObjectDeleted.
|
||||||
EXPECT_CALL(*mock_ui(), SetPermissionInfoStub()).Times(2);
|
EXPECT_CALL(*mock_ui(), SetPermissionInfoStub()).Times(2);
|
||||||
website_settings();
|
page_info();
|
||||||
|
|
||||||
ASSERT_EQ(1u, last_chosen_object_info().size());
|
ASSERT_EQ(1u, last_chosen_object_info().size());
|
||||||
const WebsiteSettingsUI::ChosenObjectInfo* info =
|
const PageInfoUI::ChosenObjectInfo* info = last_chosen_object_info()[0].get();
|
||||||
last_chosen_object_info()[0].get();
|
page_info()->OnSiteChosenObjectDeleted(info->ui_info, *info->object);
|
||||||
website_settings()->OnSiteChosenObjectDeleted(info->ui_info, *info->object);
|
|
||||||
|
|
||||||
EXPECT_FALSE(store->HasDevicePermission(url(), url(), device));
|
EXPECT_FALSE(store->HasDevicePermission(url(), url(), device));
|
||||||
EXPECT_EQ(0u, last_chosen_object_info().size());
|
EXPECT_EQ(0u, last_chosen_object_info().size());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(WebsiteSettingsTest, Malware) {
|
TEST_F(PageInfoTest, Malware) {
|
||||||
security_info_.security_level = security_state::DANGEROUS;
|
security_info_.security_level = security_state::DANGEROUS;
|
||||||
security_info_.malicious_content_status =
|
security_info_.malicious_content_status =
|
||||||
security_state::MALICIOUS_CONTENT_STATUS_MALWARE;
|
security_state::MALICIOUS_CONTENT_STATUS_MALWARE;
|
||||||
SetDefaultUIExpectations(mock_ui());
|
SetDefaultUIExpectations(mock_ui());
|
||||||
|
|
||||||
EXPECT_EQ(WebsiteSettings::SITE_CONNECTION_STATUS_UNENCRYPTED,
|
EXPECT_EQ(PageInfo::SITE_CONNECTION_STATUS_UNENCRYPTED,
|
||||||
website_settings()->site_connection_status());
|
page_info()->site_connection_status());
|
||||||
EXPECT_EQ(WebsiteSettings::SITE_IDENTITY_STATUS_MALWARE,
|
EXPECT_EQ(PageInfo::SITE_IDENTITY_STATUS_MALWARE,
|
||||||
website_settings()->site_identity_status());
|
page_info()->site_identity_status());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(WebsiteSettingsTest, SocialEngineering) {
|
TEST_F(PageInfoTest, SocialEngineering) {
|
||||||
security_info_.security_level = security_state::DANGEROUS;
|
security_info_.security_level = security_state::DANGEROUS;
|
||||||
security_info_.malicious_content_status =
|
security_info_.malicious_content_status =
|
||||||
security_state::MALICIOUS_CONTENT_STATUS_SOCIAL_ENGINEERING;
|
security_state::MALICIOUS_CONTENT_STATUS_SOCIAL_ENGINEERING;
|
||||||
SetDefaultUIExpectations(mock_ui());
|
SetDefaultUIExpectations(mock_ui());
|
||||||
|
|
||||||
EXPECT_EQ(WebsiteSettings::SITE_CONNECTION_STATUS_UNENCRYPTED,
|
EXPECT_EQ(PageInfo::SITE_CONNECTION_STATUS_UNENCRYPTED,
|
||||||
website_settings()->site_connection_status());
|
page_info()->site_connection_status());
|
||||||
EXPECT_EQ(WebsiteSettings::SITE_IDENTITY_STATUS_SOCIAL_ENGINEERING,
|
EXPECT_EQ(PageInfo::SITE_IDENTITY_STATUS_SOCIAL_ENGINEERING,
|
||||||
website_settings()->site_identity_status());
|
page_info()->site_identity_status());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(WebsiteSettingsTest, UnwantedSoftware) {
|
TEST_F(PageInfoTest, UnwantedSoftware) {
|
||||||
security_info_.security_level = security_state::DANGEROUS;
|
security_info_.security_level = security_state::DANGEROUS;
|
||||||
security_info_.malicious_content_status =
|
security_info_.malicious_content_status =
|
||||||
security_state::MALICIOUS_CONTENT_STATUS_UNWANTED_SOFTWARE;
|
security_state::MALICIOUS_CONTENT_STATUS_UNWANTED_SOFTWARE;
|
||||||
SetDefaultUIExpectations(mock_ui());
|
SetDefaultUIExpectations(mock_ui());
|
||||||
|
|
||||||
EXPECT_EQ(WebsiteSettings::SITE_CONNECTION_STATUS_UNENCRYPTED,
|
EXPECT_EQ(PageInfo::SITE_CONNECTION_STATUS_UNENCRYPTED,
|
||||||
website_settings()->site_connection_status());
|
page_info()->site_connection_status());
|
||||||
EXPECT_EQ(WebsiteSettings::SITE_IDENTITY_STATUS_UNWANTED_SOFTWARE,
|
EXPECT_EQ(PageInfo::SITE_IDENTITY_STATUS_UNWANTED_SOFTWARE,
|
||||||
website_settings()->site_identity_status());
|
page_info()->site_identity_status());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(WebsiteSettingsTest, HTTPConnection) {
|
TEST_F(PageInfoTest, HTTPConnection) {
|
||||||
SetDefaultUIExpectations(mock_ui());
|
SetDefaultUIExpectations(mock_ui());
|
||||||
EXPECT_EQ(WebsiteSettings::SITE_CONNECTION_STATUS_UNENCRYPTED,
|
EXPECT_EQ(PageInfo::SITE_CONNECTION_STATUS_UNENCRYPTED,
|
||||||
website_settings()->site_connection_status());
|
page_info()->site_connection_status());
|
||||||
EXPECT_EQ(WebsiteSettings::SITE_IDENTITY_STATUS_NO_CERT,
|
EXPECT_EQ(PageInfo::SITE_IDENTITY_STATUS_NO_CERT,
|
||||||
website_settings()->site_identity_status());
|
page_info()->site_identity_status());
|
||||||
EXPECT_EQ(base::string16(), website_settings()->organization_name());
|
EXPECT_EQ(base::string16(), page_info()->organization_name());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(WebsiteSettingsTest, HTTPSConnection) {
|
TEST_F(PageInfoTest, HTTPSConnection) {
|
||||||
security_info_.security_level = security_state::SECURE;
|
security_info_.security_level = security_state::SECURE;
|
||||||
security_info_.scheme_is_cryptographic = true;
|
security_info_.scheme_is_cryptographic = true;
|
||||||
security_info_.certificate = cert();
|
security_info_.certificate = cert();
|
||||||
@@ -354,21 +352,21 @@ TEST_F(WebsiteSettingsTest, HTTPSConnection) {
|
|||||||
|
|
||||||
SetDefaultUIExpectations(mock_ui());
|
SetDefaultUIExpectations(mock_ui());
|
||||||
|
|
||||||
EXPECT_EQ(WebsiteSettings::SITE_CONNECTION_STATUS_ENCRYPTED,
|
EXPECT_EQ(PageInfo::SITE_CONNECTION_STATUS_ENCRYPTED,
|
||||||
website_settings()->site_connection_status());
|
page_info()->site_connection_status());
|
||||||
EXPECT_EQ(WebsiteSettings::SITE_IDENTITY_STATUS_CERT,
|
EXPECT_EQ(PageInfo::SITE_IDENTITY_STATUS_CERT,
|
||||||
website_settings()->site_identity_status());
|
page_info()->site_identity_status());
|
||||||
EXPECT_EQ(base::string16(), website_settings()->organization_name());
|
EXPECT_EQ(base::string16(), page_info()->organization_name());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(WebsiteSettingsTest, InsecureContent) {
|
TEST_F(PageInfoTest, InsecureContent) {
|
||||||
struct TestCase {
|
struct TestCase {
|
||||||
security_state::SecurityLevel security_level;
|
security_state::SecurityLevel security_level;
|
||||||
net::CertStatus cert_status;
|
net::CertStatus cert_status;
|
||||||
security_state::ContentStatus mixed_content_status;
|
security_state::ContentStatus mixed_content_status;
|
||||||
security_state::ContentStatus content_with_cert_errors_status;
|
security_state::ContentStatus content_with_cert_errors_status;
|
||||||
WebsiteSettings::SiteConnectionStatus expected_site_connection_status;
|
PageInfo::SiteConnectionStatus expected_site_connection_status;
|
||||||
WebsiteSettings::SiteIdentityStatus expected_site_identity_status;
|
PageInfo::SiteIdentityStatus expected_site_identity_status;
|
||||||
int expected_connection_icon_id;
|
int expected_connection_icon_id;
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -376,43 +374,43 @@ TEST_F(WebsiteSettingsTest, InsecureContent) {
|
|||||||
// Passive mixed content.
|
// Passive mixed content.
|
||||||
{security_state::NONE, 0, security_state::CONTENT_STATUS_DISPLAYED,
|
{security_state::NONE, 0, security_state::CONTENT_STATUS_DISPLAYED,
|
||||||
security_state::CONTENT_STATUS_NONE,
|
security_state::CONTENT_STATUS_NONE,
|
||||||
WebsiteSettings::SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE,
|
PageInfo::SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE,
|
||||||
WebsiteSettings::SITE_IDENTITY_STATUS_CERT, IDR_PAGEINFO_WARNING_MINOR},
|
PageInfo::SITE_IDENTITY_STATUS_CERT, IDR_PAGEINFO_WARNING_MINOR},
|
||||||
// Passive mixed content with a cert error on the main resource.
|
// Passive mixed content with a cert error on the main resource.
|
||||||
{security_state::DANGEROUS, net::CERT_STATUS_DATE_INVALID,
|
{security_state::DANGEROUS, net::CERT_STATUS_DATE_INVALID,
|
||||||
security_state::CONTENT_STATUS_DISPLAYED,
|
security_state::CONTENT_STATUS_DISPLAYED,
|
||||||
security_state::CONTENT_STATUS_NONE,
|
security_state::CONTENT_STATUS_NONE,
|
||||||
WebsiteSettings::SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE,
|
PageInfo::SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE,
|
||||||
WebsiteSettings::SITE_IDENTITY_STATUS_ERROR, IDR_PAGEINFO_WARNING_MINOR},
|
PageInfo::SITE_IDENTITY_STATUS_ERROR, IDR_PAGEINFO_WARNING_MINOR},
|
||||||
// Active and passive mixed content.
|
// Active and passive mixed content.
|
||||||
{security_state::DANGEROUS, 0,
|
{security_state::DANGEROUS, 0,
|
||||||
security_state::CONTENT_STATUS_DISPLAYED_AND_RAN,
|
security_state::CONTENT_STATUS_DISPLAYED_AND_RAN,
|
||||||
security_state::CONTENT_STATUS_NONE,
|
security_state::CONTENT_STATUS_NONE,
|
||||||
WebsiteSettings::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE,
|
PageInfo::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE,
|
||||||
WebsiteSettings::SITE_IDENTITY_STATUS_CERT, IDR_PAGEINFO_BAD},
|
PageInfo::SITE_IDENTITY_STATUS_CERT, IDR_PAGEINFO_BAD},
|
||||||
// Active and passive mixed content with a cert error on the main
|
// Active and passive mixed content with a cert error on the main
|
||||||
// resource.
|
// resource.
|
||||||
{security_state::DANGEROUS, net::CERT_STATUS_DATE_INVALID,
|
{security_state::DANGEROUS, net::CERT_STATUS_DATE_INVALID,
|
||||||
security_state::CONTENT_STATUS_DISPLAYED_AND_RAN,
|
security_state::CONTENT_STATUS_DISPLAYED_AND_RAN,
|
||||||
security_state::CONTENT_STATUS_NONE,
|
security_state::CONTENT_STATUS_NONE,
|
||||||
WebsiteSettings::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE,
|
PageInfo::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE,
|
||||||
WebsiteSettings::SITE_IDENTITY_STATUS_ERROR, IDR_PAGEINFO_BAD},
|
PageInfo::SITE_IDENTITY_STATUS_ERROR, IDR_PAGEINFO_BAD},
|
||||||
// Active mixed content.
|
// Active mixed content.
|
||||||
{security_state::DANGEROUS, 0, security_state::CONTENT_STATUS_RAN,
|
{security_state::DANGEROUS, 0, security_state::CONTENT_STATUS_RAN,
|
||||||
security_state::CONTENT_STATUS_NONE,
|
security_state::CONTENT_STATUS_NONE,
|
||||||
WebsiteSettings::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE,
|
PageInfo::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE,
|
||||||
WebsiteSettings::SITE_IDENTITY_STATUS_CERT, IDR_PAGEINFO_BAD},
|
PageInfo::SITE_IDENTITY_STATUS_CERT, IDR_PAGEINFO_BAD},
|
||||||
// Active mixed content with a cert error on the main resource.
|
// Active mixed content with a cert error on the main resource.
|
||||||
{security_state::DANGEROUS, net::CERT_STATUS_DATE_INVALID,
|
{security_state::DANGEROUS, net::CERT_STATUS_DATE_INVALID,
|
||||||
security_state::CONTENT_STATUS_RAN, security_state::CONTENT_STATUS_NONE,
|
security_state::CONTENT_STATUS_RAN, security_state::CONTENT_STATUS_NONE,
|
||||||
WebsiteSettings::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE,
|
PageInfo::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE,
|
||||||
WebsiteSettings::SITE_IDENTITY_STATUS_ERROR, IDR_PAGEINFO_BAD},
|
PageInfo::SITE_IDENTITY_STATUS_ERROR, IDR_PAGEINFO_BAD},
|
||||||
|
|
||||||
// Passive subresources with cert errors.
|
// Passive subresources with cert errors.
|
||||||
{security_state::NONE, 0, security_state::CONTENT_STATUS_NONE,
|
{security_state::NONE, 0, security_state::CONTENT_STATUS_NONE,
|
||||||
security_state::CONTENT_STATUS_DISPLAYED,
|
security_state::CONTENT_STATUS_DISPLAYED,
|
||||||
WebsiteSettings::SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE,
|
PageInfo::SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE,
|
||||||
WebsiteSettings::SITE_IDENTITY_STATUS_CERT, IDR_PAGEINFO_WARNING_MINOR},
|
PageInfo::SITE_IDENTITY_STATUS_CERT, IDR_PAGEINFO_WARNING_MINOR},
|
||||||
// Passive subresources with cert errors, with a cert error on the
|
// Passive subresources with cert errors, with a cert error on the
|
||||||
// main resource also. In this case, the subresources with
|
// main resource also. In this case, the subresources with
|
||||||
// certificate errors are ignored: if the main resource had a cert
|
// certificate errors are ignored: if the main resource had a cert
|
||||||
@@ -421,59 +419,59 @@ TEST_F(WebsiteSettingsTest, InsecureContent) {
|
|||||||
{security_state::DANGEROUS, net::CERT_STATUS_DATE_INVALID,
|
{security_state::DANGEROUS, net::CERT_STATUS_DATE_INVALID,
|
||||||
security_state::CONTENT_STATUS_NONE,
|
security_state::CONTENT_STATUS_NONE,
|
||||||
security_state::CONTENT_STATUS_DISPLAYED,
|
security_state::CONTENT_STATUS_DISPLAYED,
|
||||||
WebsiteSettings::SITE_CONNECTION_STATUS_ENCRYPTED,
|
PageInfo::SITE_CONNECTION_STATUS_ENCRYPTED,
|
||||||
WebsiteSettings::SITE_IDENTITY_STATUS_ERROR, IDR_PAGEINFO_GOOD},
|
PageInfo::SITE_IDENTITY_STATUS_ERROR, IDR_PAGEINFO_GOOD},
|
||||||
// Passive and active subresources with cert errors.
|
// Passive and active subresources with cert errors.
|
||||||
{security_state::DANGEROUS, 0, security_state::CONTENT_STATUS_NONE,
|
{security_state::DANGEROUS, 0, security_state::CONTENT_STATUS_NONE,
|
||||||
security_state::CONTENT_STATUS_DISPLAYED_AND_RAN,
|
security_state::CONTENT_STATUS_DISPLAYED_AND_RAN,
|
||||||
WebsiteSettings::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE,
|
PageInfo::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE,
|
||||||
WebsiteSettings::SITE_IDENTITY_STATUS_CERT, IDR_PAGEINFO_BAD},
|
PageInfo::SITE_IDENTITY_STATUS_CERT, IDR_PAGEINFO_BAD},
|
||||||
// Passive and active subresources with cert errors, with a cert
|
// Passive and active subresources with cert errors, with a cert
|
||||||
// error on the main resource also.
|
// error on the main resource also.
|
||||||
{security_state::DANGEROUS, net::CERT_STATUS_DATE_INVALID,
|
{security_state::DANGEROUS, net::CERT_STATUS_DATE_INVALID,
|
||||||
security_state::CONTENT_STATUS_NONE,
|
security_state::CONTENT_STATUS_NONE,
|
||||||
security_state::CONTENT_STATUS_DISPLAYED_AND_RAN,
|
security_state::CONTENT_STATUS_DISPLAYED_AND_RAN,
|
||||||
WebsiteSettings::SITE_CONNECTION_STATUS_ENCRYPTED,
|
PageInfo::SITE_CONNECTION_STATUS_ENCRYPTED,
|
||||||
WebsiteSettings::SITE_IDENTITY_STATUS_ERROR, IDR_PAGEINFO_GOOD},
|
PageInfo::SITE_IDENTITY_STATUS_ERROR, IDR_PAGEINFO_GOOD},
|
||||||
// Active subresources with cert errors.
|
// Active subresources with cert errors.
|
||||||
{security_state::DANGEROUS, 0, security_state::CONTENT_STATUS_NONE,
|
{security_state::DANGEROUS, 0, security_state::CONTENT_STATUS_NONE,
|
||||||
security_state::CONTENT_STATUS_RAN,
|
security_state::CONTENT_STATUS_RAN,
|
||||||
WebsiteSettings::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE,
|
PageInfo::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE,
|
||||||
WebsiteSettings::SITE_IDENTITY_STATUS_CERT, IDR_PAGEINFO_BAD},
|
PageInfo::SITE_IDENTITY_STATUS_CERT, IDR_PAGEINFO_BAD},
|
||||||
// Active subresources with cert errors, with a cert error on the main
|
// Active subresources with cert errors, with a cert error on the main
|
||||||
// resource also.
|
// resource also.
|
||||||
{security_state::DANGEROUS, net::CERT_STATUS_DATE_INVALID,
|
{security_state::DANGEROUS, net::CERT_STATUS_DATE_INVALID,
|
||||||
security_state::CONTENT_STATUS_NONE, security_state::CONTENT_STATUS_RAN,
|
security_state::CONTENT_STATUS_NONE, security_state::CONTENT_STATUS_RAN,
|
||||||
WebsiteSettings::SITE_CONNECTION_STATUS_ENCRYPTED,
|
PageInfo::SITE_CONNECTION_STATUS_ENCRYPTED,
|
||||||
WebsiteSettings::SITE_IDENTITY_STATUS_ERROR, IDR_PAGEINFO_GOOD},
|
PageInfo::SITE_IDENTITY_STATUS_ERROR, IDR_PAGEINFO_GOOD},
|
||||||
|
|
||||||
// Passive mixed content and subresources with cert errors.
|
// Passive mixed content and subresources with cert errors.
|
||||||
{security_state::NONE, 0, security_state::CONTENT_STATUS_DISPLAYED,
|
{security_state::NONE, 0, security_state::CONTENT_STATUS_DISPLAYED,
|
||||||
security_state::CONTENT_STATUS_DISPLAYED,
|
security_state::CONTENT_STATUS_DISPLAYED,
|
||||||
WebsiteSettings::SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE,
|
PageInfo::SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE,
|
||||||
WebsiteSettings::SITE_IDENTITY_STATUS_CERT, IDR_PAGEINFO_WARNING_MINOR},
|
PageInfo::SITE_IDENTITY_STATUS_CERT, IDR_PAGEINFO_WARNING_MINOR},
|
||||||
// Passive mixed content and active subresources with cert errors.
|
// Passive mixed content and active subresources with cert errors.
|
||||||
{security_state::DANGEROUS, 0, security_state::CONTENT_STATUS_DISPLAYED,
|
{security_state::DANGEROUS, 0, security_state::CONTENT_STATUS_DISPLAYED,
|
||||||
security_state::CONTENT_STATUS_RAN,
|
security_state::CONTENT_STATUS_RAN,
|
||||||
WebsiteSettings::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE,
|
PageInfo::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE,
|
||||||
WebsiteSettings::SITE_IDENTITY_STATUS_CERT, IDR_PAGEINFO_BAD},
|
PageInfo::SITE_IDENTITY_STATUS_CERT, IDR_PAGEINFO_BAD},
|
||||||
// Active mixed content and passive subresources with cert errors.
|
// Active mixed content and passive subresources with cert errors.
|
||||||
{security_state::DANGEROUS, 0, security_state::CONTENT_STATUS_RAN,
|
{security_state::DANGEROUS, 0, security_state::CONTENT_STATUS_RAN,
|
||||||
security_state::CONTENT_STATUS_DISPLAYED,
|
security_state::CONTENT_STATUS_DISPLAYED,
|
||||||
WebsiteSettings::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE,
|
PageInfo::SITE_CONNECTION_STATUS_INSECURE_ACTIVE_SUBRESOURCE,
|
||||||
WebsiteSettings::SITE_IDENTITY_STATUS_CERT, IDR_PAGEINFO_BAD},
|
PageInfo::SITE_IDENTITY_STATUS_CERT, IDR_PAGEINFO_BAD},
|
||||||
// Passive mixed content, active subresources with cert errors, and a cert
|
// Passive mixed content, active subresources with cert errors, and a cert
|
||||||
// error on the main resource.
|
// error on the main resource.
|
||||||
{security_state::DANGEROUS, net::CERT_STATUS_DATE_INVALID,
|
{security_state::DANGEROUS, net::CERT_STATUS_DATE_INVALID,
|
||||||
security_state::CONTENT_STATUS_DISPLAYED,
|
security_state::CONTENT_STATUS_DISPLAYED,
|
||||||
security_state::CONTENT_STATUS_RAN,
|
security_state::CONTENT_STATUS_RAN,
|
||||||
WebsiteSettings::SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE,
|
PageInfo::SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE,
|
||||||
WebsiteSettings::SITE_IDENTITY_STATUS_ERROR, IDR_PAGEINFO_WARNING_MINOR},
|
PageInfo::SITE_IDENTITY_STATUS_ERROR, IDR_PAGEINFO_WARNING_MINOR},
|
||||||
};
|
};
|
||||||
|
|
||||||
for (const auto& test : kTestCases) {
|
for (const auto& test : kTestCases) {
|
||||||
ResetMockUI();
|
ResetMockUI();
|
||||||
ClearWebsiteSettings();
|
ClearPageInfo();
|
||||||
security_info_ = security_state::SecurityInfo();
|
security_info_ = security_state::SecurityInfo();
|
||||||
security_info_.security_level = test.security_level;
|
security_info_.security_level = test.security_level;
|
||||||
security_info_.scheme_is_cryptographic = true;
|
security_info_.scheme_is_cryptographic = true;
|
||||||
@@ -491,17 +489,17 @@ TEST_F(WebsiteSettingsTest, InsecureContent) {
|
|||||||
SetDefaultUIExpectations(mock_ui());
|
SetDefaultUIExpectations(mock_ui());
|
||||||
|
|
||||||
EXPECT_EQ(test.expected_site_connection_status,
|
EXPECT_EQ(test.expected_site_connection_status,
|
||||||
website_settings()->site_connection_status());
|
page_info()->site_connection_status());
|
||||||
EXPECT_EQ(test.expected_site_identity_status,
|
EXPECT_EQ(test.expected_site_identity_status,
|
||||||
website_settings()->site_identity_status());
|
page_info()->site_identity_status());
|
||||||
EXPECT_EQ(test.expected_connection_icon_id,
|
EXPECT_EQ(
|
||||||
WebsiteSettingsUI::GetConnectionIconID(
|
test.expected_connection_icon_id,
|
||||||
website_settings()->site_connection_status()));
|
PageInfoUI::GetConnectionIconID(page_info()->site_connection_status()));
|
||||||
EXPECT_EQ(base::string16(), website_settings()->organization_name());
|
EXPECT_EQ(base::string16(), page_info()->organization_name());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(WebsiteSettingsTest, HTTPSEVCert) {
|
TEST_F(PageInfoTest, HTTPSEVCert) {
|
||||||
scoped_refptr<net::X509Certificate> ev_cert =
|
scoped_refptr<net::X509Certificate> ev_cert =
|
||||||
net::X509Certificate::CreateFromBytes(
|
net::X509Certificate::CreateFromBytes(
|
||||||
reinterpret_cast<const char*>(google_der), sizeof(google_der));
|
reinterpret_cast<const char*>(google_der), sizeof(google_der));
|
||||||
@@ -521,16 +519,14 @@ TEST_F(WebsiteSettingsTest, HTTPSEVCert) {
|
|||||||
|
|
||||||
SetDefaultUIExpectations(mock_ui());
|
SetDefaultUIExpectations(mock_ui());
|
||||||
|
|
||||||
EXPECT_EQ(
|
EXPECT_EQ(PageInfo::SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE,
|
||||||
WebsiteSettings::SITE_CONNECTION_STATUS_INSECURE_PASSIVE_SUBRESOURCE,
|
page_info()->site_connection_status());
|
||||||
website_settings()->site_connection_status());
|
EXPECT_EQ(PageInfo::SITE_IDENTITY_STATUS_EV_CERT,
|
||||||
EXPECT_EQ(WebsiteSettings::SITE_IDENTITY_STATUS_EV_CERT,
|
page_info()->site_identity_status());
|
||||||
website_settings()->site_identity_status());
|
EXPECT_EQ(base::UTF8ToUTF16("Google Inc"), page_info()->organization_name());
|
||||||
EXPECT_EQ(base::UTF8ToUTF16("Google Inc"),
|
|
||||||
website_settings()->organization_name());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(WebsiteSettingsTest, HTTPSRevocationError) {
|
TEST_F(PageInfoTest, HTTPSRevocationError) {
|
||||||
security_info_.security_level = security_state::SECURE;
|
security_info_.security_level = security_state::SECURE;
|
||||||
security_info_.scheme_is_cryptographic = true;
|
security_info_.scheme_is_cryptographic = true;
|
||||||
security_info_.certificate = cert();
|
security_info_.certificate = cert();
|
||||||
@@ -543,14 +539,14 @@ TEST_F(WebsiteSettingsTest, HTTPSRevocationError) {
|
|||||||
|
|
||||||
SetDefaultUIExpectations(mock_ui());
|
SetDefaultUIExpectations(mock_ui());
|
||||||
|
|
||||||
EXPECT_EQ(WebsiteSettings::SITE_CONNECTION_STATUS_ENCRYPTED,
|
EXPECT_EQ(PageInfo::SITE_CONNECTION_STATUS_ENCRYPTED,
|
||||||
website_settings()->site_connection_status());
|
page_info()->site_connection_status());
|
||||||
EXPECT_EQ(WebsiteSettings::SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN,
|
EXPECT_EQ(PageInfo::SITE_IDENTITY_STATUS_CERT_REVOCATION_UNKNOWN,
|
||||||
website_settings()->site_identity_status());
|
page_info()->site_identity_status());
|
||||||
EXPECT_EQ(base::string16(), website_settings()->organization_name());
|
EXPECT_EQ(base::string16(), page_info()->organization_name());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(WebsiteSettingsTest, HTTPSConnectionError) {
|
TEST_F(PageInfoTest, HTTPSConnectionError) {
|
||||||
security_info_.security_level = security_state::SECURE;
|
security_info_.security_level = security_state::SECURE;
|
||||||
security_info_.scheme_is_cryptographic = true;
|
security_info_.scheme_is_cryptographic = true;
|
||||||
security_info_.certificate = cert();
|
security_info_.certificate = cert();
|
||||||
@@ -563,14 +559,14 @@ TEST_F(WebsiteSettingsTest, HTTPSConnectionError) {
|
|||||||
|
|
||||||
SetDefaultUIExpectations(mock_ui());
|
SetDefaultUIExpectations(mock_ui());
|
||||||
|
|
||||||
EXPECT_EQ(WebsiteSettings::SITE_CONNECTION_STATUS_ENCRYPTED_ERROR,
|
EXPECT_EQ(PageInfo::SITE_CONNECTION_STATUS_ENCRYPTED_ERROR,
|
||||||
website_settings()->site_connection_status());
|
page_info()->site_connection_status());
|
||||||
EXPECT_EQ(WebsiteSettings::SITE_IDENTITY_STATUS_CERT,
|
EXPECT_EQ(PageInfo::SITE_IDENTITY_STATUS_CERT,
|
||||||
website_settings()->site_identity_status());
|
page_info()->site_identity_status());
|
||||||
EXPECT_EQ(base::string16(), website_settings()->organization_name());
|
EXPECT_EQ(base::string16(), page_info()->organization_name());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(WebsiteSettingsTest, HTTPSPolicyCertConnection) {
|
TEST_F(PageInfoTest, HTTPSPolicyCertConnection) {
|
||||||
security_info_.security_level =
|
security_info_.security_level =
|
||||||
security_state::SECURE_WITH_POLICY_INSTALLED_CERT;
|
security_state::SECURE_WITH_POLICY_INSTALLED_CERT;
|
||||||
security_info_.scheme_is_cryptographic = true;
|
security_info_.scheme_is_cryptographic = true;
|
||||||
@@ -584,14 +580,14 @@ TEST_F(WebsiteSettingsTest, HTTPSPolicyCertConnection) {
|
|||||||
|
|
||||||
SetDefaultUIExpectations(mock_ui());
|
SetDefaultUIExpectations(mock_ui());
|
||||||
|
|
||||||
EXPECT_EQ(WebsiteSettings::SITE_CONNECTION_STATUS_ENCRYPTED,
|
EXPECT_EQ(PageInfo::SITE_CONNECTION_STATUS_ENCRYPTED,
|
||||||
website_settings()->site_connection_status());
|
page_info()->site_connection_status());
|
||||||
EXPECT_EQ(WebsiteSettings::SITE_IDENTITY_STATUS_ADMIN_PROVIDED_CERT,
|
EXPECT_EQ(PageInfo::SITE_IDENTITY_STATUS_ADMIN_PROVIDED_CERT,
|
||||||
website_settings()->site_identity_status());
|
page_info()->site_identity_status());
|
||||||
EXPECT_EQ(base::string16(), website_settings()->organization_name());
|
EXPECT_EQ(base::string16(), page_info()->organization_name());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(WebsiteSettingsTest, HTTPSSHA1) {
|
TEST_F(PageInfoTest, HTTPSSHA1) {
|
||||||
security_info_.security_level = security_state::NONE;
|
security_info_.security_level = security_state::NONE;
|
||||||
security_info_.scheme_is_cryptographic = true;
|
security_info_.scheme_is_cryptographic = true;
|
||||||
security_info_.certificate = cert();
|
security_info_.certificate = cert();
|
||||||
@@ -605,68 +601,66 @@ TEST_F(WebsiteSettingsTest, HTTPSSHA1) {
|
|||||||
|
|
||||||
SetDefaultUIExpectations(mock_ui());
|
SetDefaultUIExpectations(mock_ui());
|
||||||
|
|
||||||
EXPECT_EQ(WebsiteSettings::SITE_CONNECTION_STATUS_ENCRYPTED,
|
EXPECT_EQ(PageInfo::SITE_CONNECTION_STATUS_ENCRYPTED,
|
||||||
website_settings()->site_connection_status());
|
page_info()->site_connection_status());
|
||||||
EXPECT_EQ(
|
EXPECT_EQ(PageInfo::SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM,
|
||||||
WebsiteSettings::SITE_IDENTITY_STATUS_DEPRECATED_SIGNATURE_ALGORITHM,
|
page_info()->site_identity_status());
|
||||||
website_settings()->site_identity_status());
|
EXPECT_EQ(base::string16(), page_info()->organization_name());
|
||||||
EXPECT_EQ(base::string16(), website_settings()->organization_name());
|
|
||||||
EXPECT_EQ(IDR_PAGEINFO_WARNING_MINOR,
|
EXPECT_EQ(IDR_PAGEINFO_WARNING_MINOR,
|
||||||
WebsiteSettingsUI::GetIdentityIconID(
|
PageInfoUI::GetIdentityIconID(page_info()->site_identity_status()));
|
||||||
website_settings()->site_identity_status()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(OS_ANDROID)
|
#if !defined(OS_ANDROID)
|
||||||
TEST_F(WebsiteSettingsTest, NoInfoBar) {
|
TEST_F(PageInfoTest, NoInfoBar) {
|
||||||
SetDefaultUIExpectations(mock_ui());
|
SetDefaultUIExpectations(mock_ui());
|
||||||
EXPECT_EQ(0u, infobar_service()->infobar_count());
|
EXPECT_EQ(0u, infobar_service()->infobar_count());
|
||||||
website_settings()->OnUIClosing();
|
page_info()->OnUIClosing();
|
||||||
EXPECT_EQ(0u, infobar_service()->infobar_count());
|
EXPECT_EQ(0u, infobar_service()->infobar_count());
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(WebsiteSettingsTest, ShowInfoBar) {
|
TEST_F(PageInfoTest, ShowInfoBar) {
|
||||||
EXPECT_CALL(*mock_ui(), SetIdentityInfo(_));
|
EXPECT_CALL(*mock_ui(), SetIdentityInfo(_));
|
||||||
EXPECT_CALL(*mock_ui(), SetCookieInfo(_));
|
EXPECT_CALL(*mock_ui(), SetCookieInfo(_));
|
||||||
|
|
||||||
EXPECT_CALL(*mock_ui(), SetPermissionInfoStub()).Times(2);
|
EXPECT_CALL(*mock_ui(), SetPermissionInfoStub()).Times(2);
|
||||||
|
|
||||||
EXPECT_EQ(0u, infobar_service()->infobar_count());
|
EXPECT_EQ(0u, infobar_service()->infobar_count());
|
||||||
website_settings()->OnSitePermissionChanged(CONTENT_SETTINGS_TYPE_GEOLOCATION,
|
page_info()->OnSitePermissionChanged(CONTENT_SETTINGS_TYPE_GEOLOCATION,
|
||||||
CONTENT_SETTING_ALLOW);
|
CONTENT_SETTING_ALLOW);
|
||||||
website_settings()->OnUIClosing();
|
page_info()->OnUIClosing();
|
||||||
ASSERT_EQ(1u, infobar_service()->infobar_count());
|
ASSERT_EQ(1u, infobar_service()->infobar_count());
|
||||||
|
|
||||||
infobar_service()->RemoveInfoBar(infobar_service()->infobar_at(0));
|
infobar_service()->RemoveInfoBar(infobar_service()->infobar_at(0));
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
TEST_F(WebsiteSettingsTest, AboutBlankPage) {
|
TEST_F(PageInfoTest, AboutBlankPage) {
|
||||||
SetURL("about:blank");
|
SetURL("about:blank");
|
||||||
SetDefaultUIExpectations(mock_ui());
|
SetDefaultUIExpectations(mock_ui());
|
||||||
EXPECT_EQ(WebsiteSettings::SITE_CONNECTION_STATUS_UNENCRYPTED,
|
EXPECT_EQ(PageInfo::SITE_CONNECTION_STATUS_UNENCRYPTED,
|
||||||
website_settings()->site_connection_status());
|
page_info()->site_connection_status());
|
||||||
EXPECT_EQ(WebsiteSettings::SITE_IDENTITY_STATUS_NO_CERT,
|
EXPECT_EQ(PageInfo::SITE_IDENTITY_STATUS_NO_CERT,
|
||||||
website_settings()->site_identity_status());
|
page_info()->site_identity_status());
|
||||||
EXPECT_EQ(base::string16(), website_settings()->organization_name());
|
EXPECT_EQ(base::string16(), page_info()->organization_name());
|
||||||
}
|
}
|
||||||
|
|
||||||
// On desktop, internal URLs aren't handled by WebsiteSettings class. Instead, a
|
// On desktop, internal URLs aren't handled by PageInfo class. Instead, a
|
||||||
// custom and simpler popup is shown, so no need to test.
|
// custom and simpler popup is shown, so no need to test.
|
||||||
#if defined(OS_ANDROID) || defined(OS_IOS)
|
#if defined(OS_ANDROID) || defined(OS_IOS)
|
||||||
TEST_F(WebsiteSettingsTest, InternalPage) {
|
TEST_F(PageInfoTest, InternalPage) {
|
||||||
SetURL("chrome://bookmarks");
|
SetURL("chrome://bookmarks");
|
||||||
SetDefaultUIExpectations(mock_ui());
|
SetDefaultUIExpectations(mock_ui());
|
||||||
EXPECT_EQ(WebsiteSettings::SITE_CONNECTION_STATUS_INTERNAL_PAGE,
|
EXPECT_EQ(PageInfo::SITE_CONNECTION_STATUS_INTERNAL_PAGE,
|
||||||
website_settings()->site_connection_status());
|
page_info()->site_connection_status());
|
||||||
EXPECT_EQ(WebsiteSettings::SITE_IDENTITY_STATUS_INTERNAL_PAGE,
|
EXPECT_EQ(PageInfo::SITE_IDENTITY_STATUS_INTERNAL_PAGE,
|
||||||
website_settings()->site_identity_status());
|
page_info()->site_identity_status());
|
||||||
EXPECT_EQ(base::string16(), website_settings()->organization_name());
|
EXPECT_EQ(base::string16(), page_info()->organization_name());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Tests that metrics are recorded on a WebsiteSettings for pages with
|
// Tests that metrics are recorded on a PageInfo for pages with
|
||||||
// various security levels.
|
// various security levels.
|
||||||
TEST_F(WebsiteSettingsTest, SecurityLevelMetrics) {
|
TEST_F(PageInfoTest, SecurityLevelMetrics) {
|
||||||
struct TestCase {
|
struct TestCase {
|
||||||
const std::string url;
|
const std::string url;
|
||||||
const security_state::SecurityLevel security_level;
|
const security_state::SecurityLevel security_level;
|
||||||
@@ -696,26 +690,24 @@ TEST_F(WebsiteSettingsTest, SecurityLevelMetrics) {
|
|||||||
SetURL(test.url);
|
SetURL(test.url);
|
||||||
security_info_.security_level = test.security_level;
|
security_info_.security_level = test.security_level;
|
||||||
ResetMockUI();
|
ResetMockUI();
|
||||||
ClearWebsiteSettings();
|
ClearPageInfo();
|
||||||
SetDefaultUIExpectations(mock_ui());
|
SetDefaultUIExpectations(mock_ui());
|
||||||
|
|
||||||
histograms.ExpectTotalCount(kGenericHistogram, 0);
|
histograms.ExpectTotalCount(kGenericHistogram, 0);
|
||||||
histograms.ExpectTotalCount(test.histogram_name, 0);
|
histograms.ExpectTotalCount(test.histogram_name, 0);
|
||||||
|
|
||||||
website_settings()->RecordWebsiteSettingsAction(
|
page_info()->RecordPageInfoAction(
|
||||||
WebsiteSettings::WebsiteSettingsAction::WEBSITE_SETTINGS_OPENED);
|
PageInfo::PageInfoAction::PAGE_INFO_OPENED);
|
||||||
|
|
||||||
// RecordWebsiteSettingsAction() is called during WebsiteSettings
|
// RecordPageInfoAction() is called during PageInfo
|
||||||
// creation in addition to the explicit RecordWebsiteSettingsAction()
|
// creation in addition to the explicit RecordPageInfoAction()
|
||||||
// call, so it is called twice in total.
|
// call, so it is called twice in total.
|
||||||
histograms.ExpectTotalCount(kGenericHistogram, 2);
|
histograms.ExpectTotalCount(kGenericHistogram, 2);
|
||||||
histograms.ExpectBucketCount(
|
histograms.ExpectBucketCount(kGenericHistogram,
|
||||||
kGenericHistogram,
|
PageInfo::PageInfoAction::PAGE_INFO_OPENED, 2);
|
||||||
WebsiteSettings::WebsiteSettingsAction::WEBSITE_SETTINGS_OPENED, 2);
|
|
||||||
|
|
||||||
histograms.ExpectTotalCount(test.histogram_name, 2);
|
histograms.ExpectTotalCount(test.histogram_name, 2);
|
||||||
histograms.ExpectBucketCount(
|
histograms.ExpectBucketCount(test.histogram_name,
|
||||||
test.histogram_name,
|
PageInfo::PageInfoAction::PAGE_INFO_OPENED, 2);
|
||||||
WebsiteSettings::WebsiteSettingsAction::WEBSITE_SETTINGS_OPENED, 2);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -14,11 +14,10 @@
|
|||||||
#include "ui/base/l10n/l10n_util.h"
|
#include "ui/base/l10n/l10n_util.h"
|
||||||
#include "ui/base/material_design/material_design_controller.h"
|
#include "ui/base/material_design/material_design_controller.h"
|
||||||
|
|
||||||
PermissionMenuModel::PermissionMenuModel(
|
PermissionMenuModel::PermissionMenuModel(Profile* profile,
|
||||||
Profile* profile,
|
const GURL& url,
|
||||||
const GURL& url,
|
const PageInfoUI::PermissionInfo& info,
|
||||||
const WebsiteSettingsUI::PermissionInfo& info,
|
const ChangeCallback& callback)
|
||||||
const ChangeCallback& callback)
|
|
||||||
: ui::SimpleMenuModel(this),
|
: ui::SimpleMenuModel(this),
|
||||||
host_content_settings_map_(
|
host_content_settings_map_(
|
||||||
HostContentSettingsMapFactory::GetForProfile(profile)),
|
HostContentSettingsMapFactory::GetForProfile(profile)),
|
||||||
@@ -38,16 +37,13 @@ PermissionMenuModel::PermissionMenuModel(
|
|||||||
|
|
||||||
switch (effective_default_setting) {
|
switch (effective_default_setting) {
|
||||||
case CONTENT_SETTING_ALLOW:
|
case CONTENT_SETTING_ALLOW:
|
||||||
label = l10n_util::GetStringUTF16(
|
label = l10n_util::GetStringUTF16(IDS_PAGE_INFO_MENU_ITEM_DEFAULT_ALLOW);
|
||||||
IDS_WEBSITE_SETTINGS_MENU_ITEM_DEFAULT_ALLOW);
|
|
||||||
break;
|
break;
|
||||||
case CONTENT_SETTING_BLOCK:
|
case CONTENT_SETTING_BLOCK:
|
||||||
label = l10n_util::GetStringUTF16(
|
label = l10n_util::GetStringUTF16(IDS_PAGE_INFO_MENU_ITEM_DEFAULT_BLOCK);
|
||||||
IDS_WEBSITE_SETTINGS_MENU_ITEM_DEFAULT_BLOCK);
|
|
||||||
break;
|
break;
|
||||||
case CONTENT_SETTING_ASK:
|
case CONTENT_SETTING_ASK:
|
||||||
label =
|
label = l10n_util::GetStringUTF16(IDS_PAGE_INFO_MENU_ITEM_DEFAULT_ASK);
|
||||||
l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_MENU_ITEM_DEFAULT_ASK);
|
|
||||||
break;
|
break;
|
||||||
case CONTENT_SETTING_DETECT_IMPORTANT_CONTENT:
|
case CONTENT_SETTING_DETECT_IMPORTANT_CONTENT:
|
||||||
// TODO(tommycli): We display the ASK string for DETECT because with
|
// TODO(tommycli): We display the ASK string for DETECT because with
|
||||||
@@ -55,8 +51,8 @@ PermissionMenuModel::PermissionMenuModel(
|
|||||||
// Once the feature flag is gone, migrate the actual setting to ASK.
|
// Once the feature flag is gone, migrate the actual setting to ASK.
|
||||||
label = l10n_util::GetStringUTF16(
|
label = l10n_util::GetStringUTF16(
|
||||||
PluginUtils::ShouldPreferHtmlOverPlugins(host_content_settings_map_)
|
PluginUtils::ShouldPreferHtmlOverPlugins(host_content_settings_map_)
|
||||||
? IDS_WEBSITE_SETTINGS_MENU_ITEM_DEFAULT_ASK
|
? IDS_PAGE_INFO_MENU_ITEM_DEFAULT_ASK
|
||||||
: IDS_WEBSITE_SETTINGS_MENU_ITEM_DEFAULT_DETECT_IMPORTANT_CONTENT);
|
: IDS_PAGE_INFO_MENU_ITEM_DEFAULT_DETECT_IMPORTANT_CONTENT);
|
||||||
break;
|
break;
|
||||||
case CONTENT_SETTING_NUM_SETTINGS:
|
case CONTENT_SETTING_NUM_SETTINGS:
|
||||||
NOTREACHED();
|
NOTREACHED();
|
||||||
@@ -68,7 +64,7 @@ PermissionMenuModel::PermissionMenuModel(
|
|||||||
// which means the elements of the menu themselves have to be shorter, instead
|
// which means the elements of the menu themselves have to be shorter, instead
|
||||||
// of simply setting a shorter label on the menubutton.
|
// of simply setting a shorter label on the menubutton.
|
||||||
if (ui::MaterialDesignController::IsSecondaryUiMaterial()) {
|
if (ui::MaterialDesignController::IsSecondaryUiMaterial()) {
|
||||||
label = WebsiteSettingsUI::PermissionActionToUIString(
|
label = PageInfoUI::PermissionActionToUIString(
|
||||||
profile, permission_.type, CONTENT_SETTING_DEFAULT,
|
profile, permission_.type, CONTENT_SETTING_DEFAULT,
|
||||||
effective_default_setting, permission_.source);
|
effective_default_setting, permission_.source);
|
||||||
}
|
}
|
||||||
@@ -86,9 +82,9 @@ PermissionMenuModel::PermissionMenuModel(
|
|||||||
permission_.type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA;
|
permission_.type == CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA;
|
||||||
if (!allow_disabled_for_notifications &&
|
if (!allow_disabled_for_notifications &&
|
||||||
(!is_media_permission || content::IsOriginSecure(url))) {
|
(!is_media_permission || content::IsOriginSecure(url))) {
|
||||||
label = l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_MENU_ITEM_ALLOW);
|
label = l10n_util::GetStringUTF16(IDS_PAGE_INFO_MENU_ITEM_ALLOW);
|
||||||
if (ui::MaterialDesignController::IsSecondaryUiMaterial()) {
|
if (ui::MaterialDesignController::IsSecondaryUiMaterial()) {
|
||||||
label = WebsiteSettingsUI::PermissionActionToUIString(
|
label = PageInfoUI::PermissionActionToUIString(
|
||||||
profile, permission_.type, CONTENT_SETTING_ALLOW,
|
profile, permission_.type, CONTENT_SETTING_ALLOW,
|
||||||
effective_default_setting, permission_.source);
|
effective_default_setting, permission_.source);
|
||||||
}
|
}
|
||||||
@@ -101,14 +97,14 @@ PermissionMenuModel::PermissionMenuModel(
|
|||||||
if (permission_.type == CONTENT_SETTINGS_TYPE_PLUGINS &&
|
if (permission_.type == CONTENT_SETTINGS_TYPE_PLUGINS &&
|
||||||
!PluginUtils::ShouldPreferHtmlOverPlugins(host_content_settings_map_)) {
|
!PluginUtils::ShouldPreferHtmlOverPlugins(host_content_settings_map_)) {
|
||||||
label = l10n_util::GetStringUTF16(
|
label = l10n_util::GetStringUTF16(
|
||||||
IDS_WEBSITE_SETTINGS_MENU_ITEM_DETECT_IMPORTANT_CONTENT);
|
IDS_PAGE_INFO_MENU_ITEM_DETECT_IMPORTANT_CONTENT);
|
||||||
AddCheckItem(CONTENT_SETTING_DETECT_IMPORTANT_CONTENT, label);
|
AddCheckItem(CONTENT_SETTING_DETECT_IMPORTANT_CONTENT, label);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Retrieve the string to show for blocking the permission.
|
// Retrieve the string to show for blocking the permission.
|
||||||
label = l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_MENU_ITEM_BLOCK);
|
label = l10n_util::GetStringUTF16(IDS_PAGE_INFO_MENU_ITEM_BLOCK);
|
||||||
if (ui::MaterialDesignController::IsSecondaryUiMaterial()) {
|
if (ui::MaterialDesignController::IsSecondaryUiMaterial()) {
|
||||||
label = WebsiteSettingsUI::PermissionActionToUIString(
|
label = PageInfoUI::PermissionActionToUIString(
|
||||||
profile, info.type, CONTENT_SETTING_BLOCK, effective_default_setting,
|
profile, info.type, CONTENT_SETTING_BLOCK, effective_default_setting,
|
||||||
info.source);
|
info.source);
|
||||||
}
|
}
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
#define CHROME_BROWSER_UI_PAGE_INFO_PERMISSION_MENU_MODEL_H_
|
#define CHROME_BROWSER_UI_PAGE_INFO_PERMISSION_MENU_MODEL_H_
|
||||||
|
|
||||||
#include "base/macros.h"
|
#include "base/macros.h"
|
||||||
#include "chrome/browser/ui/page_info/website_settings_ui.h"
|
#include "chrome/browser/ui/page_info/page_info_ui.h"
|
||||||
#include "components/content_settings/core/common/content_settings.h"
|
#include "components/content_settings/core/common/content_settings.h"
|
||||||
#include "components/content_settings/core/common/content_settings_types.h"
|
#include "components/content_settings/core/common/content_settings_types.h"
|
||||||
#include "ui/base/models/simple_menu_model.h"
|
#include "ui/base/models/simple_menu_model.h"
|
||||||
@@ -18,13 +18,13 @@ class Profile;
|
|||||||
class PermissionMenuModel : public ui::SimpleMenuModel,
|
class PermissionMenuModel : public ui::SimpleMenuModel,
|
||||||
public ui::SimpleMenuModel::Delegate {
|
public ui::SimpleMenuModel::Delegate {
|
||||||
public:
|
public:
|
||||||
typedef base::Callback<void(const WebsiteSettingsUI::PermissionInfo&)>
|
typedef base::Callback<void(const PageInfoUI::PermissionInfo&)>
|
||||||
ChangeCallback;
|
ChangeCallback;
|
||||||
|
|
||||||
// Create a new menu model for permission settings.
|
// Create a new menu model for permission settings.
|
||||||
PermissionMenuModel(Profile* profile,
|
PermissionMenuModel(Profile* profile,
|
||||||
const GURL& url,
|
const GURL& url,
|
||||||
const WebsiteSettingsUI::PermissionInfo& info,
|
const PageInfoUI::PermissionInfo& info,
|
||||||
const ChangeCallback& callback);
|
const ChangeCallback& callback);
|
||||||
// Creates a special-case menu model that only has the allow and block
|
// Creates a special-case menu model that only has the allow and block
|
||||||
// options. It does not track a permission type. |setting| is the
|
// options. It does not track a permission type. |setting| is the
|
||||||
@@ -45,7 +45,7 @@ class PermissionMenuModel : public ui::SimpleMenuModel,
|
|||||||
HostContentSettingsMap* host_content_settings_map_;
|
HostContentSettingsMap* host_content_settings_map_;
|
||||||
|
|
||||||
// The permission info represented by the menu model.
|
// The permission info represented by the menu model.
|
||||||
WebsiteSettingsUI::PermissionInfo permission_;
|
PageInfoUI::PermissionInfo permission_;
|
||||||
|
|
||||||
// Callback to be called when the permission's setting is changed.
|
// Callback to be called when the permission's setting is changed.
|
||||||
ChangeCallback callback_;
|
ChangeCallback callback_;
|
||||||
|
@@ -18,7 +18,7 @@ class TestCallback {
|
|||||||
PermissionMenuModel::ChangeCallback callback() {
|
PermissionMenuModel::ChangeCallback callback() {
|
||||||
return base::Bind(&TestCallback::PermissionChanged, base::Unretained(this));
|
return base::Bind(&TestCallback::PermissionChanged, base::Unretained(this));
|
||||||
}
|
}
|
||||||
void PermissionChanged(const WebsiteSettingsUI::PermissionInfo& permission) {
|
void PermissionChanged(const PageInfoUI::PermissionInfo& permission) {
|
||||||
current_ = permission.setting;
|
current_ = permission.setting;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ class PermissionMenuModelTest : public testing::Test {
|
|||||||
|
|
||||||
TEST_F(PermissionMenuModelTest, TestDefault) {
|
TEST_F(PermissionMenuModelTest, TestDefault) {
|
||||||
TestCallback callback;
|
TestCallback callback;
|
||||||
WebsiteSettingsUI::PermissionInfo permission;
|
PageInfoUI::PermissionInfo permission;
|
||||||
permission.type = CONTENT_SETTINGS_TYPE_COOKIES;
|
permission.type = CONTENT_SETTINGS_TYPE_COOKIES;
|
||||||
permission.setting = CONTENT_SETTING_ALLOW;
|
permission.setting = CONTENT_SETTING_ALLOW;
|
||||||
permission.default_setting = CONTENT_SETTING_ALLOW;
|
permission.default_setting = CONTENT_SETTING_ALLOW;
|
||||||
@@ -53,7 +53,7 @@ TEST_F(PermissionMenuModelTest, TestDefaultMediaHttp) {
|
|||||||
ContentSettingsType type = i ? CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC
|
ContentSettingsType type = i ? CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC
|
||||||
: CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA;
|
: CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA;
|
||||||
TestCallback callback;
|
TestCallback callback;
|
||||||
WebsiteSettingsUI::PermissionInfo permission;
|
PageInfoUI::PermissionInfo permission;
|
||||||
permission.type = type;
|
permission.type = type;
|
||||||
permission.setting = CONTENT_SETTING_ALLOW;
|
permission.setting = CONTENT_SETTING_ALLOW;
|
||||||
permission.default_setting = CONTENT_SETTING_ALLOW;
|
permission.default_setting = CONTENT_SETTING_ALLOW;
|
||||||
@@ -73,7 +73,7 @@ TEST_F(PermissionMenuModelTest, TestAllowBlock) {
|
|||||||
|
|
||||||
TEST_F(PermissionMenuModelTest, TestIncognitoNotifications) {
|
TEST_F(PermissionMenuModelTest, TestIncognitoNotifications) {
|
||||||
TestCallback callback;
|
TestCallback callback;
|
||||||
WebsiteSettingsUI::PermissionInfo permission;
|
PageInfoUI::PermissionInfo permission;
|
||||||
permission.type = CONTENT_SETTINGS_TYPE_NOTIFICATIONS;
|
permission.type = CONTENT_SETTINGS_TYPE_NOTIFICATIONS;
|
||||||
permission.setting = CONTENT_SETTING_ASK;
|
permission.setting = CONTENT_SETTING_ASK;
|
||||||
permission.default_setting = CONTENT_SETTING_ASK;
|
permission.default_setting = CONTENT_SETTING_ASK;
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
#include "chrome/browser/ui/browser_dialogs.h"
|
#include "chrome/browser/ui/browser_dialogs.h"
|
||||||
#include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h"
|
#include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h"
|
||||||
#include "chrome/browser/ui/views/content_setting_bubble_contents.h"
|
#include "chrome/browser/ui/views/content_setting_bubble_contents.h"
|
||||||
#include "chrome/browser/ui/views/page_info/website_settings_popup_view.h"
|
#include "chrome/browser/ui/views/page_info/page_info_popup_view.h"
|
||||||
#include "chrome/browser/ui/views/task_manager_view.h"
|
#include "chrome/browser/ui/views/task_manager_view.h"
|
||||||
#include "chrome/browser/ui/views/update_recommended_message_box.h"
|
#include "chrome/browser/ui/views/update_recommended_message_box.h"
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
namespace chrome {
|
namespace chrome {
|
||||||
|
|
||||||
void ShowWebsiteSettingsBubbleViewsAtPoint(
|
void ShowPageInfoBubbleViewsAtPoint(
|
||||||
const gfx::Point& anchor_point,
|
const gfx::Point& anchor_point,
|
||||||
Profile* profile,
|
Profile* profile,
|
||||||
content::WebContents* web_contents,
|
content::WebContents* web_contents,
|
||||||
@@ -34,14 +34,13 @@ void ShowWebsiteSettingsBubbleViewsAtPoint(
|
|||||||
// earlier because the popup is shown on mouse release (but dismissed on
|
// earlier because the popup is shown on mouse release (but dismissed on
|
||||||
// mouse pressed). A Cocoa browser does both on mouse pressed, so a check
|
// mouse pressed). A Cocoa browser does both on mouse pressed, so a check
|
||||||
// when showing is sufficient.
|
// when showing is sufficient.
|
||||||
if (WebsiteSettingsPopupView::GetShownPopupType() !=
|
if (PageInfoPopupView::GetShownPopupType() != PageInfoPopupView::POPUP_NONE) {
|
||||||
WebsiteSettingsPopupView::POPUP_NONE) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebsiteSettingsPopupView::ShowPopup(
|
PageInfoPopupView::ShowPopup(nullptr, gfx::Rect(anchor_point, gfx::Size()),
|
||||||
nullptr, gfx::Rect(anchor_point, gfx::Size()), profile, web_contents,
|
profile, web_contents, virtual_url,
|
||||||
virtual_url, security_info);
|
security_info);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShowBookmarkBubbleViewsAtPoint(const gfx::Point& anchor_point,
|
void ShowBookmarkBubbleViewsAtPoint(const gfx::Point& anchor_point,
|
||||||
|
@@ -80,7 +80,7 @@
|
|||||||
#include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h"
|
#include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h"
|
||||||
#include "chrome/browser/ui/views/new_back_shortcut_bubble.h"
|
#include "chrome/browser/ui/views/new_back_shortcut_bubble.h"
|
||||||
#include "chrome/browser/ui/views/omnibox/omnibox_view_views.h"
|
#include "chrome/browser/ui/views/omnibox/omnibox_view_views.h"
|
||||||
#include "chrome/browser/ui/views/page_info/website_settings_popup_view.h"
|
#include "chrome/browser/ui/views/page_info/page_info_popup_view.h"
|
||||||
#include "chrome/browser/ui/views/profiles/profile_indicator_icon.h"
|
#include "chrome/browser/ui/views/profiles/profile_indicator_icon.h"
|
||||||
#include "chrome/browser/ui/views/status_bubble_views.h"
|
#include "chrome/browser/ui/views/status_bubble_views.h"
|
||||||
#include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h"
|
#include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h"
|
||||||
@@ -1285,12 +1285,12 @@ void BrowserView::UserChangedTheme() {
|
|||||||
frame_->FrameTypeChanged();
|
frame_->FrameTypeChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BrowserView::ShowWebsiteSettings(
|
void BrowserView::ShowPageInfo(
|
||||||
Profile* profile,
|
Profile* profile,
|
||||||
content::WebContents* web_contents,
|
content::WebContents* web_contents,
|
||||||
const GURL& virtual_url,
|
const GURL& virtual_url,
|
||||||
const security_state::SecurityInfo& security_info) {
|
const security_state::SecurityInfo& security_info) {
|
||||||
WebsiteSettingsPopupView::ShowPopup(
|
PageInfoPopupView::ShowPopup(
|
||||||
GetLocationBarView()->GetSecurityBubbleAnchorView(), gfx::Rect(), profile,
|
GetLocationBarView()->GetSecurityBubbleAnchorView(), gfx::Rect(), profile,
|
||||||
web_contents, virtual_url, security_info);
|
web_contents, virtual_url, security_info);
|
||||||
}
|
}
|
||||||
|
@@ -341,11 +341,10 @@ class BrowserView : public BrowserWindow,
|
|||||||
bool app_modal,
|
bool app_modal,
|
||||||
const base::Callback<void(bool)>& callback) override;
|
const base::Callback<void(bool)>& callback) override;
|
||||||
void UserChangedTheme() override;
|
void UserChangedTheme() override;
|
||||||
void ShowWebsiteSettings(
|
void ShowPageInfo(Profile* profile,
|
||||||
Profile* profile,
|
content::WebContents* web_contents,
|
||||||
content::WebContents* web_contents,
|
const GURL& virtual_url,
|
||||||
const GURL& virtual_url,
|
const security_state::SecurityInfo& security_info) override;
|
||||||
const security_state::SecurityInfo& security_info) override;
|
|
||||||
void ShowAppMenu() override;
|
void ShowAppMenu() override;
|
||||||
content::KeyboardEventProcessingResult PreHandleKeyboardEvent(
|
content::KeyboardEventProcessingResult PreHandleKeyboardEvent(
|
||||||
const content::NativeWebKeyboardEvent& event) override;
|
const content::NativeWebKeyboardEvent& event) override;
|
||||||
|
@@ -82,7 +82,7 @@ class LocationBarView : public LocationBar,
|
|||||||
GetContentSettingBubbleModelDelegate() = 0;
|
GetContentSettingBubbleModelDelegate() = 0;
|
||||||
|
|
||||||
// Shows permissions and settings for the given web contents.
|
// Shows permissions and settings for the given web contents.
|
||||||
virtual void ShowWebsiteSettings(content::WebContents* web_contents) = 0;
|
virtual void ShowPageInfo(content::WebContents* web_contents) = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~Delegate() {}
|
virtual ~Delegate() {}
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
#include "chrome/browser/ui/view_ids.h"
|
#include "chrome/browser/ui/view_ids.h"
|
||||||
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
|
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
|
||||||
#include "chrome/browser/ui/views/page_info/website_settings_popup_view.h"
|
#include "chrome/browser/ui/views/page_info/page_info_popup_view.h"
|
||||||
#include "chrome/grit/generated_resources.h"
|
#include "chrome/grit/generated_resources.h"
|
||||||
#include "chrome/grit/theme_resources.h"
|
#include "chrome/grit/theme_resources.h"
|
||||||
#include "components/grit/components_scaled_resources.h"
|
#include "components/grit/components_scaled_resources.h"
|
||||||
@@ -55,8 +55,7 @@ bool LocationIconView::OnMousePressed(const ui::MouseEvent& event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
suppress_mouse_released_action_ =
|
suppress_mouse_released_action_ =
|
||||||
WebsiteSettingsPopupView::GetShownPopupType() !=
|
PageInfoPopupView::GetShownPopupType() != PageInfoPopupView::POPUP_NONE;
|
||||||
WebsiteSettingsPopupView::POPUP_NONE;
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,7 +101,7 @@ bool LocationIconView::OnActivate(const ui::Event& event) {
|
|||||||
WebContents* contents = location_bar_->GetWebContents();
|
WebContents* contents = location_bar_->GetWebContents();
|
||||||
if (!contents)
|
if (!contents)
|
||||||
return false;
|
return false;
|
||||||
location_bar_->delegate()->ShowWebsiteSettings(contents);
|
location_bar_->delegate()->ShowPageInfo(contents);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
#include "chrome/browser/ui/views/frame/browser_view.h"
|
#include "chrome/browser/ui/views/frame/browser_view.h"
|
||||||
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
|
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
|
||||||
#include "chrome/browser/ui/views/page_info/website_settings_popup_view.h"
|
#include "chrome/browser/ui/views/page_info/page_info_popup_view.h"
|
||||||
#include "chrome/browser/ui/views/toolbar/toolbar_view.h"
|
#include "chrome/browser/ui/views/toolbar/toolbar_view.h"
|
||||||
#include "chrome/test/base/in_process_browser_test.h"
|
#include "chrome/test/base/in_process_browser_test.h"
|
||||||
#include "chrome/test/base/interactive_test_utils.h"
|
#include "chrome/test/base/interactive_test_utils.h"
|
||||||
@@ -32,8 +32,8 @@ IN_PROC_BROWSER_TEST_F(LocationIconViewTest, HideOnSecondClick) {
|
|||||||
runner1->QuitClosure());
|
runner1->QuitClosure());
|
||||||
runner1->Run();
|
runner1->Run();
|
||||||
|
|
||||||
EXPECT_EQ(WebsiteSettingsPopupView::POPUP_WEBSITE_SETTINGS,
|
EXPECT_EQ(PageInfoPopupView::POPUP_PAGE_INFO,
|
||||||
WebsiteSettingsPopupView::GetShownPopupType());
|
PageInfoPopupView::GetShownPopupType());
|
||||||
|
|
||||||
// Verify that clicking again doesn't reshow it.
|
// Verify that clicking again doesn't reshow it.
|
||||||
scoped_refptr<content::MessageLoopRunner> runner2 =
|
scoped_refptr<content::MessageLoopRunner> runner2 =
|
||||||
@@ -45,8 +45,8 @@ IN_PROC_BROWSER_TEST_F(LocationIconViewTest, HideOnSecondClick) {
|
|||||||
runner2->QuitClosure());
|
runner2->QuitClosure());
|
||||||
runner2->Run();
|
runner2->Run();
|
||||||
|
|
||||||
EXPECT_EQ(WebsiteSettingsPopupView::POPUP_NONE,
|
EXPECT_EQ(PageInfoPopupView::POPUP_NONE,
|
||||||
WebsiteSettingsPopupView::GetShownPopupType());
|
PageInfoPopupView::GetShownPopupType());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
@@ -5,7 +5,7 @@
|
|||||||
#include "chrome/browser/ui/views/page_info/chosen_object_row.h"
|
#include "chrome/browser/ui/views/page_info/chosen_object_row.h"
|
||||||
|
|
||||||
#include "chrome/browser/ui/views/page_info/chosen_object_row_observer.h"
|
#include "chrome/browser/ui/views/page_info/chosen_object_row_observer.h"
|
||||||
#include "chrome/browser/ui/views/page_info/website_settings_popup_view.h"
|
#include "chrome/browser/ui/views/page_info/page_info_popup_view.h"
|
||||||
#include "ui/base/l10n/l10n_util.h"
|
#include "ui/base/l10n/l10n_util.h"
|
||||||
#include "ui/base/resource/resource_bundle.h"
|
#include "ui/base/resource/resource_bundle.h"
|
||||||
#include "ui/resources/grit/ui_resources.h"
|
#include "ui/resources/grit/ui_resources.h"
|
||||||
@@ -15,7 +15,7 @@
|
|||||||
#include "ui/views/layout/grid_layout.h"
|
#include "ui/views/layout/grid_layout.h"
|
||||||
|
|
||||||
ChosenObjectRow::ChosenObjectRow(
|
ChosenObjectRow::ChosenObjectRow(
|
||||||
std::unique_ptr<WebsiteSettingsUI::ChosenObjectInfo> info)
|
std::unique_ptr<PageInfoUI::ChosenObjectInfo> info)
|
||||||
: info_(std::move(info)) {
|
: info_(std::move(info)) {
|
||||||
views::GridLayout* layout = new views::GridLayout(this);
|
views::GridLayout* layout = new views::GridLayout(this);
|
||||||
SetLayoutManager(layout);
|
SetLayoutManager(layout);
|
||||||
@@ -33,15 +33,14 @@ ChosenObjectRow::ChosenObjectRow(
|
|||||||
layout->StartRow(1, column_set_id);
|
layout->StartRow(1, column_set_id);
|
||||||
// Create the permission icon.
|
// Create the permission icon.
|
||||||
icon_ = new views::ImageView();
|
icon_ = new views::ImageView();
|
||||||
const gfx::Image& image =
|
const gfx::Image& image = PageInfoUI::GetChosenObjectIcon(*info_, false);
|
||||||
WebsiteSettingsUI::GetChosenObjectIcon(*info_, false);
|
|
||||||
icon_->SetImage(image.ToImageSkia());
|
icon_->SetImage(image.ToImageSkia());
|
||||||
layout->AddView(icon_, 1, 1, views::GridLayout::CENTER,
|
layout->AddView(icon_, 1, 1, views::GridLayout::CENTER,
|
||||||
views::GridLayout::CENTER);
|
views::GridLayout::CENTER);
|
||||||
// Create the label that displays the permission type.
|
// Create the label that displays the permission type.
|
||||||
views::Label* label = new views::Label(l10n_util::GetStringFUTF16(
|
views::Label* label = new views::Label(
|
||||||
info_->ui_info.label_string_id,
|
l10n_util::GetStringFUTF16(info_->ui_info.label_string_id,
|
||||||
WebsiteSettingsUI::ChosenObjectToUIString(*info_)));
|
PageInfoUI::ChosenObjectToUIString(*info_)));
|
||||||
layout->AddView(label, 1, 1, views::GridLayout::LEADING,
|
layout->AddView(label, 1, 1, views::GridLayout::LEADING,
|
||||||
views::GridLayout::CENTER);
|
views::GridLayout::CENTER);
|
||||||
// Create the delete button.
|
// Create the delete button.
|
||||||
@@ -70,8 +69,7 @@ ChosenObjectRow::~ChosenObjectRow() {}
|
|||||||
void ChosenObjectRow::ButtonPressed(views::Button* sender,
|
void ChosenObjectRow::ButtonPressed(views::Button* sender,
|
||||||
const ui::Event& event) {
|
const ui::Event& event) {
|
||||||
// Change the icon to reflect the selected setting.
|
// Change the icon to reflect the selected setting.
|
||||||
const gfx::Image& image =
|
const gfx::Image& image = PageInfoUI::GetChosenObjectIcon(*info_, true);
|
||||||
WebsiteSettingsUI::GetChosenObjectIcon(*info_, true);
|
|
||||||
icon_->SetImage(image.ToImageSkia());
|
icon_->SetImage(image.ToImageSkia());
|
||||||
|
|
||||||
RemoveChildView(delete_button_);
|
RemoveChildView(delete_button_);
|
||||||
|
@@ -6,7 +6,7 @@
|
|||||||
#define CHROME_BROWSER_UI_VIEWS_PAGE_INFO_CHOSEN_OBJECT_ROW_H_
|
#define CHROME_BROWSER_UI_VIEWS_PAGE_INFO_CHOSEN_OBJECT_ROW_H_
|
||||||
|
|
||||||
#include "base/macros.h"
|
#include "base/macros.h"
|
||||||
#include "chrome/browser/ui/page_info/website_settings_ui.h"
|
#include "chrome/browser/ui/page_info/page_info_ui.h"
|
||||||
#include "ui/views/controls/button/button.h"
|
#include "ui/views/controls/button/button.h"
|
||||||
#include "ui/views/view.h"
|
#include "ui/views/view.h"
|
||||||
|
|
||||||
@@ -22,8 +22,7 @@ class ChosenObjectRowObserver;
|
|||||||
// access to.
|
// access to.
|
||||||
class ChosenObjectRow : public views::View, public views::ButtonListener {
|
class ChosenObjectRow : public views::View, public views::ButtonListener {
|
||||||
public:
|
public:
|
||||||
explicit ChosenObjectRow(
|
explicit ChosenObjectRow(std::unique_ptr<PageInfoUI::ChosenObjectInfo> info);
|
||||||
std::unique_ptr<WebsiteSettingsUI::ChosenObjectInfo> info);
|
|
||||||
|
|
||||||
void AddObserver(ChosenObjectRowObserver* observer);
|
void AddObserver(ChosenObjectRowObserver* observer);
|
||||||
|
|
||||||
@@ -37,7 +36,7 @@ class ChosenObjectRow : public views::View, public views::ButtonListener {
|
|||||||
views::ImageButton* delete_button_; // Owned by the views hierarchy.
|
views::ImageButton* delete_button_; // Owned by the views hierarchy.
|
||||||
|
|
||||||
base::ObserverList<ChosenObjectRowObserver> observer_list_;
|
base::ObserverList<ChosenObjectRowObserver> observer_list_;
|
||||||
std::unique_ptr<WebsiteSettingsUI::ChosenObjectInfo> info_;
|
std::unique_ptr<PageInfoUI::ChosenObjectInfo> info_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(ChosenObjectRow);
|
DISALLOW_COPY_AND_ASSIGN(ChosenObjectRow);
|
||||||
};
|
};
|
||||||
|
@@ -5,13 +5,13 @@
|
|||||||
#ifndef CHROME_BROWSER_UI_VIEWS_PAGE_INFO_CHOSEN_OBJECT_ROW_OBSERVER_H_
|
#ifndef CHROME_BROWSER_UI_VIEWS_PAGE_INFO_CHOSEN_OBJECT_ROW_OBSERVER_H_
|
||||||
#define CHROME_BROWSER_UI_VIEWS_PAGE_INFO_CHOSEN_OBJECT_ROW_OBSERVER_H_
|
#define CHROME_BROWSER_UI_VIEWS_PAGE_INFO_CHOSEN_OBJECT_ROW_OBSERVER_H_
|
||||||
|
|
||||||
#include "chrome/browser/ui/page_info/website_settings_ui.h"
|
#include "chrome/browser/ui/page_info/page_info_ui.h"
|
||||||
|
|
||||||
class ChosenObjectRowObserver {
|
class ChosenObjectRowObserver {
|
||||||
public:
|
public:
|
||||||
// This method is called when permission for the object is revoked.
|
// This method is called when permission for the object is revoked.
|
||||||
virtual void OnChosenObjectDeleted(
|
virtual void OnChosenObjectDeleted(
|
||||||
const WebsiteSettingsUI::ChosenObjectInfo& info) = 0;
|
const PageInfoUI::ChosenObjectInfo& info) = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~ChosenObjectRowObserver() {}
|
virtual ~ChosenObjectRowObserver() {}
|
||||||
|
@@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#include "chrome/browser/ui/views/page_info/website_settings_popup_view.h"
|
#include "chrome/browser/ui/views/page_info/page_info_popup_view.h"
|
||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
#include "chrome/browser/ui/browser.h"
|
#include "chrome/browser/ui/browser.h"
|
||||||
#include "chrome/browser/ui/browser_dialogs.h"
|
#include "chrome/browser/ui/browser_dialogs.h"
|
||||||
#include "chrome/browser/ui/layout_constants.h"
|
#include "chrome/browser/ui/layout_constants.h"
|
||||||
#include "chrome/browser/ui/page_info/website_settings.h"
|
#include "chrome/browser/ui/page_info/page_info.h"
|
||||||
#include "chrome/browser/ui/views/collected_cookies_views.h"
|
#include "chrome/browser/ui/views/collected_cookies_views.h"
|
||||||
#include "chrome/browser/ui/views/harmony/chrome_typography.h"
|
#include "chrome/browser/ui/views/harmony/chrome_typography.h"
|
||||||
#include "chrome/browser/ui/views/harmony/layout_delegate.h"
|
#include "chrome/browser/ui/views/harmony/layout_delegate.h"
|
||||||
@@ -64,13 +64,12 @@
|
|||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
// NOTE(jdonnelly): This use of this process-wide variable assumes that there's
|
// NOTE(jdonnelly): This use of this process-wide variable assumes that there's
|
||||||
// never more than one website settings popup shown and that it's associated
|
// never more than one page info popup shown and that it's associated
|
||||||
// with the current window. If this assumption fails in the future, we'll need
|
// with the current window. If this assumption fails in the future, we'll need
|
||||||
// to return a weak pointer from ShowPopup so callers can associate it with the
|
// to return a weak pointer from ShowPopup so callers can associate it with the
|
||||||
// current window (or other context) and check if the popup they care about is
|
// current window (or other context) and check if the popup they care about is
|
||||||
// showing.
|
// showing.
|
||||||
WebsiteSettingsPopupView::PopupType g_shown_popup_type =
|
PageInfoPopupView::PopupType g_shown_popup_type = PageInfoPopupView::POPUP_NONE;
|
||||||
WebsiteSettingsPopupView::POPUP_NONE;
|
|
||||||
|
|
||||||
// General constants -----------------------------------------------------------
|
// General constants -----------------------------------------------------------
|
||||||
|
|
||||||
@@ -108,7 +107,7 @@ const int STYLED_LABEL_RESET_CERTIFICATE_DECISIONS = 1339;
|
|||||||
const int LINK_COOKIE_DIALOG = 1340;
|
const int LINK_COOKIE_DIALOG = 1340;
|
||||||
const int LINK_SITE_SETTINGS = 1341;
|
const int LINK_SITE_SETTINGS = 1341;
|
||||||
|
|
||||||
// The default, ui::kTitleFontSizeDelta, is too large for the website settings
|
// The default, ui::kTitleFontSizeDelta, is too large for the page info
|
||||||
// bubble (e.g. +3). Use +1 to obtain a smaller font.
|
// bubble (e.g. +3). Use +1 to obtain a smaller font.
|
||||||
constexpr int kSummaryFontSizeDelta = 1;
|
constexpr int kSummaryFontSizeDelta = 1;
|
||||||
|
|
||||||
@@ -125,7 +124,7 @@ void AddColumnWithSideMargin(views::GridLayout* layout, int margin, int id) {
|
|||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
// |PopupHeaderView| is the UI element (view) that represents the header of the
|
// |PopupHeaderView| is the UI element (view) that represents the header of the
|
||||||
// |WebsiteSettingsPopupView|. The header shows the status of the site's
|
// |PageInfoPopupView|. The header shows the status of the site's
|
||||||
// identity check and the name of the site's identity.
|
// identity check and the name of the site's identity.
|
||||||
class PopupHeaderView : public views::View {
|
class PopupHeaderView : public views::View {
|
||||||
public:
|
public:
|
||||||
@@ -160,8 +159,8 @@ class PopupHeaderView : public views::View {
|
|||||||
DISALLOW_COPY_AND_ASSIGN(PopupHeaderView);
|
DISALLOW_COPY_AND_ASSIGN(PopupHeaderView);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Website Settings are not supported for internal Chrome pages and extension
|
// The regular PageInfoPopupView is not supported for internal Chrome pages and
|
||||||
// pages. Instead of the |WebsiteSettingsPopupView|, the
|
// extension pages. Instead of the |PageInfoPopupView|, the
|
||||||
// |InternalPageInfoPopupView| is displayed.
|
// |InternalPageInfoPopupView| is displayed.
|
||||||
class InternalPageInfoPopupView : public views::BubbleDialogDelegateView {
|
class InternalPageInfoPopupView : public views::BubbleDialogDelegateView {
|
||||||
public:
|
public:
|
||||||
@@ -177,7 +176,7 @@ class InternalPageInfoPopupView : public views::BubbleDialogDelegateView {
|
|||||||
int GetDialogButtons() const override;
|
int GetDialogButtons() const override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class WebsiteSettingsPopupView;
|
friend class PageInfoPopupView;
|
||||||
|
|
||||||
// Used around icon and inside bubble border.
|
// Used around icon and inside bubble border.
|
||||||
static constexpr int kSpacing = 12;
|
static constexpr int kSpacing = 12;
|
||||||
@@ -286,7 +285,7 @@ InternalPageInfoPopupView::InternalPageInfoPopupView(
|
|||||||
gfx::NativeView parent_window,
|
gfx::NativeView parent_window,
|
||||||
const GURL& url)
|
const GURL& url)
|
||||||
: BubbleDialogDelegateView(anchor_view, views::BubbleBorder::TOP_LEFT) {
|
: BubbleDialogDelegateView(anchor_view, views::BubbleBorder::TOP_LEFT) {
|
||||||
g_shown_popup_type = WebsiteSettingsPopupView::POPUP_INTERNAL_PAGE;
|
g_shown_popup_type = PageInfoPopupView::POPUP_INTERNAL_PAGE;
|
||||||
set_parent_window(parent_window);
|
set_parent_window(parent_window);
|
||||||
|
|
||||||
int text = IDS_PAGE_INFO_INTERNAL_PAGE;
|
int text = IDS_PAGE_INFO_INTERNAL_PAGE;
|
||||||
@@ -329,7 +328,7 @@ InternalPageInfoPopupView::InternalPageInfoPopupView(
|
|||||||
InternalPageInfoPopupView::~InternalPageInfoPopupView() {}
|
InternalPageInfoPopupView::~InternalPageInfoPopupView() {}
|
||||||
|
|
||||||
void InternalPageInfoPopupView::OnWidgetDestroying(views::Widget* widget) {
|
void InternalPageInfoPopupView::OnWidgetDestroying(views::Widget* widget) {
|
||||||
g_shown_popup_type = WebsiteSettingsPopupView::POPUP_NONE;
|
g_shown_popup_type = PageInfoPopupView::POPUP_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int InternalPageInfoPopupView::GetDialogButtons() const {
|
int InternalPageInfoPopupView::GetDialogButtons() const {
|
||||||
@@ -337,13 +336,13 @@ int InternalPageInfoPopupView::GetDialogButtons() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
// WebsiteSettingsPopupView
|
// PageInfoPopupView
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
WebsiteSettingsPopupView::~WebsiteSettingsPopupView() {}
|
PageInfoPopupView::~PageInfoPopupView() {}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
void WebsiteSettingsPopupView::ShowPopup(
|
void PageInfoPopupView::ShowPopup(
|
||||||
views::View* anchor_view,
|
views::View* anchor_view,
|
||||||
const gfx::Rect& anchor_rect,
|
const gfx::Rect& anchor_rect,
|
||||||
Profile* profile,
|
Profile* profile,
|
||||||
@@ -364,7 +363,7 @@ void WebsiteSettingsPopupView::ShowPopup(
|
|||||||
popup->GetWidget()->Show();
|
popup->GetWidget()->Show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
WebsiteSettingsPopupView* popup = new WebsiteSettingsPopupView(
|
PageInfoPopupView* popup = new PageInfoPopupView(
|
||||||
anchor_view, parent_window, profile, web_contents, url, security_info);
|
anchor_view, parent_window, profile, web_contents, url, security_info);
|
||||||
if (!anchor_view)
|
if (!anchor_view)
|
||||||
popup->SetAnchorRect(anchor_rect);
|
popup->SetAnchorRect(anchor_rect);
|
||||||
@@ -372,12 +371,11 @@ void WebsiteSettingsPopupView::ShowPopup(
|
|||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
WebsiteSettingsPopupView::PopupType
|
PageInfoPopupView::PopupType PageInfoPopupView::GetShownPopupType() {
|
||||||
WebsiteSettingsPopupView::GetShownPopupType() {
|
|
||||||
return g_shown_popup_type;
|
return g_shown_popup_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
WebsiteSettingsPopupView::WebsiteSettingsPopupView(
|
PageInfoPopupView::PageInfoPopupView(
|
||||||
views::View* anchor_view,
|
views::View* anchor_view,
|
||||||
gfx::NativeView parent_window,
|
gfx::NativeView parent_window,
|
||||||
Profile* profile,
|
Profile* profile,
|
||||||
@@ -394,7 +392,7 @@ WebsiteSettingsPopupView::WebsiteSettingsPopupView(
|
|||||||
cookie_dialog_link_(nullptr),
|
cookie_dialog_link_(nullptr),
|
||||||
permissions_view_(nullptr),
|
permissions_view_(nullptr),
|
||||||
weak_factory_(this) {
|
weak_factory_(this) {
|
||||||
g_shown_popup_type = POPUP_WEBSITE_SETTINGS;
|
g_shown_popup_type = POPUP_PAGE_INFO;
|
||||||
set_parent_window(parent_window);
|
set_parent_window(parent_window);
|
||||||
|
|
||||||
// Compensate for built-in vertical padding in the anchor view's image.
|
// Compensate for built-in vertical padding in the anchor view's image.
|
||||||
@@ -445,23 +443,23 @@ WebsiteSettingsPopupView::WebsiteSettingsPopupView(
|
|||||||
}
|
}
|
||||||
views::BubbleDialogDelegateView::CreateBubble(this);
|
views::BubbleDialogDelegateView::CreateBubble(this);
|
||||||
|
|
||||||
presenter_.reset(new WebsiteSettings(
|
presenter_.reset(new PageInfo(
|
||||||
this, profile, TabSpecificContentSettings::FromWebContents(web_contents),
|
this, profile, TabSpecificContentSettings::FromWebContents(web_contents),
|
||||||
web_contents, url, security_info));
|
web_contents, url, security_info));
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettingsPopupView::RenderFrameDeleted(
|
void PageInfoPopupView::RenderFrameDeleted(
|
||||||
content::RenderFrameHost* render_frame_host) {
|
content::RenderFrameHost* render_frame_host) {
|
||||||
if (render_frame_host == web_contents()->GetMainFrame())
|
if (render_frame_host == web_contents()->GetMainFrame())
|
||||||
GetWidget()->Close();
|
GetWidget()->Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettingsPopupView::WebContentsDestroyed() {
|
void PageInfoPopupView::WebContentsDestroyed() {
|
||||||
weak_factory_.InvalidateWeakPtrs();
|
weak_factory_.InvalidateWeakPtrs();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettingsPopupView::OnPermissionChanged(
|
void PageInfoPopupView::OnPermissionChanged(
|
||||||
const WebsiteSettingsUI::PermissionInfo& permission) {
|
const PageInfoUI::PermissionInfo& permission) {
|
||||||
presenter_->OnSitePermissionChanged(permission.type, permission.setting);
|
presenter_->OnSitePermissionChanged(permission.type, permission.setting);
|
||||||
// The menu buttons for the permissions might have longer strings now, so we
|
// The menu buttons for the permissions might have longer strings now, so we
|
||||||
// need to layout and size the whole bubble.
|
// need to layout and size the whole bubble.
|
||||||
@@ -469,51 +467,50 @@ void WebsiteSettingsPopupView::OnPermissionChanged(
|
|||||||
SizeToContents();
|
SizeToContents();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettingsPopupView::OnChosenObjectDeleted(
|
void PageInfoPopupView::OnChosenObjectDeleted(
|
||||||
const WebsiteSettingsUI::ChosenObjectInfo& info) {
|
const PageInfoUI::ChosenObjectInfo& info) {
|
||||||
presenter_->OnSiteChosenObjectDeleted(info.ui_info, *info.object);
|
presenter_->OnSiteChosenObjectDeleted(info.ui_info, *info.object);
|
||||||
}
|
}
|
||||||
|
|
||||||
base::string16 WebsiteSettingsPopupView::GetWindowTitle() const {
|
base::string16 PageInfoPopupView::GetWindowTitle() const {
|
||||||
return summary_text_;
|
return summary_text_;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WebsiteSettingsPopupView::ShouldShowCloseButton() const {
|
bool PageInfoPopupView::ShouldShowCloseButton() const {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettingsPopupView::OnWidgetDestroying(views::Widget* widget) {
|
void PageInfoPopupView::OnWidgetDestroying(views::Widget* widget) {
|
||||||
g_shown_popup_type = POPUP_NONE;
|
g_shown_popup_type = POPUP_NONE;
|
||||||
presenter_->OnUIClosing();
|
presenter_->OnUIClosing();
|
||||||
}
|
}
|
||||||
|
|
||||||
int WebsiteSettingsPopupView::GetDialogButtons() const {
|
int PageInfoPopupView::GetDialogButtons() const {
|
||||||
return ui::DIALOG_BUTTON_NONE;
|
return ui::DIALOG_BUTTON_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
const gfx::FontList& WebsiteSettingsPopupView::GetTitleFontList() const {
|
const gfx::FontList& PageInfoPopupView::GetTitleFontList() const {
|
||||||
return ui::ResourceBundle::GetSharedInstance().GetFontListWithDelta(
|
return ui::ResourceBundle::GetSharedInstance().GetFontListWithDelta(
|
||||||
kSummaryFontSizeDelta);
|
kSummaryFontSizeDelta);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettingsPopupView::ButtonPressed(views::Button* button,
|
void PageInfoPopupView::ButtonPressed(views::Button* button,
|
||||||
const ui::Event& event) {
|
const ui::Event& event) {
|
||||||
DCHECK_EQ(BUTTON_CLOSE, button->id());
|
DCHECK_EQ(BUTTON_CLOSE, button->id());
|
||||||
GetWidget()->Close();
|
GetWidget()->Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettingsPopupView::LinkClicked(views::Link* source,
|
void PageInfoPopupView::LinkClicked(views::Link* source, int event_flags) {
|
||||||
int event_flags) {
|
|
||||||
// The popup closes automatically when the collected cookies dialog or the
|
// The popup closes automatically when the collected cookies dialog or the
|
||||||
// certificate viewer opens. So delay handling of the link clicked to avoid
|
// certificate viewer opens. So delay handling of the link clicked to avoid
|
||||||
// a crash in the base class which needs to complete the mouse event handling.
|
// a crash in the base class which needs to complete the mouse event handling.
|
||||||
content::BrowserThread::PostTask(
|
content::BrowserThread::PostTask(
|
||||||
content::BrowserThread::UI, FROM_HERE,
|
content::BrowserThread::UI, FROM_HERE,
|
||||||
base::Bind(&WebsiteSettingsPopupView::HandleLinkClickedAsync,
|
base::Bind(&PageInfoPopupView::HandleLinkClickedAsync,
|
||||||
weak_factory_.GetWeakPtr(), source));
|
weak_factory_.GetWeakPtr(), source));
|
||||||
}
|
}
|
||||||
|
|
||||||
gfx::Size WebsiteSettingsPopupView::GetPreferredSize() const {
|
gfx::Size PageInfoPopupView::GetPreferredSize() const {
|
||||||
if (header_ == nullptr && site_settings_view_ == nullptr)
|
if (header_ == nullptr && site_settings_view_ == nullptr)
|
||||||
return views::View::GetPreferredSize();
|
return views::View::GetPreferredSize();
|
||||||
|
|
||||||
@@ -533,8 +530,7 @@ gfx::Size WebsiteSettingsPopupView::GetPreferredSize() const {
|
|||||||
return gfx::Size(width, height);
|
return gfx::Size(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettingsPopupView::SetCookieInfo(
|
void PageInfoPopupView::SetCookieInfo(const CookieInfoList& cookie_info_list) {
|
||||||
const CookieInfoList& cookie_info_list) {
|
|
||||||
// |cookie_info_list| should only ever have 2 items: first- and third-party
|
// |cookie_info_list| should only ever have 2 items: first- and third-party
|
||||||
// cookies.
|
// cookies.
|
||||||
DCHECK_EQ(cookie_info_list.size(), 2u);
|
DCHECK_EQ(cookie_info_list.size(), 2u);
|
||||||
@@ -542,7 +538,7 @@ void WebsiteSettingsPopupView::SetCookieInfo(
|
|||||||
for (const auto& i : cookie_info_list)
|
for (const auto& i : cookie_info_list)
|
||||||
total_allowed += i.allowed;
|
total_allowed += i.allowed;
|
||||||
base::string16 label_text = l10n_util::GetPluralStringFUTF16(
|
base::string16 label_text = l10n_util::GetPluralStringFUTF16(
|
||||||
IDS_WEBSITE_SETTINGS_NUM_COOKIES, total_allowed);
|
IDS_PAGE_INFO_NUM_COOKIES, total_allowed);
|
||||||
|
|
||||||
if (!cookie_dialog_link_) {
|
if (!cookie_dialog_link_) {
|
||||||
cookie_dialog_link_ = new views::Link(label_text);
|
cookie_dialog_link_ = new views::Link(label_text);
|
||||||
@@ -570,14 +566,14 @@ void WebsiteSettingsPopupView::SetCookieInfo(
|
|||||||
layout->AddPaddingRow(0, kCookiesViewVerticalPadding);
|
layout->AddPaddingRow(0, kCookiesViewVerticalPadding);
|
||||||
|
|
||||||
layout->StartRow(1, cookies_view_column);
|
layout->StartRow(1, cookies_view_column);
|
||||||
WebsiteSettingsUI::PermissionInfo info;
|
PageInfoUI::PermissionInfo info;
|
||||||
info.type = CONTENT_SETTINGS_TYPE_COOKIES;
|
info.type = CONTENT_SETTINGS_TYPE_COOKIES;
|
||||||
info.setting = CONTENT_SETTING_ALLOW;
|
info.setting = CONTENT_SETTING_ALLOW;
|
||||||
info.is_incognito =
|
info.is_incognito =
|
||||||
Profile::FromBrowserContext(web_contents()->GetBrowserContext())
|
Profile::FromBrowserContext(web_contents()->GetBrowserContext())
|
||||||
->IsOffTheRecord();
|
->IsOffTheRecord();
|
||||||
views::ImageView* icon = new NonAccessibleImageView();
|
views::ImageView* icon = new NonAccessibleImageView();
|
||||||
const gfx::Image& image = WebsiteSettingsUI::GetPermissionIcon(info);
|
const gfx::Image& image = PageInfoUI::GetPermissionIcon(info);
|
||||||
icon->SetImage(image.ToImageSkia());
|
icon->SetImage(image.ToImageSkia());
|
||||||
layout->AddView(
|
layout->AddView(
|
||||||
icon, 1, 2, views::GridLayout::FILL,
|
icon, 1, 2, views::GridLayout::FILL,
|
||||||
@@ -586,7 +582,7 @@ void WebsiteSettingsPopupView::SetCookieInfo(
|
|||||||
views::GridLayout::LEADING);
|
views::GridLayout::LEADING);
|
||||||
|
|
||||||
views::Label* cookies_label = new views::Label(
|
views::Label* cookies_label = new views::Label(
|
||||||
l10n_util::GetStringUTF16(IDS_WEBSITE_SETTINGS_TITLE_SITE_DATA),
|
l10n_util::GetStringUTF16(IDS_PAGE_INFO_TITLE_SITE_DATA),
|
||||||
CONTEXT_BODY_TEXT_LARGE);
|
CONTEXT_BODY_TEXT_LARGE);
|
||||||
layout->AddView(cookies_label);
|
layout->AddView(cookies_label);
|
||||||
layout->StartRow(1, cookies_view_column);
|
layout->StartRow(1, cookies_view_column);
|
||||||
@@ -601,13 +597,13 @@ void WebsiteSettingsPopupView::SetCookieInfo(
|
|||||||
SizeToContents();
|
SizeToContents();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettingsPopupView::SetPermissionInfo(
|
void PageInfoPopupView::SetPermissionInfo(
|
||||||
const PermissionInfoList& permission_info_list,
|
const PermissionInfoList& permission_info_list,
|
||||||
ChosenObjectInfoList chosen_object_info_list) {
|
ChosenObjectInfoList chosen_object_info_list) {
|
||||||
// When a permission is changed, WebsiteSettings::OnSitePermissionChanged()
|
// When a permission is changed, PageInfo::OnSitePermissionChanged()
|
||||||
// calls this method with updated permissions. However, PermissionSelectorRow
|
// calls this method with updated permissions. However, PermissionSelectorRow
|
||||||
// will have already updated its state, so it's already reflected in the UI.
|
// will have already updated its state, so it's already reflected in the UI.
|
||||||
// In addition, if a permission is set to the default setting, WebsiteSettings
|
// In addition, if a permission is set to the default setting, PageInfo
|
||||||
// removes it from |permission_info_list|, but the button should remain.
|
// removes it from |permission_info_list|, but the button should remain.
|
||||||
if (permissions_view_)
|
if (permissions_view_)
|
||||||
return;
|
return;
|
||||||
@@ -674,9 +670,8 @@ void WebsiteSettingsPopupView::SetPermissionInfo(
|
|||||||
SizeToContents();
|
SizeToContents();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettingsPopupView::SetIdentityInfo(
|
void PageInfoPopupView::SetIdentityInfo(const IdentityInfo& identity_info) {
|
||||||
const IdentityInfo& identity_info) {
|
std::unique_ptr<PageInfoUI::SecurityDescription> security_description =
|
||||||
std::unique_ptr<WebsiteSettingsUI::SecurityDescription> security_description =
|
|
||||||
identity_info.GetSecurityDescription();
|
identity_info.GetSecurityDescription();
|
||||||
|
|
||||||
summary_text_ = security_description->summary;
|
summary_text_ = security_description->summary;
|
||||||
@@ -695,7 +690,7 @@ void WebsiteSettingsPopupView::SetIdentityInfo(
|
|||||||
SizeToContents();
|
SizeToContents();
|
||||||
}
|
}
|
||||||
|
|
||||||
views::View* WebsiteSettingsPopupView::CreateSiteSettingsView(int side_margin) {
|
views::View* PageInfoPopupView::CreateSiteSettingsView(int side_margin) {
|
||||||
views::View* site_settings_view = new views::View();
|
views::View* site_settings_view = new views::View();
|
||||||
views::BoxLayout* box_layout =
|
views::BoxLayout* box_layout =
|
||||||
new views::BoxLayout(views::BoxLayout::kVertical, side_margin, 0, 0);
|
new views::BoxLayout(views::BoxLayout::kVertical, side_margin, 0, 0);
|
||||||
@@ -710,7 +705,7 @@ views::View* WebsiteSettingsPopupView::CreateSiteSettingsView(int side_margin) {
|
|||||||
return site_settings_view;
|
return site_settings_view;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettingsPopupView::HandleLinkClickedAsync(views::Link* source) {
|
void PageInfoPopupView::HandleLinkClickedAsync(views::Link* source) {
|
||||||
// Both switch cases require accessing web_contents(), so we check it here.
|
// Both switch cases require accessing web_contents(), so we check it here.
|
||||||
if (web_contents() == nullptr || web_contents()->IsBeingDestroyed())
|
if (web_contents() == nullptr || web_contents()->IsBeingDestroyed())
|
||||||
return;
|
return;
|
||||||
@@ -724,13 +719,13 @@ void WebsiteSettingsPopupView::HandleLinkClickedAsync(views::Link* source) {
|
|||||||
GURL(chrome::kChromeUIContentSettingsURL), content::Referrer(),
|
GURL(chrome::kChromeUIContentSettingsURL), content::Referrer(),
|
||||||
WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK,
|
WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK,
|
||||||
false));
|
false));
|
||||||
presenter_->RecordWebsiteSettingsAction(
|
presenter_->RecordPageInfoAction(
|
||||||
WebsiteSettings::WEBSITE_SETTINGS_SITE_SETTINGS_OPENED);
|
PageInfo::PAGE_INFO_SITE_SETTINGS_OPENED);
|
||||||
break;
|
break;
|
||||||
case LINK_COOKIE_DIALOG:
|
case LINK_COOKIE_DIALOG:
|
||||||
// Count how often the Collected Cookies dialog is opened.
|
// Count how often the Collected Cookies dialog is opened.
|
||||||
presenter_->RecordWebsiteSettingsAction(
|
presenter_->RecordPageInfoAction(
|
||||||
WebsiteSettings::WEBSITE_SETTINGS_COOKIES_DIALOG_OPENED);
|
PageInfo::PAGE_INFO_COOKIES_DIALOG_OPENED);
|
||||||
new CollectedCookiesViews(web_contents());
|
new CollectedCookiesViews(web_contents());
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@@ -738,17 +733,17 @@ void WebsiteSettingsPopupView::HandleLinkClickedAsync(views::Link* source) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WebsiteSettingsPopupView::StyledLabelLinkClicked(views::StyledLabel* label,
|
void PageInfoPopupView::StyledLabelLinkClicked(views::StyledLabel* label,
|
||||||
const gfx::Range& range,
|
const gfx::Range& range,
|
||||||
int event_flags) {
|
int event_flags) {
|
||||||
switch (label->id()) {
|
switch (label->id()) {
|
||||||
case STYLED_LABEL_SECURITY_DETAILS:
|
case STYLED_LABEL_SECURITY_DETAILS:
|
||||||
web_contents()->OpenURL(content::OpenURLParams(
|
web_contents()->OpenURL(content::OpenURLParams(
|
||||||
GURL(chrome::kPageInfoHelpCenterURL), content::Referrer(),
|
GURL(chrome::kPageInfoHelpCenterURL), content::Referrer(),
|
||||||
WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK,
|
WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK,
|
||||||
false));
|
false));
|
||||||
presenter_->RecordWebsiteSettingsAction(
|
presenter_->RecordPageInfoAction(
|
||||||
WebsiteSettings::WEBSITE_SETTINGS_CONNECTION_HELP_OPENED);
|
PageInfo::PAGE_INFO_CONNECTION_HELP_OPENED);
|
||||||
break;
|
break;
|
||||||
case STYLED_LABEL_RESET_CERTIFICATE_DECISIONS:
|
case STYLED_LABEL_RESET_CERTIFICATE_DECISIONS:
|
||||||
presenter_->OnRevokeSSLErrorBypassButtonPressed();
|
presenter_->OnRevokeSSLErrorBypassButtonPressed();
|
@@ -2,15 +2,15 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#ifndef CHROME_BROWSER_UI_VIEWS_PAGE_INFO_WEBSITE_SETTINGS_POPUP_VIEW_H_
|
#ifndef CHROME_BROWSER_UI_VIEWS_PAGE_INFO_PAGE_INFO_POPUP_VIEW_H_
|
||||||
#define CHROME_BROWSER_UI_VIEWS_PAGE_INFO_WEBSITE_SETTINGS_POPUP_VIEW_H_
|
#define CHROME_BROWSER_UI_VIEWS_PAGE_INFO_PAGE_INFO_POPUP_VIEW_H_
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "base/compiler_specific.h"
|
#include "base/compiler_specific.h"
|
||||||
#include "base/macros.h"
|
#include "base/macros.h"
|
||||||
#include "base/memory/weak_ptr.h"
|
#include "base/memory/weak_ptr.h"
|
||||||
#include "chrome/browser/ui/page_info/website_settings_ui.h"
|
#include "chrome/browser/ui/page_info/page_info_ui.h"
|
||||||
#include "chrome/browser/ui/views/page_info/chosen_object_row_observer.h"
|
#include "chrome/browser/ui/views/page_info/chosen_object_row_observer.h"
|
||||||
#include "chrome/browser/ui/views/page_info/permission_selector_row.h"
|
#include "chrome/browser/ui/views/page_info/permission_selector_row.h"
|
||||||
#include "chrome/browser/ui/views/page_info/permission_selector_row_observer.h"
|
#include "chrome/browser/ui/views/page_info/permission_selector_row_observer.h"
|
||||||
@@ -38,7 +38,7 @@ struct SecurityInfo;
|
|||||||
} // namespace security_state
|
} // namespace security_state
|
||||||
|
|
||||||
namespace test {
|
namespace test {
|
||||||
class WebsiteSettingsPopupViewTestApi;
|
class PageInfoPopupViewTestApi;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace views {
|
namespace views {
|
||||||
@@ -53,23 +53,23 @@ enum : int {
|
|||||||
kPermissionIconColumnWidth = 16,
|
kPermissionIconColumnWidth = 16,
|
||||||
};
|
};
|
||||||
|
|
||||||
// The views implementation of the website settings UI.
|
// The views implementation of the page info UI.
|
||||||
class WebsiteSettingsPopupView : public content::WebContentsObserver,
|
class PageInfoPopupView : public content::WebContentsObserver,
|
||||||
public PermissionSelectorRowObserver,
|
public PermissionSelectorRowObserver,
|
||||||
public ChosenObjectRowObserver,
|
public ChosenObjectRowObserver,
|
||||||
public views::BubbleDialogDelegateView,
|
public views::BubbleDialogDelegateView,
|
||||||
public views::ButtonListener,
|
public views::ButtonListener,
|
||||||
public views::LinkListener,
|
public views::LinkListener,
|
||||||
public views::StyledLabelListener,
|
public views::StyledLabelListener,
|
||||||
public WebsiteSettingsUI {
|
public PageInfoUI {
|
||||||
public:
|
public:
|
||||||
~WebsiteSettingsPopupView() override;
|
~PageInfoPopupView() override;
|
||||||
|
|
||||||
// Type of the popup being displayed.
|
// Type of the popup being displayed.
|
||||||
enum PopupType {
|
enum PopupType {
|
||||||
POPUP_NONE,
|
POPUP_NONE,
|
||||||
// Usual page info bubble for websites.
|
// Usual page info bubble for websites.
|
||||||
POPUP_WEBSITE_SETTINGS,
|
POPUP_PAGE_INFO,
|
||||||
// Custom bubble for internal pages like chrome:// and chrome-extensions://.
|
// Custom bubble for internal pages like chrome:// and chrome-extensions://.
|
||||||
POPUP_INTERNAL_PAGE
|
POPUP_INTERNAL_PAGE
|
||||||
};
|
};
|
||||||
@@ -86,14 +86,14 @@ class WebsiteSettingsPopupView : public content::WebContentsObserver,
|
|||||||
static PopupType GetShownPopupType();
|
static PopupType GetShownPopupType();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class test::WebsiteSettingsPopupViewTestApi;
|
friend class test::PageInfoPopupViewTestApi;
|
||||||
|
|
||||||
WebsiteSettingsPopupView(views::View* anchor_view,
|
PageInfoPopupView(views::View* anchor_view,
|
||||||
gfx::NativeView parent_window,
|
gfx::NativeView parent_window,
|
||||||
Profile* profile,
|
Profile* profile,
|
||||||
content::WebContents* web_contents,
|
content::WebContents* web_contents,
|
||||||
const GURL& url,
|
const GURL& url,
|
||||||
const security_state::SecurityInfo& security_info);
|
const security_state::SecurityInfo& security_info);
|
||||||
|
|
||||||
// WebContentsObserver implementation.
|
// WebContentsObserver implementation.
|
||||||
void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override;
|
void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override;
|
||||||
@@ -101,11 +101,10 @@ class WebsiteSettingsPopupView : public content::WebContentsObserver,
|
|||||||
|
|
||||||
// PermissionSelectorRowObserver implementation.
|
// PermissionSelectorRowObserver implementation.
|
||||||
void OnPermissionChanged(
|
void OnPermissionChanged(
|
||||||
const WebsiteSettingsUI::PermissionInfo& permission) override;
|
const PageInfoUI::PermissionInfo& permission) override;
|
||||||
|
|
||||||
// ChosenObjectRowObserver implementation.
|
// ChosenObjectRowObserver implementation.
|
||||||
void OnChosenObjectDeleted(
|
void OnChosenObjectDeleted(const PageInfoUI::ChosenObjectInfo& info) override;
|
||||||
const WebsiteSettingsUI::ChosenObjectInfo& info) override;
|
|
||||||
|
|
||||||
// views::BubbleDialogDelegateView implementation.
|
// views::BubbleDialogDelegateView implementation.
|
||||||
base::string16 GetWindowTitle() const override;
|
base::string16 GetWindowTitle() const override;
|
||||||
@@ -128,7 +127,7 @@ class WebsiteSettingsPopupView : public content::WebContentsObserver,
|
|||||||
// views::View implementation.
|
// views::View implementation.
|
||||||
gfx::Size GetPreferredSize() const override;
|
gfx::Size GetPreferredSize() const override;
|
||||||
|
|
||||||
// WebsiteSettingsUI implementations.
|
// PageInfoUI implementations.
|
||||||
void SetCookieInfo(const CookieInfoList& cookie_info_list) override;
|
void SetCookieInfo(const CookieInfoList& cookie_info_list) override;
|
||||||
void SetPermissionInfo(const PermissionInfoList& permission_info_list,
|
void SetPermissionInfo(const PermissionInfoList& permission_info_list,
|
||||||
ChosenObjectInfoList chosen_object_info_list) override;
|
ChosenObjectInfoList chosen_object_info_list) override;
|
||||||
@@ -146,8 +145,8 @@ class WebsiteSettingsPopupView : public content::WebContentsObserver,
|
|||||||
// Whether DevTools is disabled for the relevant profile.
|
// Whether DevTools is disabled for the relevant profile.
|
||||||
bool is_devtools_disabled_;
|
bool is_devtools_disabled_;
|
||||||
|
|
||||||
// The presenter that controls the Website Settings UI.
|
// The presenter that controls the Page Info UI.
|
||||||
std::unique_ptr<WebsiteSettings> presenter_;
|
std::unique_ptr<PageInfo> presenter_;
|
||||||
|
|
||||||
Profile* profile_;
|
Profile* profile_;
|
||||||
|
|
||||||
@@ -178,9 +177,9 @@ class WebsiteSettingsPopupView : public content::WebContentsObserver,
|
|||||||
// |Permission| changes.
|
// |Permission| changes.
|
||||||
std::vector<std::unique_ptr<PermissionSelectorRow>> selector_rows_;
|
std::vector<std::unique_ptr<PermissionSelectorRow>> selector_rows_;
|
||||||
|
|
||||||
base::WeakPtrFactory<WebsiteSettingsPopupView> weak_factory_;
|
base::WeakPtrFactory<PageInfoPopupView> weak_factory_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsPopupView);
|
DISALLOW_COPY_AND_ASSIGN(PageInfoPopupView);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CHROME_BROWSER_UI_VIEWS_PAGE_INFO_WEBSITE_SETTINGS_POPUP_VIEW_H_
|
#endif // CHROME_BROWSER_UI_VIEWS_PAGE_INFO_PAGE_INFO_POPUP_VIEW_H_
|
@@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#include "chrome/browser/ui/views/page_info/website_settings_popup_view.h"
|
#include "chrome/browser/ui/views/page_info/page_info_popup_view.h"
|
||||||
|
|
||||||
#include "chrome/browser/ui/browser_commands.h"
|
#include "chrome/browser/ui/browser_commands.h"
|
||||||
#include "chrome/browser/ui/views/frame/browser_view.h"
|
#include "chrome/browser/ui/views/frame/browser_view.h"
|
||||||
@@ -33,15 +33,15 @@ void ClickAndWait(Browser* browser) {
|
|||||||
|
|
||||||
IN_PROC_BROWSER_TEST_F(WebSiteSettingsPopupViewBrowserTest, ShowPopup) {
|
IN_PROC_BROWSER_TEST_F(WebSiteSettingsPopupViewBrowserTest, ShowPopup) {
|
||||||
ClickAndWait(browser());
|
ClickAndWait(browser());
|
||||||
EXPECT_EQ(WebsiteSettingsPopupView::POPUP_WEBSITE_SETTINGS,
|
EXPECT_EQ(PageInfoPopupView::POPUP_PAGE_INFO,
|
||||||
WebsiteSettingsPopupView::GetShownPopupType());
|
PageInfoPopupView::GetShownPopupType());
|
||||||
}
|
}
|
||||||
|
|
||||||
IN_PROC_BROWSER_TEST_F(WebSiteSettingsPopupViewBrowserTest, ChromeURL) {
|
IN_PROC_BROWSER_TEST_F(WebSiteSettingsPopupViewBrowserTest, ChromeURL) {
|
||||||
ui_test_utils::NavigateToURL(browser(), GURL("chrome://settings"));
|
ui_test_utils::NavigateToURL(browser(), GURL("chrome://settings"));
|
||||||
ClickAndWait(browser());
|
ClickAndWait(browser());
|
||||||
EXPECT_EQ(WebsiteSettingsPopupView::POPUP_INTERNAL_PAGE,
|
EXPECT_EQ(PageInfoPopupView::POPUP_INTERNAL_PAGE,
|
||||||
WebsiteSettingsPopupView::GetShownPopupType());
|
PageInfoPopupView::GetShownPopupType());
|
||||||
}
|
}
|
||||||
|
|
||||||
IN_PROC_BROWSER_TEST_F(WebSiteSettingsPopupViewBrowserTest,
|
IN_PROC_BROWSER_TEST_F(WebSiteSettingsPopupViewBrowserTest,
|
||||||
@@ -49,24 +49,24 @@ IN_PROC_BROWSER_TEST_F(WebSiteSettingsPopupViewBrowserTest,
|
|||||||
ui_test_utils::NavigateToURL(
|
ui_test_utils::NavigateToURL(
|
||||||
browser(), GURL("chrome-extension://extension-id/options.html"));
|
browser(), GURL("chrome-extension://extension-id/options.html"));
|
||||||
ClickAndWait(browser());
|
ClickAndWait(browser());
|
||||||
EXPECT_EQ(WebsiteSettingsPopupView::POPUP_INTERNAL_PAGE,
|
EXPECT_EQ(PageInfoPopupView::POPUP_INTERNAL_PAGE,
|
||||||
WebsiteSettingsPopupView::GetShownPopupType());
|
PageInfoPopupView::GetShownPopupType());
|
||||||
}
|
}
|
||||||
|
|
||||||
IN_PROC_BROWSER_TEST_F(WebSiteSettingsPopupViewBrowserTest, ChromeDevtoolsURL) {
|
IN_PROC_BROWSER_TEST_F(WebSiteSettingsPopupViewBrowserTest, ChromeDevtoolsURL) {
|
||||||
ui_test_utils::NavigateToURL(
|
ui_test_utils::NavigateToURL(
|
||||||
browser(), GURL("chrome-devtools://devtools/bundled/inspector.html"));
|
browser(), GURL("chrome-devtools://devtools/bundled/inspector.html"));
|
||||||
ClickAndWait(browser());
|
ClickAndWait(browser());
|
||||||
EXPECT_EQ(WebsiteSettingsPopupView::POPUP_INTERNAL_PAGE,
|
EXPECT_EQ(PageInfoPopupView::POPUP_INTERNAL_PAGE,
|
||||||
WebsiteSettingsPopupView::GetShownPopupType());
|
PageInfoPopupView::GetShownPopupType());
|
||||||
}
|
}
|
||||||
|
|
||||||
IN_PROC_BROWSER_TEST_F(WebSiteSettingsPopupViewBrowserTest, ViewSourceURL) {
|
IN_PROC_BROWSER_TEST_F(WebSiteSettingsPopupViewBrowserTest, ViewSourceURL) {
|
||||||
ui_test_utils::NavigateToURL(browser(), GURL("about:blank"));
|
ui_test_utils::NavigateToURL(browser(), GURL("about:blank"));
|
||||||
chrome::ViewSelectedSource(browser());
|
chrome::ViewSelectedSource(browser());
|
||||||
ClickAndWait(browser());
|
ClickAndWait(browser());
|
||||||
EXPECT_EQ(WebsiteSettingsPopupView::POPUP_INTERNAL_PAGE,
|
EXPECT_EQ(PageInfoPopupView::POPUP_INTERNAL_PAGE,
|
||||||
WebsiteSettingsPopupView::GetShownPopupType());
|
PageInfoPopupView::GetShownPopupType());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
@@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// found in the LICENSE file.
|
||||||
|
|
||||||
#include "chrome/browser/ui/views/page_info/website_settings_popup_view.h"
|
#include "chrome/browser/ui/views/page_info/page_info_popup_view.h"
|
||||||
|
|
||||||
#include "base/macros.h"
|
#include "base/macros.h"
|
||||||
#include "base/strings/utf_string_conversions.h"
|
#include "base/strings/utf_string_conversions.h"
|
||||||
@@ -29,11 +29,11 @@ const char* kUrl = "http://www.example.com/index.html";
|
|||||||
|
|
||||||
namespace test {
|
namespace test {
|
||||||
|
|
||||||
class WebsiteSettingsPopupViewTestApi {
|
class PageInfoPopupViewTestApi {
|
||||||
public:
|
public:
|
||||||
WebsiteSettingsPopupViewTestApi(gfx::NativeView parent,
|
PageInfoPopupViewTestApi(gfx::NativeView parent,
|
||||||
Profile* profile,
|
Profile* profile,
|
||||||
content::WebContents* web_contents)
|
content::WebContents* web_contents)
|
||||||
: view_(nullptr),
|
: view_(nullptr),
|
||||||
parent_(parent),
|
parent_(parent),
|
||||||
profile_(profile),
|
profile_(profile),
|
||||||
@@ -47,12 +47,11 @@ class WebsiteSettingsPopupViewTestApi {
|
|||||||
|
|
||||||
security_state::SecurityInfo security_info;
|
security_state::SecurityInfo security_info;
|
||||||
views::View* anchor_view = nullptr;
|
views::View* anchor_view = nullptr;
|
||||||
view_ =
|
view_ = new PageInfoPopupView(anchor_view, parent_, profile_, web_contents_,
|
||||||
new WebsiteSettingsPopupView(anchor_view, parent_, profile_,
|
GURL(kUrl), security_info);
|
||||||
web_contents_, GURL(kUrl), security_info);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
WebsiteSettingsPopupView* view() { return view_; }
|
PageInfoPopupView* view() { return view_; }
|
||||||
views::View* permissions_view() { return view_->permissions_view_; }
|
views::View* permissions_view() { return view_->permissions_view_; }
|
||||||
|
|
||||||
PermissionSelectorRow* GetPermissionSelectorAt(int index) {
|
PermissionSelectorRow* GetPermissionSelectorAt(int index) {
|
||||||
@@ -84,20 +83,20 @@ class WebsiteSettingsPopupViewTestApi {
|
|||||||
|
|
||||||
// Simulates recreating the dialog with a new PermissionInfoList.
|
// Simulates recreating the dialog with a new PermissionInfoList.
|
||||||
void SetPermissionInfo(const PermissionInfoList& list) {
|
void SetPermissionInfo(const PermissionInfoList& list) {
|
||||||
for (const WebsiteSettingsPopupView::PermissionInfo& info : list)
|
for (const PageInfoPopupView::PermissionInfo& info : list)
|
||||||
view_->presenter_->OnSitePermissionChanged(info.type, info.setting);
|
view_->presenter_->OnSitePermissionChanged(info.type, info.setting);
|
||||||
CreateView();
|
CreateView();
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
WebsiteSettingsPopupView* view_; // Weak. Owned by its Widget.
|
PageInfoPopupView* view_; // Weak. Owned by its Widget.
|
||||||
|
|
||||||
// For recreating the view.
|
// For recreating the view.
|
||||||
gfx::NativeView parent_;
|
gfx::NativeView parent_;
|
||||||
Profile* profile_;
|
Profile* profile_;
|
||||||
content::WebContents* web_contents_;
|
content::WebContents* web_contents_;
|
||||||
|
|
||||||
DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsPopupViewTestApi);
|
DISALLOW_COPY_AND_ASSIGN(PageInfoPopupViewTestApi);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace test
|
} // namespace test
|
||||||
@@ -125,9 +124,9 @@ class ScopedWebContentsTestHelper {
|
|||||||
DISALLOW_COPY_AND_ASSIGN(ScopedWebContentsTestHelper);
|
DISALLOW_COPY_AND_ASSIGN(ScopedWebContentsTestHelper);
|
||||||
};
|
};
|
||||||
|
|
||||||
class WebsiteSettingsPopupViewTest : public testing::Test {
|
class PageInfoPopupViewTest : public testing::Test {
|
||||||
public:
|
public:
|
||||||
WebsiteSettingsPopupViewTest() {}
|
PageInfoPopupViewTest() {}
|
||||||
|
|
||||||
// testing::Test:
|
// testing::Test:
|
||||||
void SetUp() override {
|
void SetUp() override {
|
||||||
@@ -138,7 +137,7 @@ class WebsiteSettingsPopupViewTest : public testing::Test {
|
|||||||
|
|
||||||
content::WebContents* web_contents = web_contents_helper_.web_contents();
|
content::WebContents* web_contents = web_contents_helper_.web_contents();
|
||||||
TabSpecificContentSettings::CreateForWebContents(web_contents);
|
TabSpecificContentSettings::CreateForWebContents(web_contents);
|
||||||
api_.reset(new test::WebsiteSettingsPopupViewTestApi(
|
api_.reset(new test::PageInfoPopupViewTestApi(
|
||||||
parent_window_->GetNativeView(), web_contents_helper_.profile(),
|
parent_window_->GetNativeView(), web_contents_helper_.profile(),
|
||||||
web_contents));
|
web_contents));
|
||||||
}
|
}
|
||||||
@@ -151,10 +150,10 @@ class WebsiteSettingsPopupViewTest : public testing::Test {
|
|||||||
views::ScopedViewsTestHelper views_helper_;
|
views::ScopedViewsTestHelper views_helper_;
|
||||||
|
|
||||||
views::Widget* parent_window_ = nullptr; // Weak. Owned by the NativeWidget.
|
views::Widget* parent_window_ = nullptr; // Weak. Owned by the NativeWidget.
|
||||||
std::unique_ptr<test::WebsiteSettingsPopupViewTestApi> api_;
|
std::unique_ptr<test::PageInfoPopupViewTestApi> api_;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DISALLOW_COPY_AND_ASSIGN(WebsiteSettingsPopupViewTest);
|
DISALLOW_COPY_AND_ASSIGN(PageInfoPopupViewTest);
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
@@ -177,8 +176,8 @@ class WebsiteSettingsPopupViewTest : public testing::Test {
|
|||||||
constexpr int kViewsPerPermissionRow = 3;
|
constexpr int kViewsPerPermissionRow = 3;
|
||||||
|
|
||||||
// Test UI construction and reconstruction via
|
// Test UI construction and reconstruction via
|
||||||
// WebsiteSettingsPopupView::SetPermissionInfo().
|
// PageInfoPopupView::SetPermissionInfo().
|
||||||
TEST_F(WebsiteSettingsPopupViewTest, MAYBE_SetPermissionInfo) {
|
TEST_F(PageInfoPopupViewTest, MAYBE_SetPermissionInfo) {
|
||||||
PermissionInfoList list(1);
|
PermissionInfoList list(1);
|
||||||
list.back().type = CONTENT_SETTINGS_TYPE_GEOLOCATION;
|
list.back().type = CONTENT_SETTINGS_TYPE_GEOLOCATION;
|
||||||
list.back().source = content_settings::SETTING_SOURCE_USER;
|
list.back().source = content_settings::SETTING_SOURCE_USER;
|
||||||
@@ -207,7 +206,7 @@ TEST_F(WebsiteSettingsPopupViewTest, MAYBE_SetPermissionInfo) {
|
|||||||
EXPECT_EQ(base::ASCIIToUTF16("Block"), api_->GetPermissionButtonTextAt(0));
|
EXPECT_EQ(base::ASCIIToUTF16("Block"), api_->GetPermissionButtonTextAt(0));
|
||||||
|
|
||||||
// Simulate a user selection via the UI. Note this will also cover logic in
|
// Simulate a user selection via the UI. Note this will also cover logic in
|
||||||
// WebsiteSettings to update the pref.
|
// PageInfo to update the pref.
|
||||||
list.back().setting = CONTENT_SETTING_ALLOW;
|
list.back().setting = CONTENT_SETTING_ALLOW;
|
||||||
api_->GetPermissionSelectorAt(0)->PermissionChanged(list.back());
|
api_->GetPermissionSelectorAt(0)->PermissionChanged(list.back());
|
||||||
EXPECT_EQ(kExpectedChildren, api_->permissions_view()->child_count());
|
EXPECT_EQ(kExpectedChildren, api_->permissions_view()->child_count());
|
||||||
@@ -226,7 +225,7 @@ TEST_F(WebsiteSettingsPopupViewTest, MAYBE_SetPermissionInfo) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Test UI construction and reconstruction with USB devices.
|
// Test UI construction and reconstruction with USB devices.
|
||||||
TEST_F(WebsiteSettingsPopupViewTest, SetPermissionInfoWithUsbDevice) {
|
TEST_F(PageInfoPopupViewTest, SetPermissionInfoWithUsbDevice) {
|
||||||
const int kExpectedChildren =
|
const int kExpectedChildren =
|
||||||
kViewsPerPermissionRow *
|
kViewsPerPermissionRow *
|
||||||
(ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled() ? 11 : 13);
|
(ExclusiveAccessManager::IsSimplifiedFullscreenUIEnabled() ? 11 : 13);
|
@@ -7,10 +7,10 @@
|
|||||||
#include "base/i18n/rtl.h"
|
#include "base/i18n/rtl.h"
|
||||||
#include "base/macros.h"
|
#include "base/macros.h"
|
||||||
#include "base/strings/utf_string_conversions.h"
|
#include "base/strings/utf_string_conversions.h"
|
||||||
|
#include "chrome/browser/ui/page_info/page_info_ui.h"
|
||||||
#include "chrome/browser/ui/page_info/permission_menu_model.h"
|
#include "chrome/browser/ui/page_info/permission_menu_model.h"
|
||||||
#include "chrome/browser/ui/page_info/website_settings_ui.h"
|
|
||||||
#include "chrome/browser/ui/views/page_info/non_accessible_image_view.h"
|
#include "chrome/browser/ui/views/page_info/non_accessible_image_view.h"
|
||||||
#include "chrome/browser/ui/views/page_info/website_settings_popup_view.h"
|
#include "chrome/browser/ui/views/page_info/page_info_popup_view.h"
|
||||||
#include "chrome/grit/generated_resources.h"
|
#include "chrome/grit/generated_resources.h"
|
||||||
#include "ui/accessibility/ax_node_data.h"
|
#include "ui/accessibility/ax_node_data.h"
|
||||||
#include "ui/base/material_design/material_design_controller.h"
|
#include "ui/base/material_design/material_design_controller.h"
|
||||||
@@ -235,18 +235,18 @@ void PermissionCombobox::OnPerformAction(Combobox* combobox) {
|
|||||||
PermissionSelectorRow::PermissionSelectorRow(
|
PermissionSelectorRow::PermissionSelectorRow(
|
||||||
Profile* profile,
|
Profile* profile,
|
||||||
const GURL& url,
|
const GURL& url,
|
||||||
const WebsiteSettingsUI::PermissionInfo& permission,
|
const PageInfoUI::PermissionInfo& permission,
|
||||||
views::GridLayout* layout)
|
views::GridLayout* layout)
|
||||||
: profile_(profile), icon_(NULL), menu_button_(NULL), combobox_(NULL) {
|
: profile_(profile), icon_(NULL), menu_button_(NULL), combobox_(NULL) {
|
||||||
// Create the permission icon.
|
// Create the permission icon.
|
||||||
icon_ = new NonAccessibleImageView();
|
icon_ = new NonAccessibleImageView();
|
||||||
const gfx::Image& image = WebsiteSettingsUI::GetPermissionIcon(permission);
|
const gfx::Image& image = PageInfoUI::GetPermissionIcon(permission);
|
||||||
icon_->SetImage(image.ToImageSkia());
|
icon_->SetImage(image.ToImageSkia());
|
||||||
layout->AddView(icon_, 1, 1, views::GridLayout::CENTER,
|
layout->AddView(icon_, 1, 1, views::GridLayout::CENTER,
|
||||||
views::GridLayout::CENTER);
|
views::GridLayout::CENTER);
|
||||||
// Create the label that displays the permission type.
|
// Create the label that displays the permission type.
|
||||||
label_ = new views::Label(
|
label_ =
|
||||||
WebsiteSettingsUI::PermissionTypeToUIString(permission.type));
|
new views::Label(PageInfoUI::PermissionTypeToUIString(permission.type));
|
||||||
layout->AddView(label_, 1, 1, views::GridLayout::LEADING,
|
layout->AddView(label_, 1, 1, views::GridLayout::LEADING,
|
||||||
views::GridLayout::CENTER);
|
views::GridLayout::CENTER);
|
||||||
// Create the menu model.
|
// Create the menu model.
|
||||||
@@ -290,23 +290,23 @@ PermissionSelectorRow::~PermissionSelectorRow() {
|
|||||||
|
|
||||||
void PermissionSelectorRow::InitializeMenuButtonView(
|
void PermissionSelectorRow::InitializeMenuButtonView(
|
||||||
views::GridLayout* layout,
|
views::GridLayout* layout,
|
||||||
const WebsiteSettingsUI::PermissionInfo& permission) {
|
const PageInfoUI::PermissionInfo& permission) {
|
||||||
bool button_enabled =
|
bool button_enabled =
|
||||||
permission.source == content_settings::SETTING_SOURCE_USER;
|
permission.source == content_settings::SETTING_SOURCE_USER;
|
||||||
menu_button_ = new internal::PermissionMenuButton(
|
menu_button_ = new internal::PermissionMenuButton(
|
||||||
WebsiteSettingsUI::PermissionActionToUIString(
|
PageInfoUI::PermissionActionToUIString(
|
||||||
profile_, permission.type, permission.setting,
|
profile_, permission.type, permission.setting,
|
||||||
permission.default_setting, permission.source),
|
permission.default_setting, permission.source),
|
||||||
menu_model_.get(), button_enabled);
|
menu_model_.get(), button_enabled);
|
||||||
menu_button_->SetEnabled(button_enabled);
|
menu_button_->SetEnabled(button_enabled);
|
||||||
menu_button_->SetAccessibleName(
|
menu_button_->SetAccessibleName(
|
||||||
WebsiteSettingsUI::PermissionTypeToUIString(permission.type));
|
PageInfoUI::PermissionTypeToUIString(permission.type));
|
||||||
layout->AddView(menu_button_);
|
layout->AddView(menu_button_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PermissionSelectorRow::InitializeComboboxView(
|
void PermissionSelectorRow::InitializeComboboxView(
|
||||||
views::GridLayout* layout,
|
views::GridLayout* layout,
|
||||||
const WebsiteSettingsUI::PermissionInfo& permission) {
|
const PageInfoUI::PermissionInfo& permission) {
|
||||||
bool button_enabled =
|
bool button_enabled =
|
||||||
permission.source == content_settings::SETTING_SOURCE_USER;
|
permission.source == content_settings::SETTING_SOURCE_USER;
|
||||||
combobox_model_adapter_.reset(
|
combobox_model_adapter_.reset(
|
||||||
@@ -315,23 +315,23 @@ void PermissionSelectorRow::InitializeComboboxView(
|
|||||||
button_enabled, true);
|
button_enabled, true);
|
||||||
combobox_->SetEnabled(button_enabled);
|
combobox_->SetEnabled(button_enabled);
|
||||||
combobox_->SetAccessibleName(
|
combobox_->SetAccessibleName(
|
||||||
WebsiteSettingsUI::PermissionTypeToUIString(permission.type));
|
PageInfoUI::PermissionTypeToUIString(permission.type));
|
||||||
layout->AddView(combobox_);
|
layout->AddView(combobox_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void PermissionSelectorRow::PermissionChanged(
|
void PermissionSelectorRow::PermissionChanged(
|
||||||
const WebsiteSettingsUI::PermissionInfo& permission) {
|
const PageInfoUI::PermissionInfo& permission) {
|
||||||
// Change the permission icon to reflect the selected setting.
|
// Change the permission icon to reflect the selected setting.
|
||||||
const gfx::Image& image = WebsiteSettingsUI::GetPermissionIcon(permission);
|
const gfx::Image& image = PageInfoUI::GetPermissionIcon(permission);
|
||||||
icon_->SetImage(image.ToImageSkia());
|
icon_->SetImage(image.ToImageSkia());
|
||||||
|
|
||||||
// Update the menu button text to reflect the new setting.
|
// Update the menu button text to reflect the new setting.
|
||||||
if (menu_button_) {
|
if (menu_button_) {
|
||||||
menu_button_->SetText(WebsiteSettingsUI::PermissionActionToUIString(
|
menu_button_->SetText(PageInfoUI::PermissionActionToUIString(
|
||||||
profile_, permission.type, permission.setting,
|
profile_, permission.type, permission.setting,
|
||||||
permission.default_setting, content_settings::SETTING_SOURCE_USER));
|
permission.default_setting, content_settings::SETTING_SOURCE_USER));
|
||||||
menu_button_->SizeToPreferredSize();
|
menu_button_->SizeToPreferredSize();
|
||||||
// Re-layout will be done at the |WebsiteSettingsPopupView| level, since
|
// Re-layout will be done at the |PageInfoPopupView| level, since
|
||||||
// that view may need to resize itself to accomodate the new sizes of its
|
// that view may need to resize itself to accomodate the new sizes of its
|
||||||
// contents.
|
// contents.
|
||||||
menu_button_->InvalidateLayout();
|
menu_button_->InvalidateLayout();
|
||||||
|
@@ -10,8 +10,8 @@
|
|||||||
#include "base/compiler_specific.h"
|
#include "base/compiler_specific.h"
|
||||||
#include "base/macros.h"
|
#include "base/macros.h"
|
||||||
#include "base/observer_list.h"
|
#include "base/observer_list.h"
|
||||||
|
#include "chrome/browser/ui/page_info/page_info_ui.h"
|
||||||
#include "chrome/browser/ui/page_info/permission_menu_model.h"
|
#include "chrome/browser/ui/page_info/permission_menu_model.h"
|
||||||
#include "chrome/browser/ui/page_info/website_settings_ui.h"
|
|
||||||
#include "chrome/browser/ui/views/page_info/permission_selector_row_observer.h"
|
#include "chrome/browser/ui/views/page_info/permission_selector_row_observer.h"
|
||||||
#include "components/content_settings/core/common/content_settings.h"
|
#include "components/content_settings/core/common/content_settings.h"
|
||||||
#include "components/content_settings/core/common/content_settings_types.h"
|
#include "components/content_settings/core/common/content_settings_types.h"
|
||||||
@@ -26,7 +26,7 @@ class PermissionMenuButton;
|
|||||||
}
|
}
|
||||||
|
|
||||||
namespace test {
|
namespace test {
|
||||||
class WebsiteSettingsPopupViewTestApi;
|
class PageInfoPopupViewTestApi;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace views {
|
namespace views {
|
||||||
@@ -46,23 +46,21 @@ class PermissionSelectorRow {
|
|||||||
// The |PermissionSelectorRow|'s constituent views are added to |layout|.
|
// The |PermissionSelectorRow|'s constituent views are added to |layout|.
|
||||||
PermissionSelectorRow(Profile* profile,
|
PermissionSelectorRow(Profile* profile,
|
||||||
const GURL& url,
|
const GURL& url,
|
||||||
const WebsiteSettingsUI::PermissionInfo& permission,
|
const PageInfoUI::PermissionInfo& permission,
|
||||||
views::GridLayout* layout);
|
views::GridLayout* layout);
|
||||||
virtual ~PermissionSelectorRow();
|
virtual ~PermissionSelectorRow();
|
||||||
|
|
||||||
void AddObserver(PermissionSelectorRowObserver* observer);
|
void AddObserver(PermissionSelectorRowObserver* observer);
|
||||||
|
|
||||||
void PermissionChanged(const WebsiteSettingsUI::PermissionInfo& permission);
|
void PermissionChanged(const PageInfoUI::PermissionInfo& permission);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class test::WebsiteSettingsPopupViewTestApi;
|
friend class test::PageInfoPopupViewTestApi;
|
||||||
|
|
||||||
void InitializeMenuButtonView(
|
void InitializeMenuButtonView(views::GridLayout* layout,
|
||||||
views::GridLayout* layout,
|
const PageInfoUI::PermissionInfo& permission);
|
||||||
const WebsiteSettingsUI::PermissionInfo& permission);
|
void InitializeComboboxView(views::GridLayout* layout,
|
||||||
void InitializeComboboxView(
|
const PageInfoUI::PermissionInfo& permission);
|
||||||
views::GridLayout* layout,
|
|
||||||
const WebsiteSettingsUI::PermissionInfo& permission);
|
|
||||||
|
|
||||||
// Returns the "button" for this row, which is the control used to change the
|
// Returns the "button" for this row, which is the control used to change the
|
||||||
// permission's value. This is either a |MenuButton| or a |Combobox|.
|
// permission's value. This is either a |MenuButton| or a |Combobox|.
|
||||||
|
@@ -5,13 +5,13 @@
|
|||||||
#ifndef CHROME_BROWSER_UI_VIEWS_PAGE_INFO_PERMISSION_SELECTOR_ROW_OBSERVER_H_
|
#ifndef CHROME_BROWSER_UI_VIEWS_PAGE_INFO_PERMISSION_SELECTOR_ROW_OBSERVER_H_
|
||||||
#define CHROME_BROWSER_UI_VIEWS_PAGE_INFO_PERMISSION_SELECTOR_ROW_OBSERVER_H_
|
#define CHROME_BROWSER_UI_VIEWS_PAGE_INFO_PERMISSION_SELECTOR_ROW_OBSERVER_H_
|
||||||
|
|
||||||
#include "chrome/browser/ui/page_info/website_settings_ui.h"
|
#include "chrome/browser/ui/page_info/page_info_ui.h"
|
||||||
|
|
||||||
class PermissionSelectorRowObserver {
|
class PermissionSelectorRowObserver {
|
||||||
public:
|
public:
|
||||||
// This method is called whenever the permission setting is changed.
|
// This method is called whenever the permission setting is changed.
|
||||||
virtual void OnPermissionChanged(
|
virtual void OnPermissionChanged(
|
||||||
const WebsiteSettingsUI::PermissionInfo& permission) = 0;
|
const PageInfoUI::PermissionInfo& permission) = 0;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~PermissionSelectorRowObserver() {}
|
virtual ~PermissionSelectorRowObserver() {}
|
||||||
|
@@ -80,7 +80,7 @@ class PermissionCombobox : public views::MenuButton,
|
|||||||
const ui::Event* event) override;
|
const ui::Event* event) override;
|
||||||
|
|
||||||
// Callback when a permission's setting is changed.
|
// Callback when a permission's setting is changed.
|
||||||
void PermissionChanged(const WebsiteSettingsUI::PermissionInfo& permission);
|
void PermissionChanged(const PageInfoUI::PermissionInfo& permission);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int index_;
|
int index_;
|
||||||
@@ -129,7 +129,7 @@ void PermissionCombobox::OnMenuButtonClicked(views::MenuButton* source,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void PermissionCombobox::PermissionChanged(
|
void PermissionCombobox::PermissionChanged(
|
||||||
const WebsiteSettingsUI::PermissionInfo& permission) {
|
const PageInfoUI::PermissionInfo& permission) {
|
||||||
SetText(model_->GetLabelAt(model_->GetIndexOfCommandId(permission.setting)));
|
SetText(model_->GetLabelAt(model_->GetIndexOfCommandId(permission.setting)));
|
||||||
SizeToPreferredSize();
|
SizeToPreferredSize();
|
||||||
|
|
||||||
|
@@ -421,8 +421,8 @@ ToolbarView::GetContentSettingBubbleModelDelegate() {
|
|||||||
return browser_->content_setting_bubble_model_delegate();
|
return browser_->content_setting_bubble_model_delegate();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ToolbarView::ShowWebsiteSettings(content::WebContents* web_contents) {
|
void ToolbarView::ShowPageInfo(content::WebContents* web_contents) {
|
||||||
chrome::ShowWebsiteSettings(browser_, web_contents);
|
chrome::ShowPageInfo(browser_, web_contents);
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
@@ -123,7 +123,7 @@ class ToolbarView : public views::AccessiblePaneView,
|
|||||||
const ToolbarModel* GetToolbarModel() const override;
|
const ToolbarModel* GetToolbarModel() const override;
|
||||||
ContentSettingBubbleModelDelegate* GetContentSettingBubbleModelDelegate()
|
ContentSettingBubbleModelDelegate* GetContentSettingBubbleModelDelegate()
|
||||||
override;
|
override;
|
||||||
void ShowWebsiteSettings(content::WebContents* web_contents) override;
|
void ShowPageInfo(content::WebContents* web_contents) override;
|
||||||
|
|
||||||
// CommandObserver:
|
// CommandObserver:
|
||||||
void EnabledStateChangedForCommand(int id, bool enabled) override;
|
void EnabledStateChangedForCommand(int id, bool enabled) override;
|
||||||
|
@@ -194,12 +194,10 @@ content::WebUIDataSource* CreateVrShellUIHTMLSource() {
|
|||||||
source->AddResourcePath("vk.css", IDR_VR_SHELL_UI_VK_CSS);
|
source->AddResourcePath("vk.css", IDR_VR_SHELL_UI_VK_CSS);
|
||||||
source->AddResourcePath("vk.js", IDR_VR_SHELL_UI_VK_JS);
|
source->AddResourcePath("vk.js", IDR_VR_SHELL_UI_VK_JS);
|
||||||
source->SetDefaultResource(IDR_VR_SHELL_UI_HTML);
|
source->SetDefaultResource(IDR_VR_SHELL_UI_HTML);
|
||||||
source->AddLocalizedString(
|
source->AddLocalizedString("insecureWebVrContentPermanent",
|
||||||
"insecureWebVrContentPermanent",
|
IDS_PAGE_INFO_INSECURE_WEBVR_CONTENT_PERMANENT);
|
||||||
IDS_WEBSITE_SETTINGS_INSECURE_WEBVR_CONTENT_PERMANENT);
|
source->AddLocalizedString("insecureWebVrContentTransient",
|
||||||
source->AddLocalizedString(
|
IDS_PAGE_INFO_INSECURE_WEBVR_CONTENT_TRANSIENT);
|
||||||
"insecureWebVrContentTransient",
|
|
||||||
IDS_WEBSITE_SETTINGS_INSECURE_WEBVR_CONTENT_TRANSIENT);
|
|
||||||
source->AddLocalizedString("back", IDS_VR_SHELL_UI_BACK_BUTTON);
|
source->AddLocalizedString("back", IDS_VR_SHELL_UI_BACK_BUTTON);
|
||||||
source->AddLocalizedString("forward", IDS_VR_SHELL_UI_FORWARD_BUTTON);
|
source->AddLocalizedString("forward", IDS_VR_SHELL_UI_FORWARD_BUTTON);
|
||||||
source->AddLocalizedString("reload", IDS_VR_SHELL_UI_RELOAD_BUTTON);
|
source->AddLocalizedString("reload", IDS_VR_SHELL_UI_RELOAD_BUTTON);
|
||||||
|
@@ -559,7 +559,7 @@ if (!is_android) {
|
|||||||
"../browser/ui/views/location_bar/location_icon_view_interactive_uitest.cc",
|
"../browser/ui/views/location_bar/location_icon_view_interactive_uitest.cc",
|
||||||
"../browser/ui/views/location_bar/star_view_browsertest.cc",
|
"../browser/ui/views/location_bar/star_view_browsertest.cc",
|
||||||
"../browser/ui/views/omnibox/omnibox_view_views_browsertest.cc",
|
"../browser/ui/views/omnibox/omnibox_view_views_browsertest.cc",
|
||||||
"../browser/ui/views/page_info/website_settings_popup_view_interactive_uitest.cc",
|
"../browser/ui/views/page_info/page_info_popup_view_interactive_uitest.cc",
|
||||||
"../browser/ui/views/passwords/manage_passwords_bubble_view_interactive_uitest.cc",
|
"../browser/ui/views/passwords/manage_passwords_bubble_view_interactive_uitest.cc",
|
||||||
"../browser/ui/views/passwords/manage_passwords_icon_view_interactive_uitest.cc",
|
"../browser/ui/views/passwords/manage_passwords_icon_view_interactive_uitest.cc",
|
||||||
"../browser/ui/views/ssl_client_certificate_selector_browsertest.cc",
|
"../browser/ui/views/ssl_client_certificate_selector_browsertest.cc",
|
||||||
@@ -3393,7 +3393,7 @@ test("unit_tests") {
|
|||||||
"../browser/ui/chrome_select_file_policy_unittest.cc",
|
"../browser/ui/chrome_select_file_policy_unittest.cc",
|
||||||
"../browser/ui/find_bar/find_backend_unittest.cc",
|
"../browser/ui/find_bar/find_backend_unittest.cc",
|
||||||
"../browser/ui/login/login_handler_unittest.cc",
|
"../browser/ui/login/login_handler_unittest.cc",
|
||||||
"../browser/ui/page_info/website_settings_unittest.cc",
|
"../browser/ui/page_info/page_info_unittest.cc",
|
||||||
"../browser/ui/passwords/manage_passwords_state_unittest.cc",
|
"../browser/ui/passwords/manage_passwords_state_unittest.cc",
|
||||||
"../browser/ui/passwords/manage_passwords_view_utils_unittest.cc",
|
"../browser/ui/passwords/manage_passwords_view_utils_unittest.cc",
|
||||||
"../browser/ui/passwords/password_manager_presenter_unittest.cc",
|
"../browser/ui/passwords/password_manager_presenter_unittest.cc",
|
||||||
@@ -4678,8 +4678,8 @@ test("unit_tests") {
|
|||||||
"../browser/ui/cocoa/omnibox/omnibox_popup_separator_view_unittest.mm",
|
"../browser/ui/cocoa/omnibox/omnibox_popup_separator_view_unittest.mm",
|
||||||
"../browser/ui/cocoa/omnibox/omnibox_popup_view_mac_unittest.mm",
|
"../browser/ui/cocoa/omnibox/omnibox_popup_view_mac_unittest.mm",
|
||||||
"../browser/ui/cocoa/omnibox/omnibox_view_mac_unittest.mm",
|
"../browser/ui/cocoa/omnibox/omnibox_view_mac_unittest.mm",
|
||||||
|
"../browser/ui/cocoa/page_info/page_info_bubble_controller_unittest.mm",
|
||||||
"../browser/ui/cocoa/page_info/permission_selector_button_unittest.mm",
|
"../browser/ui/cocoa/page_info/permission_selector_button_unittest.mm",
|
||||||
"../browser/ui/cocoa/page_info/website_settings_bubble_controller_unittest.mm",
|
|
||||||
"../browser/ui/cocoa/passwords/account_chooser_view_controller_unittest.mm",
|
"../browser/ui/cocoa/passwords/account_chooser_view_controller_unittest.mm",
|
||||||
"../browser/ui/cocoa/passwords/autosignin_prompt_view_controller_unittest.mm",
|
"../browser/ui/cocoa/passwords/autosignin_prompt_view_controller_unittest.mm",
|
||||||
"../browser/ui/cocoa/passwords/base_passwords_controller_test.h",
|
"../browser/ui/cocoa/passwords/base_passwords_controller_test.h",
|
||||||
@@ -4838,7 +4838,7 @@ test("unit_tests") {
|
|||||||
"../browser/ui/views/confirm_bubble_views_unittest.cc",
|
"../browser/ui/views/confirm_bubble_views_unittest.cc",
|
||||||
"../browser/ui/views/global_error_bubble_view_unittest.cc",
|
"../browser/ui/views/global_error_bubble_view_unittest.cc",
|
||||||
"../browser/ui/views/harmony/layout_delegate_unittest.cc",
|
"../browser/ui/views/harmony/layout_delegate_unittest.cc",
|
||||||
"../browser/ui/views/page_info/website_settings_popup_view_unittest.cc",
|
"../browser/ui/views/page_info/page_info_popup_view_unittest.cc",
|
||||||
"../browser/ui/views/payments/credit_card_editor_view_controller_unittest.cc",
|
"../browser/ui/views/payments/credit_card_editor_view_controller_unittest.cc",
|
||||||
"../browser/ui/views/payments/payment_request_item_list_unittest.cc",
|
"../browser/ui/views/payments/payment_request_item_list_unittest.cc",
|
||||||
"../browser/ui/views/payments/validating_textfield_unittest.cc",
|
"../browser/ui/views/payments/validating_textfield_unittest.cc",
|
||||||
|
@@ -115,7 +115,7 @@ class TestBrowserWindow : public BrowserWindow {
|
|||||||
bool app_modal,
|
bool app_modal,
|
||||||
const base::Callback<void(bool)>& callback) override {}
|
const base::Callback<void(bool)>& callback) override {}
|
||||||
void UserChangedTheme() override {}
|
void UserChangedTheme() override {}
|
||||||
void ShowWebsiteSettings(
|
void ShowPageInfo(
|
||||||
Profile* profile,
|
Profile* profile,
|
||||||
content::WebContents* web_contents,
|
content::WebContents* web_contents,
|
||||||
const GURL& virtual_url,
|
const GURL& virtual_url,
|
||||||
|
@@ -313,8 +313,8 @@
|
|||||||
Open startup pages
|
Open startup pages
|
||||||
</message>
|
</message>
|
||||||
|
|
||||||
<!-- Website Settings UI -->
|
<!-- Page Info UI -->
|
||||||
<message name="IDS_WEBSITE_SETTINGS_NON_SECURE_TRANSPORT" desc="Text that is displayed in the header of the Website Settings popup if the website uses non-secure transport.">
|
<message name="IDS_PAGE_INFO_NON_SECURE_TRANSPORT" desc="Text that is displayed in the header of the Website Settings popup if the website uses non-secure transport.">
|
||||||
Your connection to this site is not private.
|
Your connection to this site is not private.
|
||||||
</message>
|
</message>
|
||||||
|
|
||||||
|
@@ -119,7 +119,7 @@ class InfoBarDelegate {
|
|||||||
GOOGLE_API_KEYS_INFOBAR_DELEGATE = 45,
|
GOOGLE_API_KEYS_INFOBAR_DELEGATE = 45,
|
||||||
OBSOLETE_SYSTEM_INFOBAR_DELEGATE = 46,
|
OBSOLETE_SYSTEM_INFOBAR_DELEGATE = 46,
|
||||||
SESSION_CRASHED_INFOBAR_DELEGATE = 47,
|
SESSION_CRASHED_INFOBAR_DELEGATE = 47,
|
||||||
WEBSITE_SETTINGS_INFOBAR_DELEGATE = 48,
|
PAGE_INFO_INFOBAR_DELEGATE = 48,
|
||||||
AUTOFILL_CC_INFOBAR_DELEGATE = 49,
|
AUTOFILL_CC_INFOBAR_DELEGATE = 49,
|
||||||
TRANSLATE_INFOBAR_DELEGATE = 50,
|
TRANSLATE_INFOBAR_DELEGATE = 50,
|
||||||
IOS_CHROME_SAVE_PASSWORD_INFOBAR_DELEGATE = 51,
|
IOS_CHROME_SAVE_PASSWORD_INFOBAR_DELEGATE = 51,
|
||||||
|
@@ -35,7 +35,7 @@ dialogs are:
|
|||||||
5. One-click signin
|
5. One-click signin
|
||||||
6. Site permissions bubble
|
6. Site permissions bubble
|
||||||
7. "Card unmask prompt" (TODO(ellyjones): what is this?)
|
7. "Card unmask prompt" (TODO(ellyjones): what is this?)
|
||||||
8. Website settings dialog
|
8. Page info dialog
|
||||||
|
|
||||||
Once all of these dialogs are converted and tested behind the feature, we can
|
Once all of these dialogs are converted and tested behind the feature, we can
|
||||||
ship to canary and dev channels and watch for any performance or crash rate
|
ship to canary and dev channels and watch for any performance or crash rate
|
||||||
|
@@ -23,7 +23,7 @@ NSString* MessageForHTTPAuth(NSURLProtectionSpace* protectionSpace) {
|
|||||||
return RequesterIdentity(protectionSpace);
|
return RequesterIdentity(protectionSpace);
|
||||||
|
|
||||||
NSString* securityWarning =
|
NSString* securityWarning =
|
||||||
l10n_util::GetNSString(IDS_WEBSITE_SETTINGS_NON_SECURE_TRANSPORT);
|
l10n_util::GetNSString(IDS_PAGE_INFO_NON_SECURE_TRANSPORT);
|
||||||
return
|
return
|
||||||
[NSString stringWithFormat:@"%@ %@", RequesterIdentity(protectionSpace),
|
[NSString stringWithFormat:@"%@ %@", RequesterIdentity(protectionSpace),
|
||||||
securityWarning];
|
securityWarning];
|
||||||
|
@@ -81,12 +81,13 @@ TEST(NSURLProtectionSpaceUtilTest, ShowForSocksProxy) {
|
|||||||
// Expecting the following text:
|
// Expecting the following text:
|
||||||
// The proxy chromium.org requires a username and password.
|
// The proxy chromium.org requires a username and password.
|
||||||
// Your connection to this site is not private.
|
// Your connection to this site is not private.
|
||||||
NSString* expectedText = [NSString
|
NSString* expectedText =
|
||||||
stringWithFormat:@"%@ %@", l10n_util::GetNSStringF(
|
[NSString stringWithFormat:@"%@ %@",
|
||||||
|
l10n_util::GetNSStringF(
|
||||||
IDS_LOGIN_DIALOG_PROXY_AUTHORITY,
|
IDS_LOGIN_DIALOG_PROXY_AUTHORITY,
|
||||||
base::SysNSStringToUTF16(kTestHost)),
|
base::SysNSStringToUTF16(kTestHost)),
|
||||||
l10n_util::GetNSString(
|
l10n_util::GetNSString(
|
||||||
IDS_WEBSITE_SETTINGS_NON_SECURE_TRANSPORT)];
|
IDS_PAGE_INFO_NON_SECURE_TRANSPORT)];
|
||||||
|
|
||||||
EXPECT_NSEQ(expectedText, MessageForHTTPAuth(protectionSpace));
|
EXPECT_NSEQ(expectedText, MessageForHTTPAuth(protectionSpace));
|
||||||
}
|
}
|
||||||
@@ -101,12 +102,13 @@ TEST(NSURLProtectionSpaceUtilTest, ShowForHttpProxy) {
|
|||||||
// Expecting the following text:
|
// Expecting the following text:
|
||||||
// The proxy http://chromium.org requires a username and password.
|
// The proxy http://chromium.org requires a username and password.
|
||||||
// Your connection to this site is not private.
|
// Your connection to this site is not private.
|
||||||
NSString* expectedText = [NSString
|
NSString* expectedText =
|
||||||
stringWithFormat:@"%@ %@", l10n_util::GetNSStringF(
|
[NSString stringWithFormat:@"%@ %@",
|
||||||
|
l10n_util::GetNSStringF(
|
||||||
IDS_LOGIN_DIALOG_PROXY_AUTHORITY,
|
IDS_LOGIN_DIALOG_PROXY_AUTHORITY,
|
||||||
base::SysNSStringToUTF16(kTestHttpOrigin)),
|
base::SysNSStringToUTF16(kTestHttpOrigin)),
|
||||||
l10n_util::GetNSString(
|
l10n_util::GetNSString(
|
||||||
IDS_WEBSITE_SETTINGS_NON_SECURE_TRANSPORT)];
|
IDS_PAGE_INFO_NON_SECURE_TRANSPORT)];
|
||||||
EXPECT_NSEQ(expectedText, MessageForHTTPAuth(protectionSpace));
|
EXPECT_NSEQ(expectedText, MessageForHTTPAuth(protectionSpace));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,7 +132,7 @@ TEST(NSURLProtectionSpaceUtilTest, ShowForHttpsProxy) {
|
|||||||
IDS_LOGIN_DIALOG_PROXY_AUTHORITY,
|
IDS_LOGIN_DIALOG_PROXY_AUTHORITY,
|
||||||
base::SysNSStringToUTF16(kTestHttpsOrigin)),
|
base::SysNSStringToUTF16(kTestHttpsOrigin)),
|
||||||
l10n_util::GetNSString(
|
l10n_util::GetNSString(
|
||||||
IDS_WEBSITE_SETTINGS_NON_SECURE_TRANSPORT)];
|
IDS_PAGE_INFO_NON_SECURE_TRANSPORT)];
|
||||||
} else {
|
} else {
|
||||||
// Expecting the following text:
|
// Expecting the following text:
|
||||||
// The proxy https://chromium.org:80 requires a username and password.
|
// The proxy https://chromium.org:80 requires a username and password.
|
||||||
@@ -150,12 +152,13 @@ TEST(NSURLProtectionSpaceUtilTest, ShowForHttpServer) {
|
|||||||
|
|
||||||
// Expecting the following text:
|
// Expecting the following text:
|
||||||
// http://chromium.org requires a username and password.
|
// http://chromium.org requires a username and password.
|
||||||
NSString* expectedText = [NSString
|
NSString* expectedText =
|
||||||
stringWithFormat:@"%@ %@", l10n_util::GetNSStringF(
|
[NSString stringWithFormat:@"%@ %@",
|
||||||
|
l10n_util::GetNSStringF(
|
||||||
IDS_LOGIN_DIALOG_AUTHORITY,
|
IDS_LOGIN_DIALOG_AUTHORITY,
|
||||||
base::SysNSStringToUTF16(kTestHttpOrigin)),
|
base::SysNSStringToUTF16(kTestHttpOrigin)),
|
||||||
l10n_util::GetNSString(
|
l10n_util::GetNSString(
|
||||||
IDS_WEBSITE_SETTINGS_NON_SECURE_TRANSPORT)];
|
IDS_PAGE_INFO_NON_SECURE_TRANSPORT)];
|
||||||
EXPECT_NSEQ(expectedText, MessageForHTTPAuth(protectionSpace));
|
EXPECT_NSEQ(expectedText, MessageForHTTPAuth(protectionSpace));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1409,7 +1409,7 @@ should be able to be added at any place in this file.
|
|||||||
<owner>mariakhomenko@chromium.org</owner>
|
<owner>mariakhomenko@chromium.org</owner>
|
||||||
<owner>tedchoc@chromium.org</owner>
|
<owner>tedchoc@chromium.org</owner>
|
||||||
<description>
|
<description>
|
||||||
An instant app was launched from the website settings popup.
|
An instant app was launched from the page info popup.
|
||||||
</description>
|
</description>
|
||||||
</action>
|
</action>
|
||||||
|
|
||||||
@@ -10518,13 +10518,13 @@ should be able to be added at any place in this file.
|
|||||||
|
|
||||||
<action name="MobileWebsiteSettingsOpenedFromMenu">
|
<action name="MobileWebsiteSettingsOpenedFromMenu">
|
||||||
<owner>tedchoc@chromium.org</owner>
|
<owner>tedchoc@chromium.org</owner>
|
||||||
<description>Website Settings opened via the menu.</description>
|
<description>Page Info opened via the menu.</description>
|
||||||
</action>
|
</action>
|
||||||
|
|
||||||
<action name="MobileWebsiteSettingsOpenedFromToolbar">
|
<action name="MobileWebsiteSettingsOpenedFromToolbar">
|
||||||
<owner>tedchoc@chromium.org</owner>
|
<owner>tedchoc@chromium.org</owner>
|
||||||
<description>
|
<description>
|
||||||
Website Settings opened via the toolbar page info (i.e. https lock) icon.
|
Page Info opened via the toolbar page info (i.e. https lock) icon.
|
||||||
</description>
|
</description>
|
||||||
</action>
|
</action>
|
||||||
|
|
||||||
|
@@ -80093,7 +80093,7 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
|
|||||||
<owner>sashab@chromium.org</owner>
|
<owner>sashab@chromium.org</owner>
|
||||||
<summary>
|
<summary>
|
||||||
Count of how often a specific content type (permission) is changed using the
|
Count of how often a specific content type (permission) is changed using the
|
||||||
Website Settings UI.
|
Page Info UI.
|
||||||
</summary>
|
</summary>
|
||||||
</histogram>
|
</histogram>
|
||||||
|
|
||||||
@@ -97435,7 +97435,7 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
|
|||||||
<int value="45" label="GOOGLE_API_KEYS_INFOBAR_DELEGATE"/>
|
<int value="45" label="GOOGLE_API_KEYS_INFOBAR_DELEGATE"/>
|
||||||
<int value="46" label="OBSOLETE_SYSTEM_INFOBAR_DELEGATE"/>
|
<int value="46" label="OBSOLETE_SYSTEM_INFOBAR_DELEGATE"/>
|
||||||
<int value="47" label="SESSION_CRASHED_INFOBAR_DELEGATE"/>
|
<int value="47" label="SESSION_CRASHED_INFOBAR_DELEGATE"/>
|
||||||
<int value="48" label="WEBSITE_SETTINGS_INFOBAR_DELEGATE"/>
|
<int value="48" label="PAGE_INFO_INFOBAR_DELEGATE"/>
|
||||||
<int value="49" label="AUTOFILL_CC_INFOBAR_DELEGATE"/>
|
<int value="49" label="AUTOFILL_CC_INFOBAR_DELEGATE"/>
|
||||||
<int value="50" label="TRANSLATE_INFOBAR_DELEGATE"/>
|
<int value="50" label="TRANSLATE_INFOBAR_DELEGATE"/>
|
||||||
<int value="51" label="IOS_CHROME_SAVE_PASSWORD_INFOBAR_DELEGATE"/>
|
<int value="51" label="IOS_CHROME_SAVE_PASSWORD_INFOBAR_DELEGATE"/>
|
||||||
|
Reference in New Issue
Block a user