| 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/frame/bubble_window.h" | 5 #include "chrome/browser/chromeos/frame/bubble_window.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "chrome/browser/chromeos/frame/bubble_frame_view.h" | 9 #include "chrome/browser/chromeos/frame/bubble_frame_view.h" |
| 10 #include "chrome/browser/chromeos/frame/bubble_window_views.h" | 10 #include "chrome/browser/chromeos/frame/bubble_window_views.h" |
| 11 #include "ui/gfx/skia_utils_gtk.h" | 11 #include "ui/gfx/skia_utils_gtk.h" |
| 12 #include "views/window/non_client_view.h" | 12 #include "views/window/non_client_view.h" |
| 13 | 13 |
| 14 namespace chromeos { | 14 namespace chromeos { |
| 15 | 15 |
| 16 BubbleWindow::BubbleWindow(views::Widget* window, | 16 BubbleWindow::BubbleWindow(views::Widget* window, |
| 17 BubbleWindowStyle style) | 17 DialogStyle style) |
| 18 : views::NativeWidgetGtk(window), | 18 : views::NativeWidgetGtk(window), |
| 19 style_(style) { | 19 style_(style) { |
| 20 } | 20 } |
| 21 | 21 |
| 22 void BubbleWindow::InitNativeWidget(const views::Widget::InitParams& params) { | 22 void BubbleWindow::InitNativeWidget(const views::Widget::InitParams& params) { |
| 23 #if defined(USE_AURA) | 23 #if defined(USE_AURA) |
| 24 // TODO(saintlou): Switch to alicet@chromium.org PureView when landed | 24 // TODO(saintlou): Switch to alicet@chromium.org PureView when landed |
| 25 #else | 25 #else |
| 26 views::NativeWidgetGtk::InitNativeWidget(params); | 26 views::NativeWidgetGtk::InitNativeWidget(params); |
| 27 | 27 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 45 #endif | 45 #endif |
| 46 } | 46 } |
| 47 | 47 |
| 48 views::NonClientFrameView* BubbleWindow::CreateNonClientFrameView() { | 48 views::NonClientFrameView* BubbleWindow::CreateNonClientFrameView() { |
| 49 views::Widget* window = GetWidget(); | 49 views::Widget* window = GetWidget(); |
| 50 return new BubbleFrameView(window, window->widget_delegate(), style_); | 50 return new BubbleFrameView(window, window->widget_delegate(), style_); |
| 51 } | 51 } |
| 52 | 52 |
| 53 views::Widget* BubbleWindow::Create( | 53 views::Widget* BubbleWindow::Create( |
| 54 gfx::NativeWindow parent, | 54 gfx::NativeWindow parent, |
| 55 BubbleWindowStyle style, | 55 DialogStyle style, |
| 56 views::WidgetDelegate* widget_delegate) { | 56 views::WidgetDelegate* widget_delegate) { |
| 57 #if defined(USE_AURA) | 57 #if defined(USE_AURA) |
| 58 // TODO(saintlou): | 58 // TODO(saintlou): |
| 59 return NULL; | 59 return NULL; |
| 60 #else | 60 #else |
| 61 // TODO(saintlou): Ultimately we do not want 2 classes for BubbleWindows. | 61 // TODO(saintlou): Ultimately we do not want 2 classes for BubbleWindows. |
| 62 // Furthermore the 2 other styles (STYLE_XBAR & STYLE_THROBBER) are only used | 62 // Furthermore the 2 other styles (STYLE_XBAR & STYLE_THROBBER) are only used |
| 63 // in LoginHtmlDialog::Show() which will be deprecated soon. | 63 // in LoginHtmlDialog::Show() which will be deprecated soon. |
| 64 if (views::Widget::IsPureViews()) { | 64 if (views::Widget::IsPureViews()) { |
| 65 if ((style & STYLE_XBAR) || (style & STYLE_THROBBER)) | 65 if ((style & STYLE_XBAR) || (style & STYLE_THROBBER)) |
| (...skipping 15 matching lines...) Expand all Loading... |
| 81 params.native_widget = bubble_window; | 81 params.native_widget = bubble_window; |
| 82 params.parent = GTK_WIDGET(parent); | 82 params.parent = GTK_WIDGET(parent); |
| 83 params.bounds = gfx::Rect(); | 83 params.bounds = gfx::Rect(); |
| 84 window->Init(params); | 84 window->Init(params); |
| 85 | 85 |
| 86 return window; | 86 return window; |
| 87 #endif | 87 #endif |
| 88 } | 88 } |
| 89 | 89 |
| 90 } // namespace chromeos | 90 } // namespace chromeos |
| OLD | NEW |