| 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 374305aa739b2ed5706bc890b4474ec42105da3b..042039ad1116b758f0236ff7462c70bd22a74ae1 100644
|
| --- a/chrome/browser/ui/views/frame/browser_view.cc
|
| +++ b/chrome/browser/ui/views/frame/browser_view.cc
|
| @@ -383,37 +383,19 @@ BrowserView::~BrowserView() {
|
| browser_.reset();
|
| }
|
|
|
| +// Tab dragging code on windows needs this.
|
| +#if defined(OS_WIN) && !defined(USE_AURA)
|
| // static
|
| BrowserView* BrowserView::GetBrowserViewForNativeWindow(
|
| gfx::NativeWindow window) {
|
| -#if defined(USE_AURA)
|
| - // TODO(beng):
|
| - NOTIMPLEMENTED();
|
| -#elif defined(OS_WIN)
|
| - if (IsWindow(window)) {
|
| - return reinterpret_cast<BrowserView*>(
|
| - ui::ViewProp::GetValue(window, kBrowserViewKey));
|
| - }
|
| -#else
|
| - BrowserView* browser_view = NULL;
|
| - if (window) {
|
| - browser_view = static_cast<BrowserView*>(
|
| - g_object_get_data(G_OBJECT(window), kBrowserViewKey));
|
| -
|
| -#if defined(TOUCH_UI)
|
| - if (!browser_view) {
|
| - // With views-desktop, we cannot determine the BrowserView from the
|
| - // NativeWindow. So do the next best thing, and assume the last active
|
| - // BrowserView is what we want.
|
| - Browser* browser = BrowserList::GetLastActive();
|
| - if (browser && !browser->is_type_popup() && !browser->is_type_panel())
|
| - browser_view = reinterpret_cast<BrowserView*>(browser->window());
|
| - }
|
| -#endif
|
| - }
|
| - return browser_view;
|
| + return IsWindow(window) ? reinterpret_cast<BrowserView*>(
|
| + ui::ViewProp::GetValue(window, kBrowserViewKey)) : NULL;
|
| +}
|
| #endif
|
| - return NULL;
|
| +
|
| +// static
|
| +BrowserView* BrowserView::GetBrowserViewForBrowser(Browser* browser) {
|
| + return static_cast<BrowserView*>(browser->window());
|
| }
|
|
|
| gfx::Rect BrowserView::GetToolbarBounds() const {
|
| @@ -1172,9 +1154,7 @@ void BrowserView::ShowPageInfo(Profile* profile,
|
| const GURL& url,
|
| const NavigationEntry::SSLStatus& ssl,
|
| bool show_history) {
|
| - gfx::NativeWindow parent = GetWidget()->GetNativeWindow();
|
| -
|
| - browser::ShowPageInfoBubble(parent, profile, url, ssl, show_history);
|
| + browser::ShowPageInfoBubble(browser_.get(), profile, url, ssl, show_history);
|
| }
|
|
|
| void BrowserView::ShowAppMenu() {
|
|
|