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

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

Issue 2654123004: harmony: partly harmonize permissions bubble (Closed)
Patch Set: fix constant names Created 3 years, 11 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
« no previous file with comments | « chrome/browser/ui/views/harmony/layout_delegate.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/website_settings/permission_prompt_impl.cc
diff --git a/chrome/browser/ui/views/website_settings/permission_prompt_impl.cc b/chrome/browser/ui/views/website_settings/permission_prompt_impl.cc
index 37d4cc62d4aada07ed8265a3e4c8d234b29e80fa..cd97f68e3d5a018257290e59a19567017ac5fe27 100644
--- a/chrome/browser/ui/views/website_settings/permission_prompt_impl.cc
+++ b/chrome/browser/ui/views/website_settings/permission_prompt_impl.cc
@@ -15,6 +15,7 @@
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/views/exclusive_access_bubble_views.h"
+#include "chrome/browser/ui/views/harmony/layout_delegate.h"
#include "chrome/browser/ui/views/website_settings/permission_selector_row.h"
#include "chrome/browser/ui/views/website_settings/permission_selector_row_observer.h"
#include "chrome/grit/generated_resources.h"
@@ -28,6 +29,7 @@
#include "ui/gfx/paint_vector_icon.h"
#include "ui/gfx/text_constants.h"
#include "ui/gfx/vector_icons_public.h"
+#include "ui/views/background.h"
#include "ui/views/bubble/bubble_dialog_delegate.h"
#include "ui/views/bubble/bubble_frame_view.h"
#include "ui/views/controls/button/checkbox.h"
@@ -43,9 +45,6 @@
namespace {
-// Spacing between major items should be 9px.
-const int kItemMajorSpacing = 9;
-
// (Square) pixel size of icon.
const int kIconSize = 18;
@@ -198,8 +197,12 @@ PermissionsBubbleDialogDelegateView::PermissionsBubbleDialogDelegateView(
set_close_on_deactivate(false);
- SetLayoutManager(new views::BoxLayout(views::BoxLayout::kVertical, 0, 0,
- kItemMajorSpacing));
+ LayoutDelegate* layout_delegate = LayoutDelegate::Get();
+ SetLayoutManager(
+ new views::BoxLayout(views::BoxLayout::kVertical, 0, 0,
+ layout_delegate->GetMetric(
+ LayoutDelegate::Metric::
+ RELATED_CONTROL_VERTICAL_SPACING)));
display_origin_ = url_formatter::FormatUrlForSecurityDisplay(
requests[0]->GetOrigin(),
@@ -222,9 +225,12 @@ PermissionsBubbleDialogDelegateView::PermissionsBubbleDialogDelegateView(
row_layout->StartRow(0, 0);
views::View* label_container = new views::View();
+ int indent = layout_delegate->GetMetric(
+ LayoutDelegate::Metric::SUBSECTION_HORIZONTAL_INDENT);
label_container->SetLayoutManager(new views::BoxLayout(
- views::BoxLayout::kHorizontal, views::kCheckboxIndent, 0,
- views::kItemLabelSpacing));
+ views::BoxLayout::kHorizontal, indent, 0,
+ layout_delegate->GetMetric(
+ LayoutDelegate::Metric::RELATED_LABEL_HORIZONTAL_SPACING)));
views::ImageView* icon = new views::ImageView();
gfx::VectorIconId vector_id = requests[index]->GetIconId();
if (vector_id != gfx::VectorIconId::VECTOR_ICON_NONE) {
« no previous file with comments | « chrome/browser/ui/views/harmony/layout_delegate.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698