OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/chromeos/login/helper.h" | 5 #include "chrome/browser/chromeos/login/helper.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "chrome/browser/chromeos/cros/network_library.h" | 8 #include "chrome/browser/chromeos/cros/network_library.h" |
9 #include "chrome/browser/google/google_util.h" | 9 #include "chrome/browser/google/google_util.h" |
10 #include "googleurl/src/gurl.h" | 10 #include "googleurl/src/gurl.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 ThrobberHostView::ThrobberHostView() | 74 ThrobberHostView::ThrobberHostView() |
75 : host_view_(this), | 75 : host_view_(this), |
76 throbber_widget_(NULL) { | 76 throbber_widget_(NULL) { |
77 } | 77 } |
78 | 78 |
79 ThrobberHostView::~ThrobberHostView() { | 79 ThrobberHostView::~ThrobberHostView() { |
80 StopThrobber(); | 80 StopThrobber(); |
81 } | 81 } |
82 | 82 |
83 void ThrobberHostView::StartThrobber() { | 83 void ThrobberHostView::StartThrobber() { |
84 #if defined(USE_AURA) | |
85 // TODO(saintlou): Is this still in use with the new WebUI anyway? | |
86 #else | |
87 StopThrobber(); | 84 StopThrobber(); |
88 | 85 |
89 views::Widget* host_widget = host_view_->GetWidget(); | 86 views::Widget* host_widget = host_view_->GetWidget(); |
90 if (!host_widget) { | 87 if (!host_widget) { |
91 LOG(WARNING) << "Failed to start the throbber: no Widget"; | 88 LOG(WARNING) << "Failed to start the throbber: no Widget"; |
92 return; | 89 return; |
93 } | 90 } |
94 | 91 |
95 GtkWidget* host_gtk_window = host_widget->GetNativeView(); | 92 GtkWidget* host_gtk_window = host_widget->GetNativeView(); |
96 while (host_gtk_window && !GTK_IS_WINDOW(host_gtk_window)) | 93 while (host_gtk_window && !GTK_IS_WINDOW(host_gtk_window)) |
(...skipping 16 matching lines...) Expand all Loading... |
113 params.parent = host_gtk_window; | 110 params.parent = host_gtk_window; |
114 throbber_widget_->Init(params); | 111 throbber_widget_->Init(params); |
115 throbber_widget_->SetContentsView(throbber); | 112 throbber_widget_->SetContentsView(throbber); |
116 // This keeps the window from flashing at startup. | 113 // This keeps the window from flashing at startup. |
117 gdk_window_set_back_pixmap( | 114 gdk_window_set_back_pixmap( |
118 throbber_widget_->GetNativeView()->window, NULL, false); | 115 throbber_widget_->GetNativeView()->window, NULL, false); |
119 throbber_widget_->Show(); | 116 throbber_widget_->Show(); |
120 // WM can ignore bounds before widget is shown. | 117 // WM can ignore bounds before widget is shown. |
121 throbber_widget_->SetBounds(throbber_bounds); | 118 throbber_widget_->SetBounds(throbber_bounds); |
122 throbber->Start(); | 119 throbber->Start(); |
123 #endif | |
124 } | 120 } |
125 | 121 |
126 void ThrobberHostView::StopThrobber() { | 122 void ThrobberHostView::StopThrobber() { |
127 if (throbber_widget_) { | 123 if (throbber_widget_) { |
128 throbber_widget_->Close(); | 124 throbber_widget_->Close(); |
129 throbber_widget_ = NULL; | 125 throbber_widget_ = NULL; |
130 } | 126 } |
131 } | 127 } |
132 | 128 |
133 gfx::Rect ThrobberHostView::CalculateThrobberBounds(views::Throbber* throbber) { | 129 gfx::Rect ThrobberHostView::CalculateThrobberBounds(views::Throbber* throbber) { |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 gfx::Size preferred_size = NativeTextButton::GetPreferredSize(); | 221 gfx::Size preferred_size = NativeTextButton::GetPreferredSize(); |
226 // Set minimal width. | 222 // Set minimal width. |
227 if (preferred_size.width() < kButtonMinWidth) | 223 if (preferred_size.width() < kButtonMinWidth) |
228 preferred_size.set_width(kButtonMinWidth); | 224 preferred_size.set_width(kButtonMinWidth); |
229 return preferred_size; | 225 return preferred_size; |
230 } | 226 } |
231 | 227 |
232 } // namespace login | 228 } // namespace login |
233 | 229 |
234 } // namespace chromeos | 230 } // namespace chromeos |
OLD | NEW |