OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/views/tab_contents/native_tab_contents_view_gtk.h" | 5 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/tab_contents/web_drag_bookmark_handler_gtk.h" | 8 #include "chrome/browser/tab_contents/web_drag_bookmark_handler_gtk.h" |
9 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" | 9 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" |
10 #include "chrome/browser/ui/sad_tab_helper.h" | 10 #include "chrome/browser/ui/sad_tab_helper.h" |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 | 278 |
279 GtkRequisition requisition; | 279 GtkRequisition requisition; |
280 gtk_widget_size_request(widget, &requisition); | 280 gtk_widget_size_request(widget, &requisition); |
281 | 281 |
282 int child_x = std::max(half_view_width - (requisition.width / 2), 0); | 282 int child_x = std::max(half_view_width - (requisition.width / 2), 0); |
283 int child_y = 0; | 283 int child_y = 0; |
284 | 284 |
285 #if defined(OS_CHROMEOS) | 285 #if defined(OS_CHROMEOS) |
286 // TODO(ivankr): this is a hack to display proxy authentication dialog | 286 // TODO(ivankr): this is a hack to display proxy authentication dialog |
287 // centered during the sign-in phase. See http://crosbug/20819. | 287 // centered during the sign-in phase. See http://crosbug/20819. |
288 if (!chromeos::UserManager::Get()->user_is_logged_in()) | 288 if (!chromeos::UserManager::Get()->IsUserLoggedIn()) |
289 child_y = std::max(view_size.height() / 2 - (requisition.height / 2), 0); | 289 child_y = std::max(view_size.height() / 2 - (requisition.height / 2), 0); |
290 #endif | 290 #endif |
291 PositionChild(widget, child_x, child_y, 0, 0); | 291 PositionChild(widget, child_x, child_y, 0, 0); |
292 } | 292 } |
293 } | 293 } |
294 | 294 |
295 //////////////////////////////////////////////////////////////////////////////// | 295 //////////////////////////////////////////////////////////////////////////////// |
296 // NativeTabContentsView, public: | 296 // NativeTabContentsView, public: |
297 | 297 |
298 // static | 298 // static |
299 NativeTabContentsView* NativeTabContentsView::CreateNativeTabContentsView( | 299 NativeTabContentsView* NativeTabContentsView::CreateNativeTabContentsView( |
300 internal::NativeTabContentsViewDelegate* delegate) { | 300 internal::NativeTabContentsViewDelegate* delegate) { |
301 return new NativeTabContentsViewGtk(delegate); | 301 return new NativeTabContentsViewGtk(delegate); |
302 } | 302 } |
OLD | NEW |