| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/system/user/user_view.h" | 5 #include "ash/system/user/user_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/multi_profile_uma.h" | 9 #include "ash/multi_profile_uma.h" |
| 10 #include "ash/popup_message.h" | 10 #include "ash/popup_message.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 LogoutButton(views::ButtonListener* listener, | 88 LogoutButton(views::ButtonListener* listener, |
| 89 const base::string16& text, | 89 const base::string16& text, |
| 90 bool placeholder) | 90 bool placeholder) |
| 91 : TrayPopupLabelButton(listener, text), placeholder_(placeholder) { | 91 : TrayPopupLabelButton(listener, text), placeholder_(placeholder) { |
| 92 SetEnabled(!placeholder_); | 92 SetEnabled(!placeholder_); |
| 93 } | 93 } |
| 94 | 94 |
| 95 virtual ~LogoutButton() {} | 95 virtual ~LogoutButton() {} |
| 96 | 96 |
| 97 private: | 97 private: |
| 98 virtual void Paint(gfx::Canvas* canvas) OVERRIDE { | 98 virtual void Paint(gfx::Canvas* canvas, |
| 99 const views::CullSet& cull_set) OVERRIDE { |
| 99 // Just skip paint if this button used as a placeholder. | 100 // Just skip paint if this button used as a placeholder. |
| 100 if (!placeholder_) | 101 if (!placeholder_) |
| 101 TrayPopupLabelButton::Paint(canvas); | 102 TrayPopupLabelButton::Paint(canvas, cull_set); |
| 102 } | 103 } |
| 103 | 104 |
| 104 bool placeholder_; | 105 bool placeholder_; |
| 105 DISALLOW_COPY_AND_ASSIGN(LogoutButton); | 106 DISALLOW_COPY_AND_ASSIGN(LogoutButton); |
| 106 }; | 107 }; |
| 107 | 108 |
| 108 class UserViewMouseWatcherHost : public views::MouseWatcherHost { | 109 class UserViewMouseWatcherHost : public views::MouseWatcherHost { |
| 109 public: | 110 public: |
| 110 explicit UserViewMouseWatcherHost(const gfx::Rect& screen_area) | 111 explicit UserViewMouseWatcherHost(const gfx::Rect& screen_area) |
| 111 : screen_area_(screen_area) {} | 112 : screen_area_(screen_area) {} |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 482 // watcher which will close the "menu". | 483 // watcher which will close the "menu". |
| 483 gfx::Rect area = user_card_view_->GetBoundsInScreen(); | 484 gfx::Rect area = user_card_view_->GetBoundsInScreen(); |
| 484 area.set_height(2 * area.height()); | 485 area.set_height(2 * area.height()); |
| 485 mouse_watcher_.reset( | 486 mouse_watcher_.reset( |
| 486 new views::MouseWatcher(new UserViewMouseWatcherHost(area), this)); | 487 new views::MouseWatcher(new UserViewMouseWatcherHost(area), this)); |
| 487 mouse_watcher_->Start(); | 488 mouse_watcher_->Start(); |
| 488 } | 489 } |
| 489 | 490 |
| 490 } // namespace tray | 491 } // namespace tray |
| 491 } // namespace ash | 492 } // namespace ash |
| OLD | NEW |