summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-06 19:31:39 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-09-06 19:31:39 +0000
commit5e37c45f06e1a574b08588c6679c977eb4f8ee47 (patch)
treeb6e1d185cea139a1da2a07481047fb53457678b5 /chrome
parent2c09e75ecfaf7ee8ccea38a9ec3e78e7e8c3d045 (diff)
downloadchromium_src-5e37c45f06e1a574b08588c6679c977eb4f8ee47.zip
chromium_src-5e37c45f06e1a574b08588c6679c977eb4f8ee47.tar.gz
chromium_src-5e37c45f06e1a574b08588c6679c977eb4f8ee47.tar.bz2
Preliminary work to allow Chrome to build with USE_AURA.
This gets browser.lib to build. http://crbug.com/93947 TEST=none Review URL: http://codereview.chromium.org/7834048 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99787 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/automation/automation_provider.cc4
-rw-r--r--chrome/browser/automation/automation_provider.h10
-rw-r--r--chrome/browser/bookmarks/bookmark_drop_info.cc4
-rw-r--r--chrome/browser/download/download_util.cc14
-rw-r--r--chrome/browser/plugin_download_helper.cc4
-rw-r--r--chrome/browser/plugin_installer_infobar_delegate.cc7
-rw-r--r--chrome/browser/themes/theme_service.cc4
-rw-r--r--chrome/browser/ui/browser.cc2
-rw-r--r--chrome/browser/ui/input_window_dialog_win.cc6
-rw-r--r--chrome/browser/ui/panels/panel_browser_view.cc6
-rw-r--r--chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc10
-rw-r--r--chrome/browser/ui/views/avatar_menu_button.cc2
-rw-r--r--chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc5
-rw-r--r--chrome/browser/ui/views/browser_bubble.cc3
-rw-r--r--chrome/browser/ui/views/bubble/bubble.cc56
-rw-r--r--chrome/browser/ui/views/bubble/bubble.h21
-rw-r--r--chrome/browser/ui/views/collected_cookies_win.cc5
-rw-r--r--chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.cc20
-rw-r--r--chrome/browser/ui/views/constrained_window_views.cc16
-rw-r--r--chrome/browser/ui/views/extensions/extension_view.cc5
-rw-r--r--chrome/browser/ui/views/find_bar_host.cc2
-rw-r--r--chrome/browser/ui/views/frame/browser_frame.cc6
-rw-r--r--chrome/browser/ui/views/frame/browser_view.cc59
-rw-r--r--chrome/browser/ui/views/frame/browser_view.h2
-rw-r--r--chrome/browser/ui/views/infobars/infobar_view.cc2
-rw-r--r--chrome/browser/ui/views/location_bar/location_bar_view.cc7
-rw-r--r--chrome/browser/ui/views/notifications/balloon_view_host.cc5
-rw-r--r--chrome/browser/ui/views/tabs/base_tab_strip.cc2
-rw-r--r--chrome/browser/ui/views/tabs/dragged_tab_controller.cc6
-rw-r--r--chrome/browser/ui/views/tabs/dragged_tab_view.cc8
-rw-r--r--chrome/browser/ui/views/task_manager_view.cc4
-rw-r--r--chrome/browser/ui/webui/options/advanced_options_utils_win.cc6
-rw-r--r--chrome/chrome_browser.gypi57
-rw-r--r--chrome/chrome_tests.gypi5
-rw-r--r--chrome/common/automation_messages.h4
-rw-r--r--chrome/common/automation_messages_internal.h2
-rw-r--r--chrome/test/automation/tab_proxy.cc2
37 files changed, 278 insertions, 105 deletions
diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc
index f40b415..15aaf3b 100644
--- a/chrome/browser/automation/automation_provider.cc
+++ b/chrome/browser/automation/automation_provider.cc
@@ -96,7 +96,7 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFindOptions.h"
#include "webkit/glue/password_form.h"
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
#include "chrome/browser/external_tab_container_win.h"
#endif // defined(OS_WIN)
@@ -368,7 +368,7 @@ bool AutomationProvider::OnMessageReceived(const IPC::Message& message) {
IPC_MESSAGE_HANDLER(AutomationMsg_RemoveBrowsingData, RemoveBrowsingData)
IPC_MESSAGE_HANDLER(AutomationMsg_JavaScriptStressTestControl,
JavaScriptStressTestControl)
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
// These are for use with external tabs.
IPC_MESSAGE_HANDLER(AutomationMsg_CreateExternalTab, CreateExternalTab)
IPC_MESSAGE_HANDLER(AutomationMsg_ProcessUnhandledAccelerator,
diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h
index af3f830..c367584 100644
--- a/chrome/browser/automation/automation_provider.h
+++ b/chrome/browser/automation/automation_provider.h
@@ -31,10 +31,10 @@
#include "content/common/notification_observer.h"
#include "ipc/ipc_channel.h"
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
#include "ui/gfx/native_widget_types.h"
#include "views/events/event.h"
-#endif // defined(OS_WIN)
+#endif // defined(OS_WIN) && !defined(USE_AURA)
class PopupMenuWaiter;
class TabContents;
@@ -149,7 +149,7 @@ class AutomationProvider
// the handle is simply returned.
int AddExtension(const Extension* extension);
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
// Adds the external tab passed in to the tab tracker.
bool AddExternalTab(ExternalTabContainer* external_tab);
#endif
@@ -321,7 +321,7 @@ class AutomationProvider
// Method called by the popup menu tracker when a popup menu is opened.
void NotifyPopupMenuOpened();
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
// The functions in this block are for use with external tabs, so they are
// Windows only.
@@ -371,7 +371,7 @@ class AutomationProvider
void OnSetZoomLevel(int handle, int zoom_level);
ExternalTabContainer* GetExternalTabForHandle(int handle);
-#endif // defined(OS_WIN)
+#endif // defined(OS_WIN) && !defined(USE_AURA)
scoped_ptr<IPC::ChannelProxy> channel_;
scoped_ptr<NotificationObserver> new_tab_ui_load_observer_;
diff --git a/chrome/browser/bookmarks/bookmark_drop_info.cc b/chrome/browser/bookmarks/bookmark_drop_info.cc
index 1b0b3e6..0eacd2a 100644
--- a/chrome/browser/bookmarks/bookmark_drop_info.cc
+++ b/chrome/browser/bookmarks/bookmark_drop_info.cc
@@ -30,7 +30,7 @@ void BookmarkDropInfo::Update(const views::DropTargetEvent& event) {
is_control_down_ = event.IsControlDown();
last_y_ = event.y();
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
RECT client_rect;
GetClientRect(wnd_, &client_rect);
bool scroll_down = (last_y_ >= client_rect.bottom - views::kAutoscrollSize);
@@ -53,7 +53,7 @@ void BookmarkDropInfo::Update(const views::DropTargetEvent& event) {
}
void BookmarkDropInfo::Scroll() {
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
SendMessage(wnd_, WM_VSCROLL, scroll_up_ ? SB_LINEUP : SB_LINEDOWN, NULL);
Scrolled();
#else
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc
index bdd9c98..1674371 100644
--- a/chrome/browser/download/download_util.cc
+++ b/chrome/browser/download/download_util.cc
@@ -71,7 +71,7 @@
#endif // defined(TOOLKIT_GTK)
#endif // defined(TOOLKIT_USES_GTK)
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
#include "base/win/scoped_comptr.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
@@ -391,7 +391,10 @@ void DragDownload(const DownloadItem* download,
download->GetFileNameToReportUser().LossyDisplayName());
}
-#if defined(OS_WIN)
+#if defined(USE_AURA)
+ // TODO(beng):
+ NOTIMPLEMENTED();
+#elif defined(OS_WIN)
scoped_refptr<ui::DragSource> drag_source(new ui::DragSource);
// Run the drag and drop loop
@@ -539,7 +542,10 @@ string16 GetProgressStatusText(DownloadItem* download) {
void UpdateAppIconDownloadProgress(int download_count,
bool progress_known,
float progress) {
-#if defined(OS_WIN)
+#if defined(USE_AURA)
+ // TODO(beng):
+ NOTIMPLEMENTED();
+#elif defined(OS_WIN)
// Taskbar progress bar is only supported on Win7.
if (base::win::GetVersion() < base::win::VERSION_WIN7)
return;
@@ -582,7 +588,7 @@ void UpdateAppIconDownloadProgress(int download_count,
int GetUniquePathNumberWithCrDownload(const FilePath& path) {
return DownloadFile::GetUniquePathNumberWithSuffix(
- path, FILE_PATH_LITERAL(".crdownload"));
+ path, FILE_PATH_LITERAL(".crdownload"));
}
FilePath GetCrDownloadPath(const FilePath& suggested_path) {
diff --git a/chrome/browser/plugin_download_helper.cc b/chrome/browser/plugin_download_helper.cc
index 2d570d9..8a47ea4 100644
--- a/chrome/browser/plugin_download_helper.cc
+++ b/chrome/browser/plugin_download_helper.cc
@@ -4,7 +4,7 @@
#include "chrome/browser/plugin_download_helper.h"
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
#include <windows.h>
#include "base/file_util.h"
@@ -80,4 +80,4 @@ void PluginDownloadUrlHelper::OnURLFetchComplete(const URLFetcher* source) {
delete this;
}
-#endif // OS_WIN
+#endif // defined(OS_WIN) && !defined(USE_AURA)
diff --git a/chrome/browser/plugin_installer_infobar_delegate.cc b/chrome/browser/plugin_installer_infobar_delegate.cc
index f37cb9d..a6e002e 100644
--- a/chrome/browser/plugin_installer_infobar_delegate.cc
+++ b/chrome/browser/plugin_installer_infobar_delegate.cc
@@ -51,12 +51,15 @@ string16 PluginInstallerInfoBarDelegate::GetButtonLabel(
bool PluginInstallerInfoBarDelegate::Accept() {
// TODO(PORT) for other platforms.
-#ifdef OS_WIN
+#if defined(OS_WIN) && !defined(USE_AURA)
::PostMessage(window_,
webkit::npapi::default_plugin::kInstallMissingPluginMessage,
0,
0);
-#endif // OS_WIN
+#elif defined(USE_AURA)
+ // TODO(beng):
+ NOTIMPLEMENTED();
+#endif
return true;
}
diff --git a/chrome/browser/themes/theme_service.cc b/chrome/browser/themes/theme_service.cc
index 6769b2e..220afe9 100644
--- a/chrome/browser/themes/theme_service.cc
+++ b/chrome/browser/themes/theme_service.cc
@@ -20,7 +20,7 @@
#include "grit/ui_resources.h"
#include "ui/base/resource/resource_bundle.h"
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
#include "views/widget/native_widget_win.h"
#endif
@@ -270,7 +270,7 @@ bool ThemeService::GetDisplayProperty(int id, int* result) const {
bool ThemeService::ShouldUseNativeFrame() const {
if (HasCustomImage(IDR_THEME_FRAME))
return false;
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
return views::NativeWidgetWin::IsAeroGlassEnabled();
#else
return false;
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc
index 3a4e6c8..31950f11 100644
--- a/chrome/browser/ui/browser.cc
+++ b/chrome/browser/ui/browser.cc
@@ -490,7 +490,7 @@ void Browser::InitBrowserWindow() {
window_ = CreateBrowserWindow();
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
{
// TODO: This might hit the disk
// http://code.google.com/p/chromium/issues/detail?id=61638
diff --git a/chrome/browser/ui/input_window_dialog_win.cc b/chrome/browser/ui/input_window_dialog_win.cc
index 3c1cc88..268fdce 100644
--- a/chrome/browser/ui/input_window_dialog_win.cc
+++ b/chrome/browser/ui/input_window_dialog_win.cc
@@ -31,7 +31,7 @@ class Widget;
// The Windows implementation of the cross platform input dialog interface.
class WinInputWindowDialog : public InputWindowDialog {
public:
- WinInputWindowDialog(HWND parent,
+ WinInputWindowDialog(gfx::NativeWindow parent,
const std::wstring& window_title,
const std::wstring& label,
const std::wstring& contents,
@@ -204,7 +204,7 @@ void ContentView::FocusFirstFocusableControl() {
text_field_->RequestFocus();
}
-WinInputWindowDialog::WinInputWindowDialog(HWND parent,
+WinInputWindowDialog::WinInputWindowDialog(gfx::NativeWindow parent,
const std::wstring& window_title,
const std::wstring& label,
const std::wstring& contents,
@@ -230,7 +230,7 @@ void WinInputWindowDialog::Close() {
}
// static
-InputWindowDialog* InputWindowDialog::Create(HWND parent,
+InputWindowDialog* InputWindowDialog::Create(gfx::NativeWindow parent,
const string16& window_title,
const string16& label,
const string16& contents,
diff --git a/chrome/browser/ui/panels/panel_browser_view.cc b/chrome/browser/ui/panels/panel_browser_view.cc
index a6ffc55..470e8fb 100644
--- a/chrome/browser/ui/panels/panel_browser_view.cc
+++ b/chrome/browser/ui/panels/panel_browser_view.cc
@@ -119,7 +119,11 @@ void PanelBrowserView::OnWidgetActivationChanged(views::Widget* widget,
bool active) {
::BrowserView::OnWidgetActivationChanged(widget, active);
-#if defined(OS_WIN)
+#if defined(USE_AURA)
+ // TODO(beng):
+ NOTIMPLEMENTED();
+ bool focused = active;
+#elif defined(OS_WIN)
// The panel window is in focus (actually accepting keystrokes) if it is
// active and belongs to a foreground application.
bool focused = active &&
diff --git a/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc b/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc
index bf104f2..35bb187 100644
--- a/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc
+++ b/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc
@@ -38,8 +38,10 @@
#include <objidl.h>
#include "base/win/scoped_gdi_object.h"
+#if !defined(USE_AURA)
#include "views/widget/native_widget_win.h"
#endif
+#endif
#if defined(TOOLKIT_USES_GTK)
#include "ui/gfx/skia_utils_gtk.h"
@@ -117,7 +119,11 @@ class OptInButtonBorder : public views::Border {
};
gfx::NativeView GetRelativeWindowForPopup(gfx::NativeView edit_native_view) {
-#if defined(OS_WIN)
+#if defined(USE_AURA)
+ // TODO(beng):
+ NOTIMPLEMENTED();
+ return NULL;
+#elif defined(OS_WIN)
// When an IME is attached to the rich-edit control, retrieve its window
// handle and show this popup window under the IME windows.
// Otherwise, show this popup window under top-most windows.
@@ -610,7 +616,7 @@ void AutocompletePopupContentsView::MakeContentsPath(
}
void AutocompletePopupContentsView::UpdateBlurRegion() {
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
// We only support background blurring on Vista with Aero-Glass enabled.
if (!views::NativeWidgetWin::IsAeroGlassEnabled() || !GetWidget())
return;
diff --git a/chrome/browser/ui/views/avatar_menu_button.cc b/chrome/browser/ui/views/avatar_menu_button.cc
index 15fdbb7..7afeebc 100644
--- a/chrome/browser/ui/views/avatar_menu_button.cc
+++ b/chrome/browser/ui/views/avatar_menu_button.cc
@@ -31,7 +31,7 @@ static inline int Round(double x) {
// See http://msdn.microsoft.com/en-us/library/dd391696(VS.85).aspx for
// more information.
void DrawTaskBarDecoration(const Browser* browser, const SkBitmap* bitmap) {
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
if (base::win::GetVersion() < base::win::VERSION_WIN7)
return;
BrowserWindow* bw = browser->window();
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc
index 77580f4..529a13e 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc
@@ -367,7 +367,10 @@ void BookmarkBubbleView::ShowEditor() {
profile_->GetBookmarkModel()->GetMostRecentlyAddedNodeForURL(url_);
#if !defined(WEBUI_DIALOGS)
-#if defined(OS_WIN)
+#if defined(USE_AURA)
+ NOTIMPLEMENTED();
+ gfx::NativeView parent = NULL;
+#elif defined(OS_WIN)
// Parent the editor to our root ancestor (not the root we're in, as that
// is the info bubble and will close shortly).
HWND parent = GetAncestor(GetWidget()->GetNativeView(), GA_ROOTOWNER);
diff --git a/chrome/browser/ui/views/browser_bubble.cc b/chrome/browser/ui/views/browser_bubble.cc
index f826469..95075a09 100644
--- a/chrome/browser/ui/views/browser_bubble.cc
+++ b/chrome/browser/ui/views/browser_bubble.cc
@@ -5,9 +5,6 @@
#include "chrome/browser/ui/views/browser_bubble.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
-#if defined(OS_WIN)
-#include "chrome/browser/external_tab_container_win.h"
-#endif
#include "views/widget/widget.h"
namespace {
diff --git a/chrome/browser/ui/views/bubble/bubble.cc b/chrome/browser/ui/views/bubble/bubble.cc
index 82ed36f..0b63a24 100644
--- a/chrome/browser/ui/views/bubble/bubble.cc
+++ b/chrome/browser/ui/views/bubble/bubble.cc
@@ -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 @@ using std::vector;
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 @@ void Bubble::AnimationEnded(const ui::Animation* animation) {
// 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 @@ void Bubble::AnimationProgressed(const ui::Animation* animation) {
// 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 @@ void Bubble::AnimationProgressed(const ui::Animation* animation) {
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 @@ void Bubble::InitBubble(views::Widget* parent,
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 @@ void Bubble::InitBubble(views::Widget* parent,
// 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 @@ void Bubble::InitBubble(views::Widget* parent,
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 @@ BorderContents* Bubble::CreateBorderContents() {
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 @@ void Bubble::SizeToContents() {
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 @@ void Bubble::DoClose(bool closed_by_escape) {
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::FadeIn() {
}
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 @@ void Bubble::FadeOut() {
// 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|.
diff --git a/chrome/browser/ui/views/bubble/bubble.h b/chrome/browser/ui/views/bubble/bubble.h
index f4f4fec..4df1a55 100644
--- a/chrome/browser/ui/views/bubble/bubble.h
+++ b/chrome/browser/ui/views/bubble/bubble.h
@@ -11,7 +11,9 @@
#include "views/accelerator.h"
#include "views/view.h"
-#if defined(OS_WIN)
+#if defined(USE_AURA)
+#include "views/widget/native_widget_aura.h"
+#elif defined(OS_WIN)
#include "views/widget/native_widget_win.h"
#elif defined(TOOLKIT_USES_GTK)
#include "views/widget/native_widget_gtk.h"
@@ -27,7 +29,7 @@
// additional margins.
class BorderContents;
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
class BorderWidgetWin;
#endif
class Bubble;
@@ -70,7 +72,9 @@ class BubbleDelegate {
// WidgetFoo subclass into a separate class that calls into Bubble.
// That way Bubble has no (or very few) ifdefs.
class Bubble
-#if defined(OS_WIN)
+#if defined(USE_AURA)
+ : public views::NativeWidgetAura,
+#elif defined(OS_WIN)
: public views::NativeWidgetWin,
#elif defined(TOOLKIT_USES_GTK)
: public views::NativeWidgetGtk,
@@ -125,7 +129,7 @@ class Bubble
fade_away_on_close_ = fade_away_on_close;
}
- // Overridden from NativeWidgetWin:
+ // Overridden from NativeWidget:
virtual void Close();
// Overridden from ui::AnimationDelegate:
@@ -157,7 +161,10 @@ class Bubble
// Subclasses can return their own BorderContents implementation.
virtual BorderContents* CreateBorderContents();
-#if defined(OS_WIN)
+#if defined(USE_AURA)
+ // Overridden from NativeWidgetAura:
+ // TODO(beng): OnActivate();
+#elif defined(OS_WIN)
// Overridden from NativeWidgetWin:
virtual void OnActivate(UINT action, BOOL minimized, HWND window);
#elif defined(TOOLKIT_USES_GTK)
@@ -165,7 +172,9 @@ class Bubble
virtual void OnActiveChanged() OVERRIDE;
#endif
-#if defined(OS_WIN)
+#if defined(USE_AURA)
+ // TODO(beng):
+#elif defined(OS_WIN)
// The window used to render the padding, border and arrow.
BorderWidgetWin* border_;
#elif defined(TOOLKIT_USES_GTK)
diff --git a/chrome/browser/ui/views/collected_cookies_win.cc b/chrome/browser/ui/views/collected_cookies_win.cc
index 3ab5d43..6780fa6 100644
--- a/chrome/browser/ui/views/collected_cookies_win.cc
+++ b/chrome/browser/ui/views/collected_cookies_win.cc
@@ -492,6 +492,10 @@ void CollectedCookiesWin::AddContentException(views::TreeView* tree_view,
setting);
infobar_->UpdateVisibility(true, setting, origin_node->GetTitle());
gfx::Rect bounds = GetWidget()->GetClientAreaScreenBounds();
+#if defined(USE_AURA)
+ // TODO(beng): convert the conversion to use views conversion methods.
+ NOTIMPLEMENTED();
+#else
// NativeWidgetWin::GetBounds returns the bounds relative to the parent
// window, while NativeWidgetWin::SetBounds wants screen coordinates. Do the
// translation here until http://crbug.com/52851 is fixed.
@@ -500,6 +504,7 @@ void CollectedCookiesWin::AddContentException(views::TreeView* tree_view,
gfx::Size size = GetWidget()->GetRootView()->GetPreferredSize();
bounds.SetRect(topleft.x, topleft.y, size.width(), size.height());
GetWidget()->SetBounds(bounds);
+#endif
status_changed_ = true;
}
diff --git a/chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.cc b/chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.cc
index 216473d..ff61daf 100644
--- a/chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.cc
+++ b/chrome/browser/ui/views/compact_nav/compact_location_bar_view_host.cc
@@ -47,12 +47,17 @@ const int kSpacerLocationbarOverlap = 1;
// An mouse event observer to detect a mouse click on
// BrowserView's content area and hide the location bar.
-class MouseObserver : public MessageLoopForUI::Observer {
+class MouseObserver
+#if !defined(USE_AURA)
+ : public MessageLoopForUI::Observer
+#endif
+ {
public:
MouseObserver(CompactLocationBarViewHost* host, BrowserView* view);
~MouseObserver();
// MessageLoopForUI::Observer overrides.
+#if !defined(USE_AURA)
#if defined(OS_WIN)
virtual void WillProcessMessage(const MSG& native_event) OVERRIDE;
virtual void DidProcessMessage(const MSG& native_event) OVERRIDE;
@@ -60,6 +65,7 @@ class MouseObserver : public MessageLoopForUI::Observer {
virtual void WillProcessEvent(GdkEvent* native_event) OVERRIDE;
virtual void DidProcessEvent(GdkEvent* native_event) OVERRIDE;
#endif
+#endif
void Observe(MessageLoopForUI* loop);
void StopObserving(MessageLoopForUI* loop);
@@ -100,6 +106,7 @@ MouseObserver::~MouseObserver() {
StopObserving(MessageLoopForUI::current());
}
+#if !defined(USE_AURA)
#if defined(OS_WIN)
void MouseObserver::WillProcessMessage(const MSG& native_event) {}
void MouseObserver::DidProcessMessage(const MSG& native_event) {
@@ -118,19 +125,24 @@ void MouseObserver::DidProcessEvent(GdkEvent* native_event) {
host_->Hide(true);
}
}
+#endif
void MouseObserver::Observe(MessageLoopForUI* loop) {
+#if !defined(USE_AURA)
if (!observing_) {
loop->AddObserver(this);
observing_ = true;
}
+#endif
}
void MouseObserver::StopObserving(MessageLoopForUI* loop) {
+#if !defined(USE_AURA)
if (observing_) {
loop->RemoveObserver(this);
observing_ = false;
}
+#endif
}
bool MouseObserver::IsMouseEvent(const views::NativeEvent& native_event) {
@@ -150,7 +162,11 @@ bool MouseObserver::IsMouseEvent(const views::NativeEvent& native_event) {
// Then, with a GetTopLevel receiving a NativeWindow, we could do this in a
// platform independent way.
bool MouseObserver::IsSameTopLevelWindow(views::NativeEvent native_event) {
-#if defined(OS_WIN)
+#if defined(USE_AURA)
+ // TODO(beng):
+ NOTIMPLEMENTED();
+ return false;
+#elif defined(OS_WIN)
return platform_util::GetTopLevel(native_event.hwnd) == top_level_window_;
#elif defined(OS_LINUX)
return gdk_window_get_toplevel(
diff --git a/chrome/browser/ui/views/constrained_window_views.cc b/chrome/browser/ui/views/constrained_window_views.cc
index 8ed9658..47e8724 100644
--- a/chrome/browser/ui/views/constrained_window_views.cc
+++ b/chrome/browser/ui/views/constrained_window_views.cc
@@ -35,7 +35,7 @@
#include "views/window/window_resources.h"
#include "views/window/window_shape.h"
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
#include "views/widget/native_widget_win.h"
#endif
@@ -205,7 +205,7 @@ class ConstrainedWindowFrameView
SkColor GetTitleColor() const {
return container_->owner()->browser_context()->IsOffTheRecord()
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
|| !views::NativeWidgetWin::IsAeroGlassEnabled()
#endif
? SK_ColorWHITE : SK_ColorBLACK;
@@ -545,17 +545,23 @@ gfx::Rect ConstrainedWindowFrameView::CalculateClientAreaBounds(
}
void ConstrainedWindowFrameView::InitWindowResources() {
+#if !defined(USE_AURA)
resources_.reset(views::NativeWidgetWin::IsAeroGlassEnabled() ?
- static_cast<views::WindowResources*>(new VistaWindowResources) :
- new XPWindowResources);
+ static_cast<views::WindowResources*>(new VistaWindowResources) :
+ new XPWindowResources);
+#endif
}
// static
void ConstrainedWindowFrameView::InitClass() {
static bool initialized = false;
if (!initialized) {
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
title_font_ = new gfx::Font(views::NativeWidgetWin::GetWindowTitleFont());
+#elif defined(USE_AURA)
+ // TODO(beng):
+ NOTIMPLEMENTED();
+ title_font_ = NULL;
#endif
initialized = true;
}
diff --git a/chrome/browser/ui/views/extensions/extension_view.cc b/chrome/browser/ui/views/extensions/extension_view.cc
index bc698ae..954bb3e 100644
--- a/chrome/browser/ui/views/extensions/extension_view.cc
+++ b/chrome/browser/ui/views/extensions/extension_view.cc
@@ -85,7 +85,10 @@ void ExtensionView::CreateWidgetHostView() {
RenderWidgetHostView::CreateViewForWidget(render_view_host());
// TODO(mpcomplete): RWHV needs a cross-platform Init function.
-#if defined(OS_WIN)
+#if defined(USE_AURA)
+ // TODO(beng): should be same as TOUCH_UI
+ NOTIMPLEMENTED();
+#elif defined(OS_WIN)
// Create the HWND. Note:
// RenderWidgetHostHWND supports windowed plugins, but if we ever also
// wanted to support constrained windows with this, we would need an
diff --git a/chrome/browser/ui/views/find_bar_host.cc b/chrome/browser/ui/views/find_bar_host.cc
index 32ed3c1..fbbf98a 100644
--- a/chrome/browser/ui/views/find_bar_host.cc
+++ b/chrome/browser/ui/views/find_bar_host.cc
@@ -195,7 +195,7 @@ bool FindBarHost::AcceleratorPressed(const views::Accelerator& accelerator) {
bool FindBarHost::GetFindBarWindowInfo(gfx::Point* position,
bool* fully_visible) {
if (!find_bar_controller_ ||
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
!::IsWindow(host()->GetNativeView())) {
#else
false) {
diff --git a/chrome/browser/ui/views/frame/browser_frame.cc b/chrome/browser/ui/views/frame/browser_frame.cc
index 31d2b67b..69dd2ac 100644
--- a/chrome/browser/ui/views/frame/browser_frame.cc
+++ b/chrome/browser/ui/views/frame/browser_frame.cc
@@ -17,7 +17,7 @@
#include "ui/base/theme_provider.h"
#include "views/widget/native_widget.h"
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
#include "chrome/browser/ui/views/frame/glass_browser_frame_view.h"
#endif
@@ -106,14 +106,14 @@ views::internal::RootView* BrowserFrame::CreateRootView() {
}
views::NonClientFrameView* BrowserFrame::CreateNonClientFrameView() {
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
if (ShouldUseNativeFrame()) {
browser_frame_view_ = new GlassBrowserFrameView(this, browser_view_);
} else {
#endif
browser_frame_view_ =
browser::CreateBrowserNonClientFrameView(this, browser_view_);
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
}
#endif
return browser_frame_view_;
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 7f586b6..d77882c 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -105,7 +105,8 @@
#include "views/widget/widget.h"
#include "views/window/dialog_delegate.h"
-#if defined(OS_WIN)
+#if defined(USE_AURA)
+#elif defined(OS_WIN)
#include "chrome/browser/aeropeek_manager.h"
#include "chrome/browser/jumplist_win.h"
#include "ui/base/message_box_win.h"
@@ -330,7 +331,7 @@ BrowserView::BrowserView(Browser* browser)
contents_split_(NULL),
initialized_(false),
ignore_layout_(true)
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
, hung_window_detector_(&hung_plugin_action_),
ticker_(0)
#endif
@@ -345,7 +346,7 @@ BrowserView::BrowserView(Browser* browser)
BrowserView::~BrowserView() {
browser_->tabstrip_model()->RemoveObserver(this);
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
// Remove this observer.
if (aeropeek_manager_.get())
browser_->tabstrip_model()->RemoveObserver(aeropeek_manager_.get());
@@ -386,7 +387,10 @@ BrowserView::~BrowserView() {
// static
BrowserView* BrowserView::GetBrowserViewForNativeWindow(
gfx::NativeWindow window) {
-#if defined(OS_WIN)
+#if defined(USE_AURA)
+ // TODO(beng):
+ NOTIMPLEMENTED();
+#elif defined(OS_WIN)
if (IsWindow(window)) {
return reinterpret_cast<BrowserView*>(
ui::ViewProp::GetValue(window, kBrowserViewKey));
@@ -574,7 +578,7 @@ SkBitmap BrowserView::GetOTRAvatarIcon() {
return *otr_avatar_;
}
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
void BrowserView::PrepareToRunSystemMenu(HMENU menu) {
system_menu_->UpdateStates();
}
@@ -655,7 +659,7 @@ bool BrowserView::IsActive() const {
}
void BrowserView::FlashFrame() {
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
FLASHWINFO fwi;
fwi.cbSize = sizeof(fwi);
fwi.hwnd = frame_->GetNativeWindow();
@@ -797,7 +801,7 @@ void BrowserView::SetFullscreen(bool fullscreen) {
if (IsFullscreen() == fullscreen)
return; // Nothing to do.
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
ProcessFullscreen(fullscreen);
#else
// On Linux changing fullscreen is async. Ask the window to change it's
@@ -1014,7 +1018,7 @@ bool BrowserView::IsToolbarVisible() const {
}
void BrowserView::DisableInactiveFrame() {
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
frame_->DisableInactiveRendering();
#endif // No tricks are needed to get the right behavior on Linux.
}
@@ -1023,7 +1027,7 @@ void BrowserView::ConfirmSetDefaultSearchProvider(
TabContents* tab_contents,
TemplateURL* template_url,
TemplateURLService* template_url_service) {
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
DefaultSearchView::Show(tab_contents, template_url, template_url_service);
#else
// TODO(levin): Implement for other platforms. Right now this is behind
@@ -1209,7 +1213,7 @@ bool BrowserView::PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event,
if (event.type != WebKit::WebInputEvent::RawKeyDown)
return false;
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
// As Alt+F4 is the close-app keyboard shortcut, it needs processing
// immediately.
if (event.windowsKeyCode == ui::VKEY_F4 &&
@@ -1347,7 +1351,7 @@ void BrowserView::ShowInstant(TabContentsWrapper* preview) {
contents_->SetPreview(preview_container_, preview->tab_contents());
preview_container_->ChangeTabContents(preview->tab_contents());
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
// Removing the fade is instant (on windows). We need to force the preview to
// draw, otherwise the current page flickers before the new page appears.
RedrawWindow(preview->tab_contents()->view()->GetContentNativeView(), NULL,
@@ -1614,7 +1618,7 @@ bool BrowserView::ShouldShowWindowIcon() const {
bool BrowserView::ExecuteWindowsCommand(int command_id) {
// This function handles WM_SYSCOMMAND, WM_APPCOMMAND, and WM_COMMAND.
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
if (command_id == IDC_DEBUG_FRAME_TOGGLE)
GetWidget()->DebugToggleFrameType();
#endif
@@ -1776,7 +1780,7 @@ bool BrowserView::CanClose() {
}
int BrowserView::NonClientHitTest(const gfx::Point& point) {
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
// The following code is not in the LayoutManager because it's
// independent of layout and also depends on the ResizeCorner which
// is private.
@@ -1839,7 +1843,7 @@ void BrowserView::Layout() {
// The status bubble position requires that all other layout finish first.
LayoutStatusBubble();
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
// Send the margins of the "user-perceived content area" of this
// browser window so AeroPeekManager can render a background-tab image in
// the area.
@@ -2006,7 +2010,7 @@ void BrowserView::Init() {
status_bubble_.reset(new StatusBubbleViews(contents_));
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
InitSystemMenu();
// Create a custom JumpList and add it to an observer of TabRestoreService
@@ -2079,7 +2083,7 @@ void BrowserView::LoadingAnimationCallback() {
// BrowserView, private --------------------------------------------------------
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
void BrowserView::InitSystemMenu() {
system_menu_contents_.reset(new views::SystemMenuModel(this));
// We add the menu items in reverse order so that insertion_index never needs
@@ -2317,7 +2321,7 @@ void BrowserView::ProcessFullscreen(bool fullscreen) {
// thus are slow and look ugly
ignore_layout_ = true;
LocationBarView* location_bar = GetLocationBarView();
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
OmniboxViewWin* omnibox_view =
static_cast<OmniboxViewWin*>(location_bar->location_entry());
#endif
@@ -2332,7 +2336,7 @@ void BrowserView::ProcessFullscreen(bool fullscreen) {
if (focus_manager->GetFocusedView() == location_bar)
focus_manager->ClearFocus();
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
// If we don't hide the edit and force it to not show until we come out of
// fullscreen, then if the user was on the New Tab Page, the edit contents
// will appear atop the web contents once we go into fullscreen mode. This
@@ -2342,13 +2346,13 @@ void BrowserView::ProcessFullscreen(bool fullscreen) {
ShowWindow(omnibox_view->m_hWnd, SW_HIDE);
#endif
}
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
static_cast<views::NativeWidgetWin*>(frame_->native_widget())->
PushForceHidden();
#endif
// Toggle fullscreen mode.
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
frame_->SetFullscreen(fullscreen);
#endif // No need to invoke SetFullscreen for linux as this code is executed
// once we're already fullscreen on linux.
@@ -2363,7 +2367,7 @@ void BrowserView::ProcessFullscreen(bool fullscreen) {
browser_.get()));
}
} else {
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
// Show the edit again since we're no longer in fullscreen mode.
omnibox_view->set_force_hidden(false);
ShowWindow(omnibox_view->m_hWnd, SW_SHOW);
@@ -2374,7 +2378,7 @@ void BrowserView::ProcessFullscreen(bool fullscreen) {
// it's in its final position.
ignore_layout_ = false;
Layout();
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
static_cast<views::NativeWidgetWin*>(frame_->native_widget())->
PopForceHidden();
#endif
@@ -2382,7 +2386,10 @@ void BrowserView::ProcessFullscreen(bool fullscreen) {
void BrowserView::LoadAccelerators() {
-#if defined(OS_WIN)
+#if defined(USE_AURA)
+ // TODO(beng):
+ NOTIMPLEMENTED();
+#elif defined(OS_WIN)
HACCEL accelerator_table = AtlLoadAccelerators(IDR_MAINFRAME);
DCHECK(accelerator_table);
@@ -2432,7 +2439,7 @@ void BrowserView::LoadAccelerators() {
#endif
}
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
void BrowserView::BuildSystemMenuForBrowserWindow() {
system_menu_contents_->AddSeparator();
system_menu_contents_->AddItemWithStringId(IDC_TASK_MANAGER,
@@ -2495,7 +2502,7 @@ void BrowserView::AddFrameToggleItems() {
#endif
int BrowserView::GetCommandIDForAppCommandID(int app_command_id) const {
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
switch (app_command_id) {
// NOTE: The order here matches the APPCOMMAND declaration order in the
// Windows headers.
@@ -2528,7 +2535,7 @@ int BrowserView::GetCommandIDForAppCommandID(int app_command_id) const {
}
void BrowserView::InitHangMonitor() {
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
PrefService* pref_service = g_browser_process->local_state();
if (!pref_service)
return;
diff --git a/chrome/browser/ui/views/frame/browser_view.h b/chrome/browser/ui/views/frame/browser_view.h
index bb660ad..ca1c525 100644
--- a/chrome/browser/ui/views/frame/browser_view.h
+++ b/chrome/browser/ui/views/frame/browser_view.h
@@ -696,7 +696,7 @@ class BrowserView : public BrowserBubbleHost,
scoped_ptr<FullscreenExitBubbleViews> fullscreen_bubble_;
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
// The additional items we insert into the system menu.
scoped_ptr<views::SystemMenuModel> system_menu_contents_;
scoped_ptr<ZoomMenuModel> zoom_menu_contents_;
diff --git a/chrome/browser/ui/views/infobars/infobar_view.cc b/chrome/browser/ui/views/infobars/infobar_view.cc
index e0c004f..8faa905 100644
--- a/chrome/browser/ui/views/infobars/infobar_view.cc
+++ b/chrome/browser/ui/views/infobars/infobar_view.cc
@@ -317,7 +317,7 @@ void InfoBarView::PlatformSpecificHide(bool animate) {
if (focus_manager)
focus_manager->RemoveFocusChangeListener(this);
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
if (!animate || !focus_tracker_.get())
return;
diff --git a/chrome/browser/ui/views/location_bar/location_bar_view.cc b/chrome/browser/ui/views/location_bar/location_bar_view.cc
index 7edc12b..75bb20c 100644
--- a/chrome/browser/ui/views/location_bar/location_bar_view.cc
+++ b/chrome/browser/ui/views/location_bar/location_bar_view.cc
@@ -176,7 +176,12 @@ void LocationBarView::Init() {
// URL edit field.
// View container for URL edit field.
Profile* profile = browser_->profile();
-#if defined(OS_WIN)
+#if defined(USE_AURA)
+ OmniboxViewViews* omnibox_view = new OmniboxViewViews(this, model_, profile,
+ browser_->command_updater(), mode_ == POPUP, this);
+ omnibox_view->Init();
+ location_entry_.reset(omnibox_view);
+#elif defined(OS_WIN)
if (views::Widget::IsPureViews()) {
OmniboxViewViews* omnibox_view = new OmniboxViewViews(this, model_, profile,
browser_->command_updater(), mode_ == POPUP, this);
diff --git a/chrome/browser/ui/views/notifications/balloon_view_host.cc b/chrome/browser/ui/views/notifications/balloon_view_host.cc
index b97f166..91d3666 100644
--- a/chrome/browser/ui/views/notifications/balloon_view_host.cc
+++ b/chrome/browser/ui/views/notifications/balloon_view_host.cc
@@ -64,7 +64,10 @@ void BalloonViewHost::InitRenderWidgetHostView() {
RenderWidgetHostView::CreateViewForWidget(render_view_host_);
// TODO(johnnyg): http://crbug.com/23954. Need a cross-platform solution.
-#if defined(OS_WIN)
+#if defined(USE_AURA)
+ // TODO(beng): (same as touch_ui probably).
+ NOTIMPLEMENTED();
+#elif defined(OS_WIN)
RenderWidgetHostViewWin* view_win =
static_cast<RenderWidgetHostViewWin*>(render_widget_host_view_);
diff --git a/chrome/browser/ui/views/tabs/base_tab_strip.cc b/chrome/browser/ui/views/tabs/base_tab_strip.cc
index e933f5d..5dbff36 100644
--- a/chrome/browser/ui/views/tabs/base_tab_strip.cc
+++ b/chrome/browser/ui/views/tabs/base_tab_strip.cc
@@ -89,7 +89,7 @@ class BaseTabStrip::RemoveTabDelegate
return;
}
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
views::Widget* widget = tabstrip_->GetWidget();
// This can be null during shutdown. See http://crbug.com/42737.
if (!widget)
diff --git a/chrome/browser/ui/views/tabs/dragged_tab_controller.cc b/chrome/browser/ui/views/tabs/dragged_tab_controller.cc
index eab3310..2b60c9f 100644
--- a/chrome/browser/ui/views/tabs/dragged_tab_controller.cc
+++ b/chrome/browser/ui/views/tabs/dragged_tab_controller.cc
@@ -1145,7 +1145,7 @@ void DraggedTabController::RevertDrag() {
// it has been hidden.
if (restore_frame) {
if (!restore_bounds_.IsEmpty()) {
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
HWND frame_hwnd = source_tabstrip_->GetWidget()->GetNativeView();
MoveWindow(frame_hwnd, restore_bounds_.x(), restore_bounds_.y(),
restore_bounds_.width(), restore_bounds_.height(), TRUE);
@@ -1355,7 +1355,7 @@ gfx::Rect DraggedTabController::GetViewScreenBounds(views::View* view) const {
}
void DraggedTabController::HideFrame() {
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
// We don't actually hide the window, rather we just move it way off-screen.
// If we actually hide it, we stop receiving drag events.
HWND frame_hwnd = source_tabstrip_->GetWidget()->GetNativeView();
@@ -1408,7 +1408,7 @@ void DraggedTabController::BringWindowUnderMouseToFront() {
dock_windows_.erase(dragged_view);
}
if (window) {
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
// Move the window to the front.
SetWindowPos(window, HWND_TOP, 0, 0, 0, 0,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE);
diff --git a/chrome/browser/ui/views/tabs/dragged_tab_view.cc b/chrome/browser/ui/views/tabs/dragged_tab_view.cc
index f28c49b..4958632 100644
--- a/chrome/browser/ui/views/tabs/dragged_tab_view.cc
+++ b/chrome/browser/ui/views/tabs/dragged_tab_view.cc
@@ -10,7 +10,9 @@
#include "ui/gfx/canvas_skia.h"
#include "views/widget/widget.h"
-#if defined(OS_WIN)
+#if defined(USE_AURA)
+#include "views/widget/native_widget_aura.h"
+#elif defined(OS_WIN)
#include "views/widget/native_widget_win.h"
#elif defined(TOOLKIT_USES_GTK)
#include "views/widget/native_widget_gtk.h"
@@ -47,7 +49,7 @@ DraggedTabView::DraggedTabView(const std::vector<views::View*>& renderers,
params.bounds = gfx::Rect(PreferredContainerSize());
container_->Init(params);
container_->SetContentsView(this);
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
static_cast<views::NativeWidgetWin*>(container_->native_widget())->
set_can_update_layered_window(false);
@@ -80,7 +82,7 @@ void DraggedTabView::MoveTo(const gfx::Point& screen_point) {
}
int y = screen_point.y() - ScaleValue(mouse_tab_offset_.y());
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
// TODO(beng): make this cross-platform
int show_flags = container_->IsVisible() ? SWP_NOZORDER : SWP_SHOWWINDOW;
SetWindowPos(container_->GetNativeView(), HWND_TOP, x, y, 0, 0,
diff --git a/chrome/browser/ui/views/task_manager_view.cc b/chrome/browser/ui/views/task_manager_view.cc
index 3207add..fd5d423 100644
--- a/chrome/browser/ui/views/task_manager_view.cc
+++ b/chrome/browser/ui/views/task_manager_view.cc
@@ -611,6 +611,7 @@ bool TaskManagerView::CanMaximize() const {
}
bool TaskManagerView::ExecuteWindowsCommand(int command_id) {
+#if defined(OS_WIN) && !defined(USE_AURA)
if (command_id == IDC_ALWAYS_ON_TOP) {
is_always_on_top_ = !is_always_on_top_;
@@ -639,6 +640,7 @@ bool TaskManagerView::ExecuteWindowsCommand(int command_id) {
}
return true;
}
+#endif
return false;
}
@@ -735,6 +737,7 @@ void TaskManagerView::ActivateFocusedTab() {
}
void TaskManagerView::AddAlwaysOnTopSystemMenuItem() {
+#if defined(OS_WIN) && !defined(USE_AURA)
// The Win32 API requires that we own the text.
always_on_top_menu_text_ =
UTF16ToWide(l10n_util::GetStringUTF16(IDS_ALWAYS_ON_TOP));
@@ -764,6 +767,7 @@ void TaskManagerView::AddAlwaysOnTopSystemMenuItem() {
menu_info.wID = IDC_ALWAYS_ON_TOP;
menu_info.dwTypeData = const_cast<wchar_t*>(always_on_top_menu_text_.c_str());
::InsertMenuItem(system_menu, index, TRUE, &menu_info);
+#endif
}
bool TaskManagerView::GetSavedAlwaysOnTopState(bool* always_on_top) const {
diff --git a/chrome/browser/ui/webui/options/advanced_options_utils_win.cc b/chrome/browser/ui/webui/options/advanced_options_utils_win.cc
index cc34c0a..94443efe 100644
--- a/chrome/browser/ui/webui/options/advanced_options_utils_win.cc
+++ b/chrome/browser/ui/webui/options/advanced_options_utils_win.cc
@@ -62,6 +62,10 @@ void AdvancedOptionsUtilities::ShowManageSSLCertificates(
CRYPTUI_CERT_MGR_STRUCT cert_mgr = { 0 };
cert_mgr.dwSize = sizeof(CRYPTUI_CERT_MGR_STRUCT);
cert_mgr.hwndParent =
- tab_contents->view()->GetTopLevelNativeWindow();
+#if defined(USE_AURA)
+ NULL;
+#else
+ tab_contents->view()->GetTopLevelNativeWindow();
+#endif
::CryptUIDlgCertMgr(&cert_mgr);
}
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 5522926..b5028eb 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -3962,6 +3962,63 @@
],
},
}],
+ ['use_aura==1', {
+ 'sources/': [
+ ['exclude', '^browser/aeropeek_manager.cc'],
+ ['exclude', '^browser/automation/automation_provider_win.cc'],
+ ['exclude', '^browser/automation/chrome_frame_automation_provider.cc'],
+ ['exclude', '^browser/automation/chrome_frame_automation_provider.h'],
+ ['exclude', '^browser/automation/testing_automation_provider_win.cc'],
+ ['exclude', '^browser/google/google_update.cc'],
+ ['exclude', '^browser/google/google_update.h'],
+ ['exclude', '^browser/external_tab_container_win.cc'],
+ ['exclude', '^browser/external_tab_container_win.h'],
+ ['exclude', '^browser/first_run/first_run_win.cc'],
+ ['exclude', '^browser/first_run/try_chrome_dialog_view.cc'],
+ ['exclude', '^browser/first_run/try_chrome_dialog_view.h'],
+ ['exclude', '^browser/hang_monitor/hung_plugin_action.cc'],
+ ['exclude', '^browser/hang_monitor/hung_plugin_action.h'],
+ ['exclude', '^browser/hang_monitor/hung_window_detector.cc'],
+ ['exclude', '^browser/hang_monitor/hung_window_detector.h'],
+ ['exclude', '^browser/platform_util_win.cc'],
+ ['exclude', '^browser/process_singleton_win.cc'],
+ ['exclude', '^browser/tab_contents/web_drag_source_win.cc'],
+ ['exclude', '^browser/tab_contents/web_drag_source_win.h'],
+ ['exclude', '^browser/ui/tabs/dock_info_win.cc'],
+ ['exclude', '^browser/ui/views/about_ipc_dialog.cc'],
+ ['exclude', '^browser/ui/views/app_menu_button_win.cc'],
+ ['exclude', '^browser/ui/views/browser_bubble_win.cc'],
+ ['exclude', '^browser/ui/views/bubble/border_widget_win.cc'],
+ ['exclude', '^browser/ui/views/bubble/border_widget_win.h'],
+ ['exclude', '^browser/ui/views/certificate_viewer_win.cc'],
+ ['exclude', '^browser/ui/views/dropdown_bar_host_win.cc'],
+ ['exclude', '^browser/ui/views/external_protocol_dialog.cc'],
+ ['exclude', '^browser/ui/views/find_bar_host_win.cc'],
+ ['exclude', '^browser/ui/views/first_run_bubble.cc'],
+ ['exclude', '^browser/ui/views/frame/browser_frame_win.cc'],
+ ['exclude', '^browser/ui/views/frame/browser_frame_win.h'],
+ ['exclude', '^browser/ui/views/frame/glass_browser_frame_view.cc'],
+ ['exclude', '^browser/ui/views/frame/glass_browser_frame_view.h'],
+ ['exclude', '^browser/ui/views/hung_renderer_view.cc'],
+ ['exclude', '^browser/ui/views/importer/import_progress_dialog_view.cc'],
+ ['exclude', '^browser/ui/views/native_constrained_window_win.cc'],
+ ['exclude', '^browser/ui/views/omnibox/omnibox_view_win.cc'],
+ ['exclude', '^browser/ui/views/omnibox/omnibox_view_win.h'],
+ ['exclude', '^browser/ui/views/shell_dialogs_win.cc'],
+ ['exclude', '^browser/ui/views/simple_message_box_win.cc'],
+ ['exclude', '^browser/ui/views/tab_contents/native_tab_contents_container_win.cc'],
+ ['exclude', '^browser/ui/views/tab_contents/native_tab_contents_container_win.h'],
+ ['exclude', '^browser/ui/views/tab_contents/native_tab_contents_view_win.cc'],
+ ['exclude', '^browser/ui/views/tab_contents/native_tab_contents_view_win.h'],
+ ['exclude', '^browser/ui/views/tab_contents/tab_contents_drag_win.cc'],
+ ['exclude', '^browser/ui/views/tab_contents/tab_contents_drag_win.h'],
+ ['exclude', '^browser/ui/views/tabs/native_view_photobooth.h'],
+ ['exclude', '^browser/ui/views/tabs/native_view_photobooth_win.cc'],
+ ['exclude', '^browser/ui/views/tabs/native_view_photobooth_win.h'],
+ ['exclude', '^browser/ui/views/user_data_dir_dialog.cc'],
+ ['exclude', '^browser/ui/window_snapshot/window_snapshot_win.cc'],
+ ],
+ }],
['webui_dialogs == 1', {
'defines': [
'WEBUI_DIALOGS',
diff --git a/chrome/chrome_tests.gypi b/chrome/chrome_tests.gypi
index 999dc54..f64d505 100644
--- a/chrome/chrome_tests.gypi
+++ b/chrome/chrome_tests.gypi
@@ -743,6 +743,11 @@
'../views/views.gyp:views',
],
}],
+ ['use_aura==1', {
+ 'sources!': [
+ 'test/automation/automation_proxy_uitest.cc',
+ ],
+ }],
['OS=="mac"', {
# See the comment in this section of the unit_tests target for an
# explanation (crbug.com/43791 - libwebcore.a is too large to mmap).
diff --git a/chrome/common/automation_messages.h b/chrome/common/automation_messages.h
index d26da83..fa61419 100644
--- a/chrome/common/automation_messages.h
+++ b/chrome/common/automation_messages.h
@@ -209,7 +209,7 @@ struct AttachExternalTabParams {
std::string profile_name;
};
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
struct Reposition_Params {
HWND window;
@@ -287,7 +287,7 @@ struct ParamTraits<PageType> {
static void Log(const param_type& p, std::string* l);
};
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
// Traits for SetWindowPos_Params structure to pack/unpack.
template <>
diff --git a/chrome/common/automation_messages_internal.h b/chrome/common/automation_messages_internal.h
index e8c2520..55020c6 100644
--- a/chrome/common/automation_messages_internal.h
+++ b/chrome/common/automation_messages_internal.h
@@ -852,7 +852,7 @@ IPC_MESSAGE_ROUTED2(AutomationMsg_NavigationFailed,
int,
GURL)
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
// This message is an outgoing message from an automation client to Chrome.
// It is used to reposition a chrome tab window.
IPC_MESSAGE_CONTROL2(AutomationMsg_TabReposition,
diff --git a/chrome/test/automation/tab_proxy.cc b/chrome/test/automation/tab_proxy.cc
index 49cd00c..6f360ad 100644
--- a/chrome/test/automation/tab_proxy.cc
+++ b/chrome/test/automation/tab_proxy.cc
@@ -749,7 +749,7 @@ bool TabProxy::CaptureEntirePageAsPNG(const FilePath& path) {
tab_index, path, &error_msg);
}
-#if defined(OS_WIN)
+#if defined(OS_WIN) && !defined(USE_AURA)
void TabProxy::Reposition(HWND window, HWND window_insert_after, int left,
int top, int width, int height, int flags,
HWND parent_window) {