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_views.h" | 5 #include "chrome/browser/chromeos/frame/bubble_window_views.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 "ui/gfx/skia_utils_gtk.h" | 10 #include "ui/gfx/skia_utils_gtk.h" |
11 #include "views/widget/widget_delegate.h" | 11 #include "views/widget/widget_delegate.h" |
12 #include "views/window/non_client_view.h" | 12 #include "views/window/non_client_view.h" |
13 | 13 |
14 | 14 |
15 namespace chromeos { | 15 namespace chromeos { |
16 | 16 |
17 BubbleWindowViews::BubbleWindowViews(BubbleWindowStyle style) | 17 BubbleWindowViews::BubbleWindowViews(BubbleWindowStyle style) |
18 : style_(style) { | 18 : style_(style) { |
19 } | 19 } |
20 | 20 |
| 21 void BubbleWindowViews::SetBackgroundColor() { |
| 22 // TODO(saintlou): Once Views are truly pure the code below needs to be |
| 23 // removed and replaced by the corresponding Views code. |
| 24 GdkColor background_color = |
| 25 gfx::SkColorToGdkColor(kBubbleWindowBackgroundColor); |
| 26 gtk_widget_modify_bg(GetNativeView(), GTK_STATE_NORMAL, &background_color); |
| 27 } |
| 28 |
21 views::NonClientFrameView* BubbleWindowViews::CreateNonClientFrameView() { | 29 views::NonClientFrameView* BubbleWindowViews::CreateNonClientFrameView() { |
22 return new BubbleFrameView(this, widget_delegate(), style_); | 30 return new BubbleFrameView(this, widget_delegate(), style_); |
23 } | 31 } |
24 | 32 |
25 views::Widget* BubbleWindowViews::Create( | |
26 gfx::NativeWindow parent, | |
27 BubbleWindowStyle style, | |
28 views::WidgetDelegate* widget_delegate) { | |
29 BubbleWindowViews* window = new BubbleWindowViews(style); | |
30 views::Widget::InitParams params; | |
31 params.delegate = widget_delegate; | |
32 params.parent = GTK_WIDGET(parent); | |
33 params.bounds = gfx::Rect(); | |
34 params.transparent = true; | |
35 window->Init(params); | |
36 | |
37 // TODO(saintlou): After discussions with mazda we concluded that we could | |
38 // punt on an initial implementation of this style which is only used when | |
39 // displaying the keyboard overlay. Once we have implemented gradient and | |
40 // other missing features of Views we can address this. | |
41 if (style == STYLE_XSHAPE) | |
42 NOTIMPLEMENTED(); | |
43 | |
44 return window; | |
45 } | |
46 | |
47 } // namespace chromeos | 33 } // namespace chromeos |
OLD | NEW |