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

Side by Side Diff: chrome/browser/chromeos/login/helper.cc

Issue 6881107: Rework the way Widget::Init works: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/customization_document.h" 9 #include "chrome/browser/chromeos/customization_document.h"
10 #include "chrome/browser/chromeos/system_access.h" 10 #include "chrome/browser/chromeos/system_access.h"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 host_gtk_window = gtk_widget_get_parent(host_gtk_window); 102 host_gtk_window = gtk_widget_get_parent(host_gtk_window);
103 if (!host_gtk_window) { 103 if (!host_gtk_window) {
104 LOG(WARNING) << "Failed to start the throbber: no GtkWindow"; 104 LOG(WARNING) << "Failed to start the throbber: no GtkWindow";
105 return; 105 return;
106 } 106 }
107 107
108 views::SmoothedThrobber* throbber = CreateDefaultSmoothedThrobber(); 108 views::SmoothedThrobber* throbber = CreateDefaultSmoothedThrobber();
109 throbber->set_stop_delay_ms(0); 109 throbber->set_stop_delay_ms(0);
110 gfx::Rect throbber_bounds = CalculateThrobberBounds(throbber); 110 gfx::Rect throbber_bounds = CalculateThrobberBounds(throbber);
111 111
112 throbber_widget_ = views::Widget::CreateWidget();
113 static_cast<views::WidgetGtk*>(throbber_widget_->native_widget())->
114 make_transient_to_parent();
115
116 throbber_bounds.Offset(host_view_->GetScreenBounds().origin());
112 views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_WINDOW); 117 views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_WINDOW);
113 params.transparent = true; 118 params.transparent = true;
114 throbber_widget_ = views::Widget::CreateWidget(params); 119 params.bounds = throbber_bounds;
115 static_cast<views::WidgetGtk*>(throbber_widget_)->make_transient_to_parent(); 120 params.parent = host_gtk_window;
116 121 throbber_widget_->Init(params);
117 throbber_bounds.Offset(host_view_->GetScreenBounds().origin());
118 throbber_widget_->Init(host_gtk_window, throbber_bounds);
119 throbber_widget_->SetContentsView(throbber); 122 throbber_widget_->SetContentsView(throbber);
120 // This keeps the window from flashing at startup. 123 // This keeps the window from flashing at startup.
121 gdk_window_set_back_pixmap( 124 gdk_window_set_back_pixmap(
122 throbber_widget_->GetNativeView()->window, NULL, false); 125 throbber_widget_->GetNativeView()->window, NULL, false);
123 throbber_widget_->Show(); 126 throbber_widget_->Show();
124 // WM can ignore bounds before widget is shown. 127 // WM can ignore bounds before widget is shown.
125 throbber_widget_->SetBounds(throbber_bounds); 128 throbber_widget_->SetBounds(throbber_bounds);
126 throbber->Start(); 129 throbber->Start();
127 } 130 }
128 131
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 gfx::Size preferred_size = NativeButton::GetPreferredSize(); 253 gfx::Size preferred_size = NativeButton::GetPreferredSize();
251 // Set minimal width. 254 // Set minimal width.
252 if (preferred_size.width() < kButtonMinWidth) 255 if (preferred_size.width() < kButtonMinWidth)
253 preferred_size.set_width(kButtonMinWidth); 256 preferred_size.set_width(kButtonMinWidth);
254 return preferred_size; 257 return preferred_size;
255 } 258 }
256 259
257 } // namespace login 260 } // namespace login
258 261
259 } // namespace chromeos 262 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/background_view.cc ('k') | chrome/browser/chromeos/login/message_bubble.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698