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

Unified Diff: ui/views/examples/throbber_example.cc

Issue 2343603003: [Chrome OS MD] Implement accessibility detailed view for the MD Ash system menu (Closed)
Patch Set: address comments Created 4 years, 3 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: ui/views/examples/throbber_example.cc
diff --git a/ui/views/examples/throbber_example.cc b/ui/views/examples/throbber_example.cc
index 5a1981219c1403c449b40365149ab680ebf0d232..b95c7cb68e6c8d38927cffb352dbf30eb651df02 100644
--- a/ui/views/examples/throbber_example.cc
+++ b/ui/views/examples/throbber_example.cc
@@ -16,25 +16,41 @@ namespace {
class ThrobberView : public View {
public:
- ThrobberView() : throbber_(new Throbber()) {
+ ThrobberView() : throbber_(new Throbber()), is_checked_(false) {
AddChildView(throbber_);
throbber_->Start();
}
+ // View::
gfx::Size GetPreferredSize() const override {
return gfx::Size(width(), height());
}
void Layout() override {
- int diameter = 64;
+ int diameter = 16;
throbber_->SetBounds((width() - diameter) / 2,
(height() - diameter) / 2,
diameter, diameter);
SizeToPreferredSize();
}
+ bool OnMousePressed(const ui::MouseEvent& event) override {
+ if (GetEventHandlerForPoint(event.location()) == throbber_) {
+
+ if (is_checked_)
+ throbber_->Start();
+ else
+ throbber_->Stop();
+ throbber_->SetChecked(!is_checked_);
+ is_checked_ = !is_checked_;
+ return true;
+ }
+ return false;
+ }
+
private:
Throbber* throbber_;
+ bool is_checked_;
DISALLOW_COPY_AND_ASSIGN(ThrobberView);
};
« ash/common/system/tray_accessibility.cc ('K') | « ui/gfx/vector_icons/check_circle.1x.icon ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698