Chromium Code Reviews| Index: chrome/browser/ui/views/frame/browser_view.cc |
| diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc |
| index 741a976b473d1f7cda130e6145ed4abb25c33c6a..ae4ff46ebdedd62c4018e7eadf55ba505dc80a6a 100644 |
| --- a/chrome/browser/ui/views/frame/browser_view.cc |
| +++ b/chrome/browser/ui/views/frame/browser_view.cc |
| @@ -108,14 +108,12 @@ |
| #include "content/public/browser/notification_service.h" |
| #include "content/public/browser/render_frame_host.h" |
| #include "content/public/browser/render_view_host.h" |
| +#include "content/public/browser/render_widget_host_view.h" |
| #include "content/public/browser/user_metrics.h" |
| #include "content/public/browser/web_contents.h" |
| #include "content/public/common/content_switches.h" |
| #include "grit/theme_resources.h" |
| #include "ui/accessibility/ax_view_state.h" |
| -#include "ui/aura/client/window_tree_client.h" |
| -#include "ui/aura/window.h" |
| -#include "ui/aura/window_tree_host.h" |
| #include "ui/base/accelerators/accelerator.h" |
| #include "ui/base/hit_test.h" |
| #include "ui/base/l10n/l10n_util.h" |
| @@ -138,6 +136,12 @@ |
| #include "ui/views/widget/widget.h" |
| #include "ui/views/window/dialog_delegate.h" |
| +#if defined(USE_AURA) |
| +#include "ui/aura/client/window_tree_client.h" |
| +#include "ui/aura/window.h" |
| +#include "ui/aura/window_tree_host.h" |
| +#endif |
| + |
| #if defined(OS_WIN) |
| #include "base/win/windows_version.h" |
| #include "chrome/browser/jumplist_win.h" |
| @@ -1378,6 +1382,26 @@ void BrowserView::Paste() { |
| DoCutCopyPaste(&content::WebContents::Paste, IDS_APP_PASTE); |
| } |
| +#if defined(OS_MACOSX) |
| +void BrowserView::EnterFullscreenWithChrome() { |
| + NOTIMPLEMENTED(); |
| +} |
| + |
| +void BrowserView::EnterFullscreenWithoutChrome() { |
| + NOTIMPLEMENTED(); |
| +} |
| + |
| +bool BrowserView::IsFullscreenWithChrome() { |
| + NOTIMPLEMENTED(); |
| + return false; |
| +} |
| + |
| +bool BrowserView::IsFullscreenWithoutChrome() { |
| + NOTIMPLEMENTED(); |
| + return false; |
| +} |
| +#endif |
| + |
| WindowOpenDisposition BrowserView::GetDispositionForPopupBounds( |
| const gfx::Rect& bounds) { |
| return NEW_POPUP; |
| @@ -1416,6 +1440,7 @@ ToolbarView* BrowserView::GetToolbarView() const { |
| void BrowserView::TabInsertedAt(WebContents* contents, |
| int index, |
| bool foreground) { |
| +#if defined(USE_AURA) |
|
tapted
2014/11/04 02:33:42
We'll likely need something here for Mac.. (and it
Andre
2014/11/05 02:04:23
The problem is that we will need this code in both
tapted
2014/11/05 05:00:47
yeah - it looks tricky to get BrowserFrameAsh/Aura
|
| // WebContents inserted in tabs might not have been added to the root |
| // window yet. Per http://crbug/342672 add them now since drawing the |
| // WebContents requires root window specific data - information about |
| @@ -1427,6 +1452,7 @@ void BrowserView::TabInsertedAt(WebContents* contents, |
| window, root_window, root_window->GetBoundsInScreen()); |
| DCHECK(contents->GetNativeView()->GetRootWindow()); |
| } |
| +#endif |
| web_contents_close_handler_->TabInserted(); |
| if (foreground) |
| @@ -2366,24 +2392,6 @@ void BrowserView::UpdateAcceleratorMetrics(const ui::Accelerator& accelerator, |
| #endif |
| } |
| -// static |
| -BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { |
| - // Create the view and the frame. The frame will attach itself via the view |
| - // so we don't need to do anything with the pointer. |
| - BrowserView* view = new BrowserView(); |
| - view->Init(browser); |
| - (new BrowserFrame(view))->InitBrowserFrame(); |
| - view->GetWidget()->non_client_view()->SetAccessibleName( |
| - l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); |
| - return view; |
| -} |
| - |
| -// static |
| -chrome::HostDesktopType BrowserWindow::AdjustHostDesktopType( |
| - chrome::HostDesktopType desktop_type) { |
| - return NativeBrowserFrameFactory::AdjustHostDesktopType(desktop_type); |
| -} |
| - |
| void BrowserView::ShowAvatarBubble(WebContents* web_contents, |
| const gfx::Rect& rect) { |
| gfx::Point origin(rect.origin()); |
| @@ -2477,10 +2485,7 @@ void BrowserView::DoCutCopyPaste(void (WebContents::*method)(), |
| bool BrowserView::DoCutCopyPasteForWebContents( |
| WebContents* contents, |
| void (WebContents::*method)()) { |
| - gfx::NativeView native_view = contents->GetContentNativeView(); |
| - if (!native_view) |
| - return false; |
| - if (native_view->HasFocus()) { |
| + if (contents->GetRenderWidgetHostView()->HasFocus()) { |
| (contents->*method)(); |
| return true; |
| } |
| @@ -2520,3 +2525,23 @@ int BrowserView::GetMaxTopInfoBarArrowHeight() { |
| } |
| return top_arrow_height; |
| } |
| + |
| +#if !defined(OS_MACOSX) || defined(MAC_VIEWS_BROWSER) |
| +// static |
| +BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { |
|
tapted
2014/11/04 02:33:43
move these to browser_window_factory.cc?
Andre
2014/11/05 02:04:23
Done.
|
| + // Create the view and the frame. The frame will attach itself via the view |
| + // so we don't need to do anything with the pointer. |
| + BrowserView* view = new BrowserView(); |
| + view->Init(browser); |
| + (new BrowserFrame(view))->InitBrowserFrame(); |
| + view->GetWidget()->non_client_view()->SetAccessibleName( |
| + l10n_util::GetStringUTF16(IDS_PRODUCT_NAME)); |
| + return view; |
| +} |
| + |
| +// static |
| +chrome::HostDesktopType BrowserWindow::AdjustHostDesktopType( |
| + chrome::HostDesktopType desktop_type) { |
| + return NativeBrowserFrameFactory::AdjustHostDesktopType(desktop_type); |
| +} |
| +#endif |