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

Unified Diff: chrome/browser/ui/views/bubble/bubble.cc

Issue 7834048: Preliminary work to allow Chrome to build with USE_AURA (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/bubble/bubble.h ('k') | chrome/browser/ui/views/collected_cookies_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/bubble/bubble.cc
===================================================================
--- chrome/browser/ui/views/bubble/bubble.cc (revision 99764)
+++ 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,10 @@
// 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)
+ // TODO(beng):
+ NOTIMPLEMENTED();
+#elif defined(OS_WIN)
SetLayeredWindowAttributes(GetNativeView(), 0,
static_cast<byte>(opacity), LWA_ALPHA);
contents_->SchedulePaint();
@@ -125,12 +128,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 +185,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 +253,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 +289,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 +323,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 +345,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 +373,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 +394,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.
@@ -376,6 +402,8 @@
// This must be the very next call, otherwise we can get flicker on close.
SetLayeredWindowAttributes(GetNativeView(), 0,
static_cast<byte>(255), LWA_ALPHA);
+#elif defined(USE_AURA)
+ NOTIMPLEMENTED();
#endif
Fade(false); // |fade_in|.
« no previous file with comments | « chrome/browser/ui/views/bubble/bubble.h ('k') | chrome/browser/ui/views/collected_cookies_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698