summaryrefslogtreecommitdiffstats
path: root/chromium/ui/message_center/views/notifier_settings_view.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/ui/message_center/views/notifier_settings_view.cc')
-rw-r--r--chromium/ui/message_center/views/notifier_settings_view.cc66
1 files changed, 33 insertions, 33 deletions
diff --git a/chromium/ui/message_center/views/notifier_settings_view.cc b/chromium/ui/message_center/views/notifier_settings_view.cc
index e345d93e501..a282ccbe04a 100644
--- a/chromium/ui/message_center/views/notifier_settings_view.cc
+++ b/chromium/ui/message_center/views/notifier_settings_view.cc
@@ -28,6 +28,7 @@
#include "ui/views/controls/button/custom_button.h"
#include "ui/views/controls/button/label_button_border.h"
#include "ui/views/controls/button/menu_button.h"
+#include "ui/views/controls/button/text_button.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/controls/label.h"
#include "ui/views/controls/link.h"
@@ -41,10 +42,6 @@
#include "ui/views/painter.h"
#include "ui/views/widget/widget.h"
-#if defined(USE_AURA)
-#include "ui/aura/window.h"
-#endif
-
namespace message_center {
namespace settings {
@@ -141,8 +138,8 @@ class EntryView : public views::View {
// views::View:
virtual void Layout() OVERRIDE;
- virtual gfx::Size GetPreferredSize() OVERRIDE;
- virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
+ virtual gfx::Size GetPreferredSize() const OVERRIDE;
+ virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
virtual void OnFocus() OVERRIDE;
virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
virtual bool OnKeyReleased(const ui::KeyEvent& event) OVERRIDE;
@@ -171,14 +168,14 @@ void EntryView::Layout() {
content->SetBounds(0, y, content_width, content_height);
}
-gfx::Size EntryView::GetPreferredSize() {
+gfx::Size EntryView::GetPreferredSize() const {
DCHECK_EQ(1, child_count());
gfx::Size size = child_at(0)->GetPreferredSize();
size.SetToMax(gfx::Size(settings::kWidth, settings::kEntryHeight));
return size;
}
-void EntryView::GetAccessibleState(ui::AccessibleViewState* state) {
+void EntryView::GetAccessibleState(ui::AXViewState* state) {
DCHECK_EQ(1, child_count());
child_at(0)->GetAccessibleState(state);
}
@@ -295,7 +292,7 @@ NotifierSettingsView::NotifierButton::NotifierButton(
notifier_(notifier),
icon_view_(new views::ImageView()),
name_view_(new views::Label(notifier_->name)),
- checkbox_(new views::Checkbox(string16())),
+ checkbox_(new views::Checkbox(base::string16())),
learn_more_(NULL) {
DCHECK(provider);
DCHECK(notifier);
@@ -333,7 +330,7 @@ NotifierSettingsView::NotifierButton::NotifierButton(
(settings::kLearnMoreTargetHeight - settings::kLearnMoreSize) / 2;
// The image itself is quite small, this large invisible border creates a
// much bigger click target.
- learn_more_->set_border(
+ learn_more_->SetBorder(
views::Border::CreateEmptyBorder(learn_more_border_height,
learn_more_border_width,
learn_more_border_height,
@@ -384,7 +381,8 @@ void NotifierSettingsView::NotifierButton::SendLearnMorePressedForTest() {
return;
gfx::Point point(110, 120);
ui::MouseEvent pressed(
- ui::ET_MOUSE_PRESSED, point, point, ui::EF_LEFT_MOUSE_BUTTON);
+ ui::ET_MOUSE_PRESSED, point, point, ui::EF_LEFT_MOUSE_BUTTON,
+ ui::EF_LEFT_MOUSE_BUTTON);
ButtonPressed(learn_more_, pressed);
}
@@ -405,7 +403,7 @@ void NotifierSettingsView::NotifierButton::ButtonPressed(
}
void NotifierSettingsView::NotifierButton::GetAccessibleState(
- ui::AccessibleViewState* state) {
+ ui::AXViewState* state) {
static_cast<views::View*>(checkbox_)->GetAccessibleState(state);
}
@@ -486,17 +484,15 @@ NotifierSettingsView::NotifierSettingsView(NotifierSettingsProvider* provider)
SetFocusable(true);
set_background(
views::Background::CreateSolidBackground(kMessageCenterBackgroundColor));
- if (get_use_acceleration_when_possible())
- SetPaintToLayer(true);
+ SetPaintToLayer(true);
- gfx::Font title_font =
- ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::MediumFont);
title_label_ = new views::Label(
l10n_util::GetStringUTF16(IDS_MESSAGE_CENTER_SETTINGS_BUTTON_LABEL),
- title_font);
+ ui::ResourceBundle::GetSharedInstance().GetFontList(
+ ui::ResourceBundle::MediumFont));
title_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT);
title_label_->SetMultiLine(true);
- title_label_->set_border(
+ title_label_->SetBorder(
views::Border::CreateEmptyBorder(kComputedTitleTopMargin,
settings::kTitleMargin,
kComputedTitleBottomMargin,
@@ -545,6 +541,9 @@ void NotifierSettingsView::NotifierGroupChanged() {
UpdateContentsView(notifiers);
}
+void NotifierSettingsView::NotifierEnabledChanged(const NotifierId& notifier_id,
+ bool enabled) {}
+
void NotifierSettingsView::UpdateContentsView(
const std::vector<Notifier*>& notifiers) {
buttons_.clear();
@@ -571,7 +570,7 @@ void NotifierSettingsView::UpdateContentsView(
top_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
top_label->SetMultiLine(true);
- top_label->set_border(views::Border::CreateEmptyBorder(
+ top_label->SetBorder(views::Border::CreateEmptyBorder(
0,
settings::kTitleMargin + kMenuButtonInnateMargin,
0,
@@ -580,7 +579,7 @@ void NotifierSettingsView::UpdateContentsView(
if (need_account_switcher) {
const NotifierGroup& active_group = provider_->GetActiveNotifierGroup();
- string16 notifier_group_text = active_group.login_info.empty() ?
+ base::string16 notifier_group_text = active_group.login_info.empty() ?
active_group.name : active_group.login_info;
notifier_group_selector_ =
new views::MenuButton(NULL, notifier_group_text, this, true);
@@ -598,7 +597,8 @@ void NotifierSettingsView::UpdateContentsView(
selector_border->SetInsets(gfx::Insets(
kMenuButtonVerticalPadding, kMenuButtonLeftPadding,
kMenuButtonVerticalPadding, kMenuButtonRightPadding));
- notifier_group_selector_->set_border(selector_border.release());
+ notifier_group_selector_->SetBorder(
+ selector_border.PassAs<views::Border>());
notifier_group_selector_->SetFocusPainter(scoped_ptr<views::Painter>());
notifier_group_selector_->set_animate_on_state_change(false);
notifier_group_selector_->SetFocusable(true);
@@ -616,17 +616,17 @@ void NotifierSettingsView::UpdateContentsView(
// border on the last notifier, as the spec leaves a space for it.
scoped_ptr<views::Border> entry_border;
if (i == notifier_count - 1) {
- entry_border.reset(views::Border::CreateEmptyBorder(
- 0, 0, settings::kEntrySeparatorHeight, 0));
+ entry_border = views::Border::CreateEmptyBorder(
+ 0, 0, settings::kEntrySeparatorHeight, 0);
} else {
- entry_border.reset(views::Border::CreateSolidSidedBorder(
- 0,
- 0,
- settings::kEntrySeparatorHeight,
- 0,
- settings::kEntrySeparatorColor));
+ entry_border =
+ views::Border::CreateSolidSidedBorder(0,
+ 0,
+ settings::kEntrySeparatorHeight,
+ 0,
+ settings::kEntrySeparatorColor);
}
- entry->set_border(entry_border.release());
+ entry->SetBorder(entry_border.Pass());
entry->SetFocusable(true);
contents_view->AddChildView(entry);
buttons_.insert(button);
@@ -656,7 +656,7 @@ void NotifierSettingsView::Layout() {
scroller_->SetBounds(0, title_height, width(), height() - title_height);
}
-gfx::Size NotifierSettingsView::GetMinimumSize() {
+gfx::Size NotifierSettingsView::GetMinimumSize() const {
gfx::Size size(settings::kWidth, settings::kMinimumHeight);
int total_height = title_label_->GetPreferredSize().height() +
scroller_->contents()->GetPreferredSize().height();
@@ -665,7 +665,7 @@ gfx::Size NotifierSettingsView::GetMinimumSize() {
return size;
}
-gfx::Size NotifierSettingsView::GetPreferredSize() {
+gfx::Size NotifierSettingsView::GetPreferredSize() const {
gfx::Size preferred_size;
gfx::Size title_size = title_label_->GetPreferredSize();
gfx::Size content_size = scroller_->contents()->GetPreferredSize();
@@ -717,7 +717,7 @@ void NotifierSettingsView::OnMenuButtonClicked(views::View* source,
notifier_group_menu_runner_->RunMenuAt(GetWidget(),
notifier_group_selector_,
menu_anchor,
- views::MenuItemView::BUBBLE_ABOVE,
+ views::MENU_ANCHOR_BUBBLE_ABOVE,
ui::MENU_SOURCE_MOUSE,
views::MenuRunner::CONTEXT_MENU))
return;