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

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

Issue 2758323002: Broke out layout metric information from ViewsDelegate to LayoutProvider (Closed)
Patch Set: Deleted LayoutDelegate and HarmonyLayoutDelegate. Created 3 years, 9 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/permission_bubble/permission_prompt_impl.cc
diff --git a/chrome/browser/ui/views/permission_bubble/permission_prompt_impl.cc b/chrome/browser/ui/views/permission_bubble/permission_prompt_impl.cc
index f85441092ccba6ffa8115b7fb4efe43793bd6c28..4da84e3fb967c1ee319cb8d5773e805a01793fd1 100644
--- a/chrome/browser/ui/views/permission_bubble/permission_prompt_impl.cc
+++ b/chrome/browser/ui/views/permission_bubble/permission_prompt_impl.cc
@@ -16,7 +16,7 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/layout_constants.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/harmony/chrome_views_layout_delegate.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/grit/generated_resources.h"
@@ -197,12 +197,11 @@ PermissionsBubbleDialogDelegateView::PermissionsBubbleDialogDelegateView(
set_close_on_deactivate(false);
- LayoutDelegate* layout_delegate = LayoutDelegate::Get();
- SetLayoutManager(
- new views::BoxLayout(views::BoxLayout::kVertical, 0, 0,
- layout_delegate->GetMetric(
- LayoutDelegate::Metric::
- RELATED_CONTROL_VERTICAL_SPACING)));
+ ChromeViewsLayoutDelegate* layout_delegate = ChromeViewsLayoutDelegate::Get();
+ SetLayoutManager(new views::BoxLayout(
+ views::BoxLayout::kVertical, 0, 0,
+ layout_delegate->GetDistanceMetric(
+ ChromeDistanceMetric::RELATED_CONTROL_VERTICAL)));
display_origin_ = url_formatter::FormatUrlForSecurityDisplay(
requests[0]->GetOrigin(),
@@ -225,12 +224,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);
+ int indent = layout_delegate->GetDistanceMetric(
+ ChromeDistanceMetric::SUBSECTION_HORIZONTAL_INDENT);
label_container->SetLayoutManager(new views::BoxLayout(
views::BoxLayout::kHorizontal, indent, 0,
- layout_delegate->GetMetric(
- LayoutDelegate::Metric::RELATED_LABEL_HORIZONTAL_SPACING)));
+ layout_delegate->GetDistanceMetric(
+ ChromeDistanceMetric::RELATED_LABEL_HORIZONTAL)));
views::ImageView* icon = new views::ImageView();
const gfx::VectorIcon& vector_id = requests[index]->GetIconId();
icon->SetImage(

Powered by Google App Engine
This is Rietveld 408576698