Index: chrome/browser/ui/views/tab_contents/chrome_web_contents_view_delegate_views.cc |
diff --git a/chrome/browser/ui/views/tab_contents/chrome_web_contents_view_delegate_views.cc b/chrome/browser/ui/views/tab_contents/chrome_web_contents_view_delegate_views.cc |
index 55176d26af03b7028f217e46ffbe71a3c6690eab..b5544d8b16f144a47578144ef8d79cdf05b4dd1f 100644 |
--- a/chrome/browser/ui/views/tab_contents/chrome_web_contents_view_delegate_views.cc |
+++ b/chrome/browser/ui/views/tab_contents/chrome_web_contents_view_delegate_views.cc |
@@ -5,7 +5,6 @@ |
#include "chrome/browser/ui/views/tab_contents/chrome_web_contents_view_delegate_views.h" |
#include "chrome/browser/defaults.h" |
-#include "chrome/browser/ui/aura/tab_contents/web_drag_bookmark_handler_aura.h" |
#include "chrome/browser/ui/sad_tab_helper.h" |
#include "chrome/browser/ui/tab_contents/chrome_web_contents_view_delegate.h" |
#include "chrome/browser/ui/views/renderer_context_menu/render_view_context_menu_views.h" |
@@ -16,14 +15,18 @@ |
#include "content/public/browser/render_widget_host_view.h" |
#include "content/public/browser/web_contents.h" |
#include "content/public/browser/web_contents_delegate.h" |
-#include "ui/aura/client/screen_position_client.h" |
-#include "ui/aura/window.h" |
+#include "content/public/browser/web_drag_dest_delegate.h" |
#include "ui/views/focus/focus_manager.h" |
#include "ui/views/focus/view_storage.h" |
#include "ui/views/widget/widget.h" |
#if defined(USE_AURA) |
+#include "chrome/browser/ui/aura/tab_contents/web_drag_bookmark_handler_aura.h" |
#include "chrome/browser/ui/views/link_disambiguation/link_disambiguation_popup.h" |
+#include "ui/aura/client/screen_position_client.h" |
+#include "ui/aura/window.h" |
+#else |
+class LinkDisambiguationPopup {}; |
#endif |
ChromeWebContentsViewDelegateViews::ChromeWebContentsViewDelegateViews( |
@@ -48,7 +51,9 @@ content::WebDragDestDelegate* |
ChromeWebContentsViewDelegateViews::GetDragDestDelegate() { |
// We install a chrome specific handler to intercept bookmark drags for the |
// bookmark manager/extension API. |
+#if !defined(OS_MACOSX) |
bookmark_handler_.reset(new WebDragBookmarkHandlerAura); |
+#endif |
return bookmark_handler_.get(); |
} |
@@ -70,26 +75,29 @@ bool ChromeWebContentsViewDelegateViews::Focus() { |
return false; |
} |
-void ChromeWebContentsViewDelegateViews::TakeFocus(bool reverse) { |
+bool ChromeWebContentsViewDelegateViews::TakeFocus(bool reverse) { |
views::FocusManager* focus_manager = GetFocusManager(); |
if (focus_manager) |
focus_manager->AdvanceFocus(reverse); |
+ return true; |
} |
-void ChromeWebContentsViewDelegateViews::StoreFocus() { |
+bool ChromeWebContentsViewDelegateViews::StoreFocus() { |
views::ViewStorage* view_storage = views::ViewStorage::GetInstance(); |
if (view_storage->RetrieveView(last_focused_view_storage_id_) != NULL) |
view_storage->RemoveView(last_focused_view_storage_id_); |
if (!GetFocusManager()) |
- return; |
+ return true; |
+ |
views::View* focused_view = GetFocusManager()->GetFocusedView(); |
if (focused_view) |
view_storage->StoreView(last_focused_view_storage_id_, focused_view); |
+ return true; |
} |
-void ChromeWebContentsViewDelegateViews::RestoreFocus() { |
+bool ChromeWebContentsViewDelegateViews::RestoreFocus() { |
views::ViewStorage* view_storage = views::ViewStorage::GetInstance(); |
views::View* last_focused_view = |
view_storage->RetrieveView(last_focused_view_storage_id_); |
@@ -110,6 +118,7 @@ void ChromeWebContentsViewDelegateViews::RestoreFocus() { |
} |
view_storage->RemoveView(last_focused_view_storage_id_); |
} |
+ return true; |
} |
scoped_ptr<RenderViewContextMenu> ChromeWebContentsViewDelegateViews::BuildMenu( |
@@ -147,6 +156,7 @@ void ChromeWebContentsViewDelegateViews::ShowMenu( |
gfx::Point screen_point(params.x, params.y); |
+#if !defined(OS_MACOSX) |
// Convert from target window coordinates to root window coordinates. |
aura::Window* target_window = GetActiveNativeView(); |
aura::Window* root_window = target_window->GetRootWindow(); |
@@ -156,6 +166,8 @@ void ChromeWebContentsViewDelegateViews::ShowMenu( |
screen_position_client->ConvertPointToScreen(target_window, |
&screen_point); |
} |
+#endif |
+ |
// Enable recursive tasks on the message loop so we can get updates while |
// the context menu is being displayed. |
base::MessageLoop::ScopedNestableTaskAllower allow( |
@@ -200,7 +212,7 @@ void ChromeWebContentsViewDelegateViews::SizeChanged(const gfx::Size& size) { |
sad_tab->GetWidget()->SetBounds(gfx::Rect(size)); |
} |
-aura::Window* ChromeWebContentsViewDelegateViews::GetActiveNativeView() { |
+gfx::NativeView ChromeWebContentsViewDelegateViews::GetActiveNativeView() { |
return web_contents_->GetFullscreenRenderWidgetHostView() ? |
web_contents_->GetFullscreenRenderWidgetHostView()->GetNativeView() : |
web_contents_->GetNativeView(); |
@@ -227,9 +239,12 @@ void ChromeWebContentsViewDelegateViews::SetInitialFocus() { |
namespace chrome { |
+#if !defined(OS_MACOSX) |
content::WebContentsViewDelegate* CreateWebContentsViewDelegate( |
- content::WebContents* web_contents) { |
+ content::WebContents* web_contents, |
+ gfx::NativeView context) { |
return new ChromeWebContentsViewDelegateViews(web_contents); |
} |
+#endif // !defined(OS_MACOSX) |
} // namespace chrome |