summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormsw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-21 20:53:45 +0000
committermsw@chromium.org <msw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-21 20:53:45 +0000
commit0a60e59a19c4b199b380e23dec7aa040c14f2d49 (patch)
tree00f13dab0518a7e50d7a8516a134b2cb31ca54f8
parent2d421b9289782facd4e1fa3cfdb797682448b4d0 (diff)
downloadchromium_src-0a60e59a19c4b199b380e23dec7aa040c14f2d49.zip
chromium_src-0a60e59a19c4b199b380e23dec7aa040c14f2d49.tar.gz
chromium_src-0a60e59a19c4b199b380e23dec7aa040c14f2d49.tar.bz2
Merge 115178 - Nix broken MessageBubble control_view.
Misc. refactoring network_menu_button.cc. I erroneously merged, reintroducing |control_view| in Patch Set 12 of: http://codereview.chromium.org/8557005 BUG=chromeos:24113 TEST=The 3G Mobile Data Promo bubble displays correctly. Review URL: http://codereview.chromium.org/9004004 TBR=msw@chromium.org Review URL: http://codereview.chromium.org/9017031 git-svn-id: svn://svn.chromium.org/chrome/branches/963/src@115395 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/chromeos/login/message_bubble.cc5
-rw-r--r--chrome/browser/chromeos/status/network_menu_button.cc17
2 files changed, 7 insertions, 15 deletions
diff --git a/chrome/browser/chromeos/login/message_bubble.cc b/chrome/browser/chromeos/login/message_bubble.cc
index 13c343f..b5a5c8f 100644
--- a/chrome/browser/chromeos/login/message_bubble.cc
+++ b/chrome/browser/chromeos/login/message_bubble.cc
@@ -48,9 +48,8 @@ MessageBubble::~MessageBubble() {
void MessageBubble::Init() {
using views::GridLayout;
- views::View* control_view = new views::View();
- GridLayout* layout = new GridLayout(control_view);
- control_view->SetLayoutManager(layout);
+ GridLayout* layout = new GridLayout(this);
+ SetLayoutManager(layout);
views::ColumnSet* column_set = layout->AddColumnSet(0);
column_set->AddColumn(GridLayout::LEADING, GridLayout::LEADING, 0,
GridLayout::USE_PREF, 0, 0);
diff --git a/chrome/browser/chromeos/status/network_menu_button.cc b/chrome/browser/chromeos/status/network_menu_button.cc
index def7c92..05c0872 100644
--- a/chrome/browser/chromeos/status/network_menu_button.cc
+++ b/chrome/browser/chromeos/status/network_menu_button.cc
@@ -369,7 +369,7 @@ void NetworkMenuButton::ShowOptionalMobileDataPromoNotification(
cros->cellular_connected() && !cros->ethernet_connected() &&
!cros->wifi_connected()) {
std::string deal_text;
- int carrier_deal_promo_pref = -1;
+ int carrier_deal_promo_pref = kNotificationCountPrefDefault;
const MobileConfig::CarrierDeal* deal = NULL;
const MobileConfig::Carrier* carrier = GetCarrier(cros);
if (carrier)
@@ -408,16 +408,9 @@ void NetworkMenuButton::ShowOptionalMobileDataPromoNotification(
return;
}
- // Add deal text if it's defined.
- string16 notification_text;
- string16 default_text =
- l10n_util::GetStringUTF16(IDS_3G_NOTIFICATION_MESSAGE);
- if (!deal_text.empty()) {
- notification_text =
- UTF8ToUTF16(deal_text) + UTF8ToUTF16("\n\n") + default_text;
- } else {
- notification_text = default_text;
- }
+ string16 message = l10n_util::GetStringUTF16(IDS_3G_NOTIFICATION_MESSAGE);
+ if (!deal_text.empty())
+ message = UTF8ToUTF16(deal_text + "\n\n") + message;
// Use deal URL if it's defined or general "Network Settings" URL.
int link_message_id;
@@ -434,7 +427,7 @@ void NetworkMenuButton::ShowOptionalMobileDataPromoNotification(
this,
views::BubbleBorder::TOP_RIGHT,
ResourceBundle::GetSharedInstance().GetBitmapNamed(IDR_NOTIFICATION_3G),
- notification_text,
+ message,
links);
mobile_data_bubble_->set_link_listener(this);
browser::CreateViewsBubbleAboveLockScreen(mobile_data_bubble_);