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/chromeos/system_access.h" | 9 #include "chrome/browser/chromeos/system_access.h" |
10 #include "chrome/browser/google/google_util.h" | 10 #include "chrome/browser/google/google_util.h" |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 while (host_gtk_window && !GTK_IS_WINDOW(host_gtk_window)) | 96 while (host_gtk_window && !GTK_IS_WINDOW(host_gtk_window)) |
97 host_gtk_window = gtk_widget_get_parent(host_gtk_window); | 97 host_gtk_window = gtk_widget_get_parent(host_gtk_window); |
98 if (!host_gtk_window) { | 98 if (!host_gtk_window) { |
99 LOG(WARNING) << "Failed to start the throbber: no GtkWindow"; | 99 LOG(WARNING) << "Failed to start the throbber: no GtkWindow"; |
100 return; | 100 return; |
101 } | 101 } |
102 | 102 |
103 views::SmoothedThrobber* throbber = CreateDefaultSmoothedThrobber(); | 103 views::SmoothedThrobber* throbber = CreateDefaultSmoothedThrobber(); |
104 throbber->set_stop_delay_ms(0); | 104 throbber->set_stop_delay_ms(0); |
105 gfx::Rect throbber_bounds = CalculateThrobberBounds(throbber); | 105 gfx::Rect throbber_bounds = CalculateThrobberBounds(throbber); |
| 106 throbber_bounds.Offset(host_view_->GetScreenBounds().origin()); |
106 | 107 |
107 throbber_widget_ = views::Widget::CreateWidget(); | 108 throbber_widget_ = new views::Widget; |
108 static_cast<views::WidgetGtk*>(throbber_widget_->native_widget())-> | |
109 make_transient_to_parent(); | |
110 | 109 |
111 throbber_bounds.Offset(host_view_->GetScreenBounds().origin()); | |
112 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); | 110 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); |
113 params.transparent = true; | 111 params.transparent = true; |
114 params.bounds = throbber_bounds; | 112 params.bounds = throbber_bounds; |
115 params.parent = host_gtk_window; | 113 params.parent = host_gtk_window; |
116 throbber_widget_->Init(params); | 114 throbber_widget_->Init(params); |
117 throbber_widget_->SetContentsView(throbber); | 115 throbber_widget_->SetContentsView(throbber); |
118 // This keeps the window from flashing at startup. | 116 // This keeps the window from flashing at startup. |
119 gdk_window_set_back_pixmap( | 117 gdk_window_set_back_pixmap( |
120 throbber_widget_->GetNativeView()->window, NULL, false); | 118 throbber_widget_->GetNativeView()->window, NULL, false); |
121 throbber_widget_->Show(); | 119 throbber_widget_->Show(); |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 gfx::Size preferred_size = NativeButton::GetPreferredSize(); | 224 gfx::Size preferred_size = NativeButton::GetPreferredSize(); |
227 // Set minimal width. | 225 // Set minimal width. |
228 if (preferred_size.width() < kButtonMinWidth) | 226 if (preferred_size.width() < kButtonMinWidth) |
229 preferred_size.set_width(kButtonMinWidth); | 227 preferred_size.set_width(kButtonMinWidth); |
230 return preferred_size; | 228 return preferred_size; |
231 } | 229 } |
232 | 230 |
233 } // namespace login | 231 } // namespace login |
234 | 232 |
235 } // namespace chromeos | 233 } // namespace chromeos |
OLD | NEW |