Commit 70291900 authored by Trent Apted's avatar Trent Apted Committed by Commit Bot

Update HTTP-Auth to latest Harmony mocks.

With *and without* --secondary-ui-md:
 * Removes the colons from the field labels
 * Alters the text for insecure domains to say "Your connection to this site is not private"
 * Makes the dialog title and "Log in" button text sentence case on non-Mac/iOS
 * Removes " requires a username and password" after the domain for non-Proxy auth requests
 * Removes the insets on the sides of the textfield stack relative to the dialog title.
 * Removes the close button from the http-auth dialog

With --secondary-ui-md only:
 * Uses SECONDARY / gray text for the second line of header text
 * Makes textfields 28px tall

3 general adjustments applicable to a class of dialogs remain to be done:
 * Too much spacing from the title to the body text, and
 * Too little spacing from the last textfield to the button row.
 * Textfields should horizontally align "somehow" we don't know how yet

Adds ui/views/harmony/layout_helper.h to encapsulate methods for creating a
textfield stack in the standard layout.

Bug: 602392
Change-Id: I27fbc52c95d9bd8ac2a3551d916d3f161f51593f
Reviewed-on: https://chromium-review.googlesource.com/559205Reviewed-by: default avatarColin Blundell <blundell@chromium.org>
Reviewed-by: default avatarPeter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarBret Sepulveda <bsep@chromium.org>
Commit-Queue: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#487030}
parent 0a992857
......@@ -1540,6 +1540,8 @@ split_static_library("ui") {
"views/harmony/harmony_layout_provider.h",
"views/harmony/harmony_typography_provider.cc",
"views/harmony/harmony_typography_provider.h",
"views/harmony/textfield_layout.cc",
"views/harmony/textfield_layout.h",
"views/importer/import_lock_dialog_view.cc",
"views/importer/import_lock_dialog_view.h",
"views/location_bar/location_bar_bubble_delegate_view.cc",
......
......@@ -13,6 +13,7 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/synchronization/lock.h"
#include "build/build_config.h"
#include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/password_manager/chrome_password_manager_client.h"
#include "chrome/browser/prerender/prerender_contents.h"
......@@ -507,16 +508,20 @@ void LoginHandler::GetDialogStrings(const GURL& request_url,
auth_info.challenger, url_formatter::SchemeDisplay::SHOW));
authority_url = auth_info.challenger.GetURL();
} else {
*authority = l10n_util::GetStringFUTF16(
IDS_LOGIN_DIALOG_AUTHORITY,
url_formatter::FormatUrlForSecurityDisplay(request_url));
*authority = url_formatter::FormatUrlForSecurityDisplay(request_url);
#if defined(OS_ANDROID)
// Android concatenates with a space rather than displaying on two separate
// lines, so it needs some surrounding text.
*authority =
l10n_util::GetStringFUTF16(IDS_LOGIN_DIALOG_AUTHORITY, *authority);
#endif
authority_url = request_url;
}
if (!content::IsOriginSecure(authority_url)) {
// TODO(asanka): The string should be different for proxies and servers.
// http://crbug.com/620756
*explanation = l10n_util::GetStringUTF16(IDS_PAGE_INFO_NOT_SECURE_SUMMARY);
*explanation = l10n_util::GetStringUTF16(IDS_LOGIN_DIALOG_NOT_PRIVATE);
} else {
explanation->clear();
}
......
......@@ -6,6 +6,7 @@
#include "base/macros.h"
#include "base/strings/utf_string_conversions.h"
#include "build/build_config.h"
#include "chrome/browser/ui/login/login_handler.h"
#include "net/base/auth.h"
#include "testing/gtest/include/gtest/gtest.h"
......@@ -16,7 +17,7 @@ namespace {
const char kHttpUrl[] = "http://example.com/foo/bar";
const char kBasicAuthScheme[] = "Basic";
const char kFooRealm[] = "Foo";
const char kInsecureProxy[] = "Your connection to this site is not secure";
const char kInsecureProxy[] = "Your connection to this site is not private";
enum TargetType { PROXY, SERVER };
......@@ -37,76 +38,79 @@ const struct TestCase {
// Insecure proxy
{kHttpUrl,
{PROXY, kBasicAuthScheme, kFooRealm, "http://example.com"},
{"The proxy http://example.com requires a username and password.",
kInsecureProxy, "example.com:80/Foo"}},
{"The proxy http://example.com", kInsecureProxy, "example.com:80/Foo"}},
// Insecure proxy on non-standard port
{kHttpUrl,
{PROXY, kBasicAuthScheme, kFooRealm, "http://example.com:8009"},
{"The proxy http://example.com:8009 requires a username and password.",
kInsecureProxy, "example.com:8009/Foo"}},
{"The proxy http://example.com:8009", kInsecureProxy,
"example.com:8009/Foo"}},
// Secure proxy
{kHttpUrl,
{PROXY, kBasicAuthScheme, kFooRealm, "https://example.com"},
{"The proxy https://example.com requires a username and password.", "",
"example.com:443/Foo"}},
{"The proxy https://example.com", "", "example.com:443/Foo"}},
// Secure proxy on non-standard port
{kHttpUrl,
{PROXY, kBasicAuthScheme, kFooRealm, "https://example.com:446"},
{"The proxy https://example.com:446 requires a username and password.", "",
"example.com:446/Foo"}},
{"The proxy https://example.com:446", "", "example.com:446/Foo"}},
// localhost
{kHttpUrl,
{PROXY, kBasicAuthScheme, kFooRealm, "http://localhost:7323"},
{"The proxy http://localhost:7323 requires a username and password.", "",
"localhost:7323/Foo"}},
{"The proxy http://localhost:7323", "", "localhost:7323/Foo"}},
// Secure server
{"https://www.nowhere.org/dir/index.html",
{SERVER, kBasicAuthScheme, kFooRealm, nullptr},
{"https://www.nowhere.org requires a username and password.", "",
"https://www.nowhere.org/Foo"}},
{"https://www.nowhere.org", "", "https://www.nowhere.org/Foo"}},
// URL uses default port.
{"https://www.nowhere.org:443/dir/index.html",
{SERVER, kBasicAuthScheme, kFooRealm, nullptr},
{"https://www.nowhere.org requires a username and password.", "",
"https://www.nowhere.org/Foo"}},
{"https://www.nowhere.org", "", "https://www.nowhere.org/Foo"}},
// URL uses non-default port.
{"https://www.nowhere.org:8443/dir/index.html",
{SERVER, kBasicAuthScheme, kFooRealm, nullptr},
{"https://www.nowhere.org:8443 requires a username and password.", "",
"https://www.nowhere.org:8443/Foo"}},
{"https://www.nowhere.org:8443", "", "https://www.nowhere.org:8443/Foo"}},
// URL has no trailing slash.
{"https://www.nowhere.org",
{SERVER, kBasicAuthScheme, kFooRealm, nullptr},
{"https://www.nowhere.org requires a username and password.", "",
"https://www.nowhere.org/Foo"}},
{"https://www.nowhere.org", "", "https://www.nowhere.org/Foo"}},
// username:password
{"https://foo:bar@www.nowhere.org/dir/index.html",
{SERVER, kBasicAuthScheme, kFooRealm, nullptr},
{"https://www.nowhere.org requires a username and password.", "",
"https://www.nowhere.org/Foo"}},
{"https://www.nowhere.org", "", "https://www.nowhere.org/Foo"}},
// query
{"https://www.nowhere.org/dir/index.html?id=965362",
{SERVER, kBasicAuthScheme, kFooRealm, nullptr},
{"https://www.nowhere.org requires a username and password.", "",
"https://www.nowhere.org/Foo"}},
{"https://www.nowhere.org", "", "https://www.nowhere.org/Foo"}},
// reference
{"https://www.nowhere.org/dir/index.html#toc",
{SERVER, kBasicAuthScheme, kFooRealm, nullptr},
{"https://www.nowhere.org requires a username and password.", "",
"https://www.nowhere.org/Foo"}},
{"https://www.nowhere.org", "", "https://www.nowhere.org/Foo"}},
};
base::string16 ExpectedAuthority(bool is_proxy, const char* prefix) {
base::string16 str = base::ASCIIToUTF16(prefix);
// Proxies and Android have additional surrounding text. Otherwise, only the
// host URL is shown.
bool extra_text = is_proxy;
#if defined(OS_ANDROID)
extra_text = true;
#endif
if (extra_text)
str += base::ASCIIToUTF16(" requires a username and password.");
return str;
}
} // namespace
TEST(LoginHandlerTest, DialogStringsAndRealm) {
......@@ -131,8 +135,9 @@ TEST(LoginHandlerTest, DialogStringsAndRealm) {
LoginHandler::GetDialogStrings(request_url, *auth_info, &authority,
&explanation);
EXPECT_STREQ(test_case.expected.authority,
base::UTF16ToASCII(authority).c_str());
EXPECT_EQ(ExpectedAuthority(test_case.auth_info.target_type == PROXY,
test_case.expected.authority),
authority);
EXPECT_STREQ(test_case.expected.explanation,
base::UTF16ToASCII(explanation).c_str());
......
......@@ -4,11 +4,14 @@
#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h"
#include <algorithm>
#include "base/logging.h"
#include "base/memory/ptr_util.h"
#include "chrome/browser/ui/views/harmony/chrome_typography.h"
#include "chrome/browser/ui/views/harmony/harmony_layout_provider.h"
#include "ui/base/material_design/material_design_controller.h"
#include "ui/gfx/font_list.h"
// static
ChromeLayoutProvider* ChromeLayoutProvider::Get() {
......@@ -23,12 +26,22 @@ ChromeLayoutProvider::CreateLayoutProvider() {
: base::MakeUnique<ChromeLayoutProvider>();
}
// static
int ChromeLayoutProvider::GetControlHeightForFont(const gfx::FontList& font) {
return std::max(views::style::GetLineHeight(views::style::CONTEXT_LABEL,
views::style::STYLE_PRIMARY),
font.GetHeight()) +
Get()->GetDistanceMetric(DISTANCE_CONTROL_TOTAL_VERTICAL_TEXT_PADDING);
}
int ChromeLayoutProvider::GetDistanceMetric(int metric) const {
switch (metric) {
case DISTANCE_BUTTON_MINIMUM_WIDTH:
return 48;
case DISTANCE_CONTROL_LIST_VERTICAL:
return GetDistanceMetric(views::DISTANCE_UNRELATED_CONTROL_VERTICAL);
case DISTANCE_CONTROL_TOTAL_VERTICAL_TEXT_PADDING:
return 6;
case DISTANCE_RELATED_CONTROL_HORIZONTAL_SMALL:
return 8;
case DISTANCE_RELATED_CONTROL_VERTICAL_SMALL:
......
......@@ -17,6 +17,8 @@ enum ChromeDistanceMetric {
DISTANCE_BUTTON_MINIMUM_WIDTH = views::VIEWS_DISTANCE_END,
// Vertical spacing between a list of multiple controls in one column.
DISTANCE_CONTROL_LIST_VERTICAL,
// The combined vertical padding applied to text in a control.
DISTANCE_CONTROL_TOTAL_VERTICAL_TEXT_PADDING,
// Smaller horizontal spacing between other controls that are logically
// related.
DISTANCE_RELATED_CONTROL_HORIZONTAL_SMALL,
......@@ -47,6 +49,10 @@ class ChromeLayoutProvider : public views::LayoutProvider {
static ChromeLayoutProvider* Get();
static std::unique_ptr<views::LayoutProvider> CreateLayoutProvider();
// Calculates the control height based on the |font|'s reported glyph height,
// the default line spacing and DISTANCE_CONTROL_TOTAL_VERTICAL_TEXT_PADDING.
static int GetControlHeightForFont(const gfx::FontList& font);
// views::LayoutProvider:
int GetDistanceMetric(int metric) const override;
const views::TypographyProvider& GetTypographyProvider() const override;
......
......@@ -36,6 +36,8 @@ int HarmonyLayoutProvider::GetDistanceMetric(int metric) const {
// margin we need to subtract out the padding.
return kVisibleMargin - kHarmonyLayoutUnit / 4;
}
case DISTANCE_CONTROL_TOTAL_VERTICAL_TEXT_PADDING:
return kHarmonyLayoutUnit / 2;
case views::DISTANCE_RELATED_BUTTON_HORIZONTAL:
return kHarmonyLayoutUnit / 2;
case views::DISTANCE_RELATED_CONTROL_HORIZONTAL:
......
// Copyright 2017 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.
#include "chrome/browser/ui/views/harmony/textfield_layout.h"
#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h"
#include "ui/views/controls/label.h"
#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/layout/grid_layout.h"
using views::GridLayout;
namespace {
// GridLayout "resize percent" constants.
constexpr float kFixed = 0.f;
constexpr float kStretchy = 1.f;
} // namespace
views::ColumnSet* ConfigureTextfieldStack(GridLayout* layout,
int column_set_id) {
ChromeLayoutProvider* provider = ChromeLayoutProvider::Get();
const int between_padding =
provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_HORIZONTAL);
views::ColumnSet* column_set = layout->AddColumnSet(column_set_id);
column_set->AddColumn(provider->GetControlLabelGridAlignment(),
GridLayout::CENTER, kFixed, GridLayout::USE_PREF, 0, 0);
// TODO(tapted): This column may need some additional alignment logic under
// Harmony so that its x-offset is not wholly dictated by the string length
// of labels in the first column.
column_set->AddPaddingColumn(kFixed, between_padding);
column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, kStretchy,
GridLayout::USE_PREF, 0, 0);
return column_set;
}
views::Textfield* AddFirstTextfieldRow(GridLayout* layout,
const base::string16& label_text,
int column_set_id) {
views::Textfield* textfield = new views::Textfield();
layout->StartRow(
kFixed, column_set_id,
ChromeLayoutProvider::GetControlHeightForFont(textfield->GetFontList()));
views::Label* label = new views::Label(
label_text, views::style::CONTEXT_LABEL, views::style::STYLE_PRIMARY);
textfield->SetAccessibleName(label_text);
layout->AddView(label);
layout->AddView(textfield);
return textfield;
}
views::Textfield* AddTextfieldRow(GridLayout* layout,
const base::string16& label,
int column_set_id) {
layout->AddPaddingRow(kFixed, ChromeLayoutProvider::Get()->GetDistanceMetric(
DISTANCE_CONTROL_LIST_VERTICAL));
return AddFirstTextfieldRow(layout, label, column_set_id);
}
// Copyright 2017 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_VIEWS_HARMONY_TEXTFIELD_LAYOUT_H_
#define CHROME_BROWSER_UI_VIEWS_HARMONY_TEXTFIELD_LAYOUT_H_
#include "base/strings/string16.h"
namespace views {
class ColumnSet;
class GridLayout;
class Textfield;
} // namespace views
// Configures a three-column ColumnSet for the standard textfield stack layout
// with: {Label, Padding, Textfield}.
views::ColumnSet* ConfigureTextfieldStack(views::GridLayout* layout,
int column_set_id);
// Adds a views::Label and Textfield to |column_set_id| in |layout|, which has
// been configured as a Textfield stack. The returned Textfield will be owned by
// the View hosting |layout|.
views::Textfield* AddFirstTextfieldRow(views::GridLayout* layout,
const base::string16& label,
int column_set_id);
views::Textfield* AddTextfieldRow(views::GridLayout* layout,
const base::string16& label,
int column_set_id);
#endif // CHROME_BROWSER_UI_VIEWS_HARMONY_TEXTFIELD_LAYOUT_H_
......@@ -46,6 +46,8 @@ class LoginHandlerViews : public LoginHandler, public views::DialogDelegate {
void OnLoginModelDestroying() override {}
// views::DialogDelegate:
bool ShouldShowCloseButton() const override { return false; }
base::string16 GetDialogButtonLabel(ui::DialogButton button) const override {
if (button == ui::DIALOG_BUTTON_OK)
return l10n_util::GetStringUTF16(IDS_LOGIN_DIALOG_OK_BUTTON_LABEL);
......
......@@ -5,96 +5,73 @@
#include "chrome/browser/ui/views/login_view.h"
#include "chrome/browser/ui/views/harmony/chrome_layout_provider.h"
#include "chrome/browser/ui/views/harmony/chrome_typography.h"
#include "chrome/browser/ui/views/harmony/textfield_layout.h"
#include "components/strings/grit/components_strings.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/views/controls/label.h"
#include "ui/views/controls/textfield/textfield.h"
#include "ui/views/layout/grid_layout.h"
static const int kMessageWidth = 320;
static const int kTextfieldStackHorizontalSpacing = 30;
using password_manager::LoginModel;
using views::GridLayout;
namespace {
constexpr int kHeaderColumnSetId = 0;
constexpr int kFieldsColumnSetId = 1;
constexpr float kFixed = 0.f;
constexpr float kStretchy = 1.f;
// Adds a row to |layout| and puts a Label in it.
void AddHeaderLabel(GridLayout* layout,
const base::string16& text,
int text_style) {
views::Label* label =
new views::Label(text, views::style::CONTEXT_LABEL, text_style);
label->SetMultiLine(true);
label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
label->SetAllowCharacterBreak(true);
layout->StartRow(kFixed, kHeaderColumnSetId);
layout->AddView(label);
}
} // namespace
///////////////////////////////////////////////////////////////////////////////
// LoginView, public:
LoginView::LoginView(const base::string16& authority,
const base::string16& explanation,
LoginHandler::LoginModelData* login_model_data)
: username_field_(new views::Textfield()),
password_field_(new views::Textfield()),
username_label_(new views::Label(
l10n_util::GetStringUTF16(IDS_LOGIN_DIALOG_USERNAME_FIELD))),
password_label_(new views::Label(
l10n_util::GetStringUTF16(IDS_LOGIN_DIALOG_PASSWORD_FIELD))),
authority_label_(new views::Label(authority)),
message_label_(nullptr),
login_model_(login_model_data ? login_model_data->model : nullptr) {
: login_model_(login_model_data ? login_model_data->model : nullptr) {
// TODO(tapted): When Harmony is default, this should be removed and left up
// to textfield_layout.h to decide.
constexpr int kMessageWidth = 320;
ChromeLayoutProvider* provider = ChromeLayoutProvider::Get();
password_field_->SetTextInputType(ui::TEXT_INPUT_TYPE_PASSWORD);
authority_label_->SetMultiLine(true);
authority_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
authority_label_->SetAllowCharacterBreak(true);
// Initialize the Grid Layout Manager used for this dialog box.
GridLayout* layout = GridLayout::CreatePanel(this);
// Add the column set for the information message at the top of the dialog
// box.
const int single_column_view_set_id = 0;
views::ColumnSet* column_set =
layout->AddColumnSet(single_column_view_set_id);
column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, 1,
views::ColumnSet* column_set = layout->AddColumnSet(kHeaderColumnSetId);
column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, kStretchy,
GridLayout::FIXED, kMessageWidth, 0);
// Add the column set for the user name and password fields and labels.
const int labels_column_set_id = 1;
column_set = layout->AddColumnSet(labels_column_set_id);
if (provider->UseExtraDialogPadding())
column_set->AddPaddingColumn(0, kTextfieldStackHorizontalSpacing);
column_set->AddColumn(provider->GetControlLabelGridAlignment(),
GridLayout::CENTER, 0, GridLayout::USE_PREF, 0, 0);
column_set->AddPaddingColumn(
0,
provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_HORIZONTAL));
column_set->AddColumn(GridLayout::FILL, GridLayout::CENTER, 1,
GridLayout::USE_PREF, 0, 0);
if (provider->UseExtraDialogPadding())
column_set->AddPaddingColumn(0, kTextfieldStackHorizontalSpacing);
layout->StartRow(0, single_column_view_set_id);
layout->AddView(authority_label_);
if (!explanation.empty()) {
message_label_ = new views::Label(explanation);
message_label_->SetMultiLine(true);
message_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
message_label_->SetAllowCharacterBreak(true);
layout->AddPaddingRow(0, provider->GetDistanceMetric(
views::DISTANCE_RELATED_CONTROL_VERTICAL));
layout->StartRow(0, single_column_view_set_id);
layout->AddView(message_label_);
}
layout->AddPaddingRow(0, provider->GetDistanceMetric(
DISTANCE_UNRELATED_CONTROL_VERTICAL_LARGE));
layout->StartRow(0, labels_column_set_id);
layout->AddView(username_label_);
layout->AddView(username_field_);
layout->AddPaddingRow(
0, provider->GetDistanceMetric(views::DISTANCE_RELATED_CONTROL_VERTICAL));
layout->StartRow(0, labels_column_set_id);
layout->AddView(password_label_);
layout->AddView(password_field_);
AddHeaderLabel(layout, authority, views::style::STYLE_PRIMARY);
AddHeaderLabel(layout, explanation, STYLE_SECONDARY);
layout->AddPaddingRow(kFixed, provider->GetDistanceMetric(
DISTANCE_UNRELATED_CONTROL_VERTICAL_LARGE));
ConfigureTextfieldStack(layout, kFieldsColumnSetId);
username_field_ = AddFirstTextfieldRow(
layout, l10n_util::GetStringUTF16(IDS_LOGIN_DIALOG_USERNAME_FIELD),
kFieldsColumnSetId);
password_field_ = AddTextfieldRow(
layout, l10n_util::GetStringUTF16(IDS_LOGIN_DIALOG_PASSWORD_FIELD),
kFieldsColumnSetId);
password_field_->SetTextInputType(ui::TEXT_INPUT_TYPE_PASSWORD);
if (provider->UseExtraDialogPadding()) {
layout->AddPaddingRow(0, provider->GetDistanceMetric(
views::DISTANCE_UNRELATED_CONTROL_VERTICAL));
layout->AddPaddingRow(kFixed,
provider->GetDistanceMetric(
views::DISTANCE_UNRELATED_CONTROL_VERTICAL));
}
if (login_model_data) {
......
......@@ -5,15 +5,13 @@
#ifndef CHROME_BROWSER_UI_VIEWS_LOGIN_VIEW_H_
#define CHROME_BROWSER_UI_VIEWS_LOGIN_VIEW_H_
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/strings/string16.h"
#include "chrome/browser/ui/login/login_handler.h"
#include "components/autofill/core/common/password_form.h"
#include "components/password_manager/core/browser/login_model.h"
#include "ui/views/view.h"
namespace views {
class Label;
class Textfield;
}
......@@ -39,7 +37,7 @@ class LoginView : public views::View,
const base::string16& password) override;
void OnLoginModelDestroying() override;
// Used by LoginHandlerWin to set the initial focus.
// Used by LoginHandlerViews to set the initial focus.
views::View* GetInitiallyFocusedView();
private:
......@@ -50,14 +48,6 @@ class LoginView : public views::View,
views::Textfield* username_field_;
views::Textfield* password_field_;
// Button labels
views::Label* username_label_;
views::Label* password_label_;
// Authority and security state messages.
views::Label* authority_label_;
views::Label* message_label_;
// If not null, points to a model we need to notify of our own destruction
// so it doesn't try and access this when its too late.
password_manager::LoginModel* login_model_;
......
<?xml version="1.0" encoding="utf-8"?>
<grit-part>
<message name="IDS_LOGIN_DIALOG_TITLE" desc="String to be displayed in the title bar of the login prompt dialog" formatter_data="android_java">
Authentication Required
</message>
<if expr="use_titlecase">
<message name="IDS_LOGIN_DIALOG_TITLE" desc="In title case: String to be displayed in the title bar of the login prompt dialog" formatter_data="android_java">
Authentication Required
</message>
<message name="IDS_LOGIN_DIALOG_OK_BUTTON_LABEL" desc="In title case: The label of the 'Log In' button on the login prompt dialog" formatter_data="android_java">
Log In
</message>
</if>
<if expr="not use_titlecase">
<message name="IDS_LOGIN_DIALOG_TITLE" desc="In sentence case: String to be displayed in the title bar of the login prompt dialog" formatter_data="android_java">
Authentication required
</message>
<message name="IDS_LOGIN_DIALOG_OK_BUTTON_LABEL" desc="In sentence case: The label of the 'Log in' button on the login prompt dialog" formatter_data="android_java">
Log in
</message>
</if>
<message name="IDS_LOGIN_DIALOG_AUTHORITY" desc="String to be displayed in the login prompt dialog to explain that the user needs to log in, and the name of the web site">
<ph name="DOMAIN">$1<ex>google.com</ex></ph> requires a username and password.
</message>
<message name="IDS_LOGIN_DIALOG_PROXY_AUTHORITY" desc="String to be displayed in the proxy login prompt dialog to explain that the user needs to log in, and the name of the proxy">
The proxy <ph name="DOMAIN">$1<ex>google.com</ex></ph> requires a username and password.
</message>
<message name="IDS_LOGIN_DIALOG_NOT_PRIVATE" desc="A phrase displayed on login dialogs if the connection to the current website is not private.">
Your connection to this site is not private
</message>
<message name="IDS_LOGIN_DIALOG_USERNAME_FIELD" desc="The label of the username field in the login prompt dialog" formatter_data="android_java">
User Name:
Username
</message>
<message name="IDS_LOGIN_DIALOG_PASSWORD_FIELD" desc="The label of the password field in the login prompt dialog" formatter_data="android_java">
Password:
</message>
<message name="IDS_LOGIN_DIALOG_OK_BUTTON_LABEL" desc="The label of the 'Log In' button on the login prompt dialog" formatter_data="android_java">
Log In
Password
</message>
</grit-part>
......@@ -8,7 +8,7 @@
<message name="IDS_PAGE_INFO_MIXED_CONTENT_SUMMARY" desc="A one-line summary at the top of the Page Info bubble (which shows when you click the security indicator) if the connection to the current website is using mainly using a secure connection but has some insecure parts (like insecurely loaded images).">
Your connection to this site is not fully secure
</message>
<message name="IDS_PAGE_INFO_NOT_SECURE_SUMMARY" desc="A one-line summary at the top of the Page Info bubble (which shows when you click the security indicator) if the connection to the current website is secure.">
<message name="IDS_PAGE_INFO_NOT_SECURE_SUMMARY" desc="A one-line summary at the top of the Page Info bubble (which shows when you click the security indicator) if the connection to the current website is not secure.">
Your connection to this site is not secure
</message>
<message name="IDS_PAGE_INFO_MALWARE_SUMMARY" desc="A one-line summary at the top of the Page Info bubble (which shows when you click the security indicator) if the current website has been flagged as containing malware.">
......
......@@ -220,6 +220,10 @@ void MdTextButton::UpdatePadding() {
label()->font_list().GetFontSize() -
style::GetFont(style::CONTEXT_BUTTON_MD, style::STYLE_PRIMARY)
.GetFontSize();
// TODO(tapted): This should get |target_height| using LayoutProvider::
// GetControlHeightForFont(). It can't because that only returns a correct
// result with --secondary-ui-md, and MdTextButtons appear in top chrome
// without that.
const int kBaseHeight = 28;
int target_height = std::max(kBaseHeight + size_delta * 2,
label()->font_list().GetFontSize() * 2);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment