Index: chrome/browser/ui/views/bubble/bubble.cc |
=================================================================== |
--- chrome/browser/ui/views/bubble/bubble.cc (revision 99456) |
+++ chrome/browser/ui/views/bubble/bubble.cc (working copy) |
@@ -21,7 +21,7 @@ |
#include "third_party/cros_system_api/window_manager/chromeos_wm_ipc_enums.h" |
#endif |
-#if defined(OS_WIN) |
+#if defined(OS_WIN) && !defined(USE_AURA) |
#include "chrome/browser/ui/views/bubble/border_widget_win.h" |
#endif |
@@ -31,7 +31,7 @@ |
static const int kHideFadeDurationMS = 200; |
// Background color of the bubble. |
-#if defined(OS_WIN) |
+#if defined(OS_WIN) && !defined(USE_AURA) |
const SkColor Bubble::kBackgroundColor = |
color_utils::GetSysSkColor(COLOR_WINDOW); |
#else |
@@ -97,7 +97,7 @@ |
// When fading out we just need to close the bubble at the end |
DoClose(false); |
} else { |
-#if defined(OS_WIN) |
+#if defined(OS_WIN) && !defined(USE_AURA) |
// When fading in we need to remove the layered window style flag, since |
// that style prevents some bubble content from working properly. |
SetWindowLong(GWL_EXSTYLE, GetWindowLong(GWL_EXSTYLE) & ~WS_EX_LAYERED); |
@@ -109,7 +109,8 @@ |
// Set the opacity for the main contents window. |
unsigned char opacity = static_cast<unsigned char>( |
animation_->GetCurrentValue() * 255); |
-#if defined(OS_WIN) |
+#if defined(USE_AURA) |
+#elif defined(OS_WIN) |
sky
2011/09/06 17:22:48
NOTIMPLEMENTED?
|
SetLayeredWindowAttributes(GetNativeView(), 0, |
static_cast<byte>(opacity), LWA_ALPHA); |
contents_->SchedulePaint(); |
@@ -125,12 +126,15 @@ |
Bubble::Bubble() |
: |
-#if defined(OS_WIN) |
+#if defined(USE_AURA) |
+ views::NativeWidgetAura(new views::Widget), |
+#elif defined(OS_WIN) |
views::NativeWidgetWin(new views::Widget), |
#elif defined(TOOLKIT_USES_GTK) |
views::NativeWidgetGtk(new views::Widget), |
#endif |
-#if defined(TOOLKIT_USES_GTK) |
+#if defined(USE_AURA) |
+#elif defined(TOOLKIT_USES_GTK) |
border_contents_(NULL), |
#elif defined(OS_WIN) |
border_(NULL), |
@@ -179,7 +183,10 @@ |
const bool fade_in = delegate_ && delegate_->FadeInOnShow(); |
// Create the main window. |
-#if defined(OS_WIN) |
+#if defined(USE_AURA) |
+ // TODO(beng): |
+ NOTIMPLEMENTED(); |
+#elif defined(OS_WIN) |
views::Widget* parent_window = parent->GetTopLevelWidget(); |
if (parent_window) |
parent_window->DisableInactiveRendering(); |
@@ -244,7 +251,10 @@ |
// Calculate and set the bounds for all windows and views. |
gfx::Rect window_bounds; |
-#if defined(OS_WIN) |
+#if defined(USE_AURA) |
+ // TODO(beng): |
+ NOTIMPLEMENTED(); |
+#elif defined(OS_WIN) |
// Initialize and position the border window. |
window_bounds = border_->SizeAndGetBounds(position_relative_to, |
arrow_location, |
@@ -277,7 +287,10 @@ |
GetWidget()->SetBounds(window_bounds); |
// Show the window. |
-#if defined(OS_WIN) |
+#if defined(USE_AURA) |
+ // TODO(beng): |
+ NOTIMPLEMENTED(); |
+#elif defined(OS_WIN) |
border_->ShowWindow(SW_SHOW); |
ShowWindow(SW_SHOW); |
#elif defined(TOOLKIT_USES_GTK) |
@@ -308,7 +321,10 @@ |
void Bubble::SizeToContents() { |
gfx::Rect window_bounds; |
-#if defined(OS_WIN) |
+#if defined(USE_AURA) |
+ // TODO(beng): |
+ NOTIMPLEMENTED(); |
+#elif defined(OS_WIN) |
// Initialize and position the border window. |
window_bounds = border_->SizeAndGetBounds(position_relative_to_, |
arrow_location_, |
@@ -327,7 +343,9 @@ |
GetWidget()->SetBounds(window_bounds); |
} |
-#if defined(OS_WIN) |
+#if defined(USE_AURA) |
+// TODO(beng): |
+#elif defined(OS_WIN) |
void Bubble::OnActivate(UINT action, BOOL minimized, HWND window) { |
// The popup should close when it is deactivated. |
if (action == WA_INACTIVE) { |
@@ -353,10 +371,16 @@ |
if (delegate_) |
delegate_->BubbleClosing(this, closed_by_escape); |
show_status_ = kClosed; |
-#if defined(OS_WIN) |
+#if defined(USE_AURA) |
+ // TODO(beng): |
+ NOTIMPLEMENTED(); |
+#elif defined(OS_WIN) |
border_->Close(); |
#endif |
-#if defined(OS_WIN) |
+#if defined(USE_AURA) |
+ // TODO(beng): |
+ NOTIMPLEMENTED(); |
+#elif defined(OS_WIN) |
NativeWidgetWin::Close(); |
#elif defined(TOOLKIT_USES_GTK) |
NativeWidgetGtk::Close(); |
@@ -368,7 +392,7 @@ |
} |
void Bubble::FadeOut() { |
-#if defined(OS_WIN) |
+#if defined(OS_WIN) && !defined(USE_AURA) |
// The contents window cannot have the layered flag on by default, since its |
// content doesn't always work inside a layered window, but when animating it |
// is ok to set that style on the window for the purpose of fading it out. |