Chromium Code Reviews| Index: chrome/browser/chromeos/login/helper.h |
| diff --git a/chrome/browser/chromeos/login/helper.h b/chrome/browser/chromeos/login/helper.h |
| index 0ecfe4f94618dca3df2baf629b3b32a794d9474f..e56228a8d0d0b26eb22176cc89ba1fa382f13dcd 100644 |
| --- a/chrome/browser/chromeos/login/helper.h |
| +++ b/chrome/browser/chromeos/login/helper.h |
| @@ -8,8 +8,9 @@ |
| #define CHROME_BROWSER_CHROMEOS_LOGIN_HELPER_H_ |
| #pragma once |
| -#include "views/controls/button/native_button.h" |
| #include "third_party/skia/include/core/SkColor.h" |
| +#include "views/controls/button/native_button.h" |
| +#include "views/widget/widget_gtk.h" |
| class GURL; |
| @@ -24,10 +25,44 @@ class MenuButton; |
| class Painter; |
| class Textfield; |
| class Throbber; |
| +class Widget; |
| } // namespace views |
| namespace chromeos { |
| +// Class that provides interface for start/stop throbber above the view. |
| +class ThrobberHost { |
|
whywhat
2010/12/13 16:10:55
It'd be better if we could embed ThrobberHost into
altimofeev
2010/12/14 11:15:21
Subclassed from the views::View to avoid multiple
|
| + public: |
| + explicit ThrobberHost(views::View* host_view); |
| + virtual ~ThrobberHost(); |
| + |
| + // Creates throbber above the view in the right side with the default |
| + // margin. Also places throbber in the middle of the vertical host size. |
| + // Override |CalculateThrobberBounds| method to change the throbber placing. |
| + virtual void StartThrobber(); |
| + |
| + // Stops the throbber. |
| + virtual void StopThrobber(); |
| + |
| + protected: |
| + // Calculates the bounds of the throbber relatively to the host view. |
| + // Default position is vertically centered right side of the host view. |
| + virtual gfx::Rect CalculateThrobberBounds(views::Throbber* throbber); |
| + |
| + void set_host_view(views::View* host_view) { |
| + host_view_ = host_view; |
| + } |
| + |
| + private: |
| + // View to show the throbber above. |
| + views::View* host_view_; |
| + |
| + // Popup that contains the throbber. |
| + views::Widget *throbber_widget_; |
|
whywhat
2010/12/13 16:10:55
Align * with the type, please.
altimofeev
2010/12/14 11:15:21
Done.
|
| + |
| + DISALLOW_COPY_AND_ASSIGN(ThrobberHost); |
| +}; |
| + |
| // Creates default smoothed throbber for time consuming operations on login. |
| views::Throbber* CreateDefaultSmoothedThrobber(); |
| @@ -81,6 +116,8 @@ const SkColor kTextColor = SK_ColorWHITE; |
| // Default link color on login/OOBE controls. |
| const SkColor kLinkColor = 0xFF0066CC; |
| +const int kThrobberRightMargin = 10; |
|
whywhat
2010/12/13 16:10:55
Comment about the constant?
altimofeev
2010/12/14 11:15:21
Done.
|
| + |
| // Default size of the OOBE screen. Includes 10px shadow from each side. |
| // See rounded_rect_painter.cc for border definitions. |
| const int kWizardScreenWidth = 800; |