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

Unified Diff: chrome/browser/ui/views/website_settings/website_settings_popup_view.cc

Issue 1917013002: Use a different string and icon for chrome-extension pages in Page Info Bubble. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix build Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/website_settings/website_settings_popup_view.cc
diff --git a/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc b/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc
index 0b36a8e880443aa8dcf40a7e2b204d6063638e0e..01aa58bf59e90f535b8d926b9d5894bfa78ba1ca 100644
--- a/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc
+++ b/chrome/browser/ui/views/website_settings/website_settings_popup_view.cc
@@ -27,7 +27,6 @@
#include "chrome/browser/ui/views/website_settings/chosen_object_view.h"
#include "chrome/browser/ui/views/website_settings/permission_selector_view.h"
#include "chrome/browser/ui/website_settings/website_settings.h"
-#include "chrome/browser/ui/website_settings/website_settings_utils.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/chromium_strings.h"
@@ -37,6 +36,7 @@
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/cert_store.h"
#include "content/public/browser/user_metrics.h"
+#include "extensions/common/constants.h"
#include "grit/components_chromium_strings.h"
#include "grit/components_google_chrome_strings.h"
#include "grit/components_strings.h"
@@ -162,7 +162,8 @@ class InternalPageInfoPopupView : public views::BubbleDialogDelegateView {
// If |anchor_view| is nullptr, or has no Widget, |parent_window| may be
// provided to ensure this bubble is closed when the parent closes.
InternalPageInfoPopupView(views::View* anchor_view,
- gfx::NativeView parent_window);
+ gfx::NativeView parent_window,
+ bool is_extension_page);
~InternalPageInfoPopupView() override;
// views::BubbleDialogDelegateView:
@@ -320,7 +321,8 @@ void PopupHeaderView::AddResetDecisionsButton() {
InternalPageInfoPopupView::InternalPageInfoPopupView(
views::View* anchor_view,
- gfx::NativeView parent_window)
+ gfx::NativeView parent_window,
+ bool is_extension_page)
: BubbleDialogDelegateView(anchor_view, views::BubbleBorder::TOP_LEFT) {
set_parent_window(parent_window);
@@ -334,11 +336,13 @@ InternalPageInfoPopupView::InternalPageInfoPopupView(
set_margins(gfx::Insets());
views::ImageView* icon_view = new views::ImageView();
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
- icon_view->SetImage(rb.GetImageSkiaNamed(IDR_PRODUCT_LOGO_16));
+ icon_view->SetImage(rb.GetImageSkiaNamed(
+ is_extension_page ? IDR_PLUGINS_FAVICON : IDR_PRODUCT_LOGO_16));
AddChildView(icon_view);
- views::Label* label =
- new views::Label(l10n_util::GetStringUTF16(IDS_PAGE_INFO_INTERNAL_PAGE));
+ views::Label* label = new views::Label(l10n_util::GetStringUTF16(
+ is_extension_page ? IDS_PAGE_INFO_EXTENSION_PAGE
+ : IDS_PAGE_INFO_INTERNAL_PAGE));
label->SetMultiLine(true);
label->SetAllowCharacterBreak(true);
label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
@@ -386,20 +390,21 @@ void WebsiteSettingsPopupView::ShowPopup(
is_popup_showing = true;
gfx::NativeView parent_window =
anchor_view ? nullptr : web_contents->GetNativeView();
- if (InternalChromePage(url)) {
+ if (url.SchemeIs(content::kChromeUIScheme) ||
+ url.SchemeIs(extensions::kExtensionScheme)) {
// Use the concrete type so that |SetAnchorRect| can be called as a friend.
- InternalPageInfoPopupView* popup =
- new InternalPageInfoPopupView(anchor_view, parent_window);
- if (!anchor_view)
- popup->SetAnchorRect(anchor_rect);
- popup->GetWidget()->Show();
- } else {
- WebsiteSettingsPopupView* popup = new WebsiteSettingsPopupView(
- anchor_view, parent_window, profile, web_contents, url, security_info);
+ InternalPageInfoPopupView* popup = new InternalPageInfoPopupView(
+ anchor_view, parent_window, url.SchemeIs(extensions::kExtensionScheme));
if (!anchor_view)
popup->SetAnchorRect(anchor_rect);
popup->GetWidget()->Show();
+ return;
}
+ WebsiteSettingsPopupView* popup = new WebsiteSettingsPopupView(
+ anchor_view, parent_window, profile, web_contents, url, security_info);
+ if (!anchor_view)
+ popup->SetAnchorRect(anchor_rect);
+ popup->GetWidget()->Show();
}
// static

Powered by Google App Engine
This is Rietveld 408576698