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

Unified Diff: chrome/browser/ui/desktop_ios_promotion/desktop_ios_promotion_util.cc

Issue 2815303004: Update the Windows iOS promotion to have the same width as the bubble that appears before it. (Closed)
Patch Set: Same width bubble Created 3 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/desktop_ios_promotion/desktop_ios_promotion_util.cc
diff --git a/chrome/browser/ui/desktop_ios_promotion/desktop_ios_promotion_util.cc b/chrome/browser/ui/desktop_ios_promotion/desktop_ios_promotion_util.cc
index b5ef1a0c292e45752a42359a14b206c33756dd66..f8e534cdc453d671b7caf3e351c32917d36a874d 100644
--- a/chrome/browser/ui/desktop_ios_promotion/desktop_ios_promotion_util.cc
+++ b/chrome/browser/ui/desktop_ios_promotion/desktop_ios_promotion_util.cc
@@ -16,6 +16,7 @@
#include "chrome/common/chrome_switches.h"
#include "chrome/grit/chromium_strings.h"
#include "chrome/grit/generated_resources.h"
+#include "chrome/grit/locale_settings.h"
#include "components/browser_sync/profile_sync_service.h"
#include "components/pref_registry/pref_registry_syncable.h"
#include "components/prefs/pref_registry_simple.h"
@@ -25,6 +26,7 @@
#include "ui/gfx/color_utils.h"
#include "ui/gfx/paint_vector_icon.h"
#include "ui/native_theme/native_theme.h"
+#include "ui/views/widget/widget.h"
sky 2017/04/17 17:21:55 Code in c/b/ui should not depend upon views. Code
mrefaat 2017/04/17 19:10:49 Done.
using i18n::phonenumbers::PhoneNumber;
using i18n::phonenumbers::PhoneNumberUtil;
@@ -146,6 +148,15 @@ base::string16 GetPromoText(
base::UTF8ToUTF16(phone_number));
}
+int GetPromoBubbleTextLabelWidth(PromotionEntryPoint entry_point) {
+ if (entry_point == PromotionEntryPoint::SAVE_PASSWORD_BUBBLE) {
+ return views::Widget::GetLocalizedContentsWidth(
+ IDS_DESKTOP_IOS_PROMOTION_SAVE_PASSWORDS_BUBBLE_TEXT_WIDTH_CHARS);
+ }
+ return views::Widget::GetLocalizedContentsWidth(
+ IDS_DESKTOP_IOS_PROMOTION_TEXT_WIDTH_CHARS);
+}
+
base::string16 GetPromoTitle(
desktop_ios_promotion::PromotionEntryPoint entry_point) {
int text_id_from_finch = base::GetFieldTrialParamByFeatureAsInt(

Powered by Google App Engine
This is Rietveld 408576698