OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/views/frame/browser_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 1291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1302 return contents_->GetPreviewBounds(); | 1302 return contents_->GetPreviewBounds(); |
1303 } | 1303 } |
1304 | 1304 |
1305 WindowOpenDisposition BrowserView::GetDispositionForPopupBounds( | 1305 WindowOpenDisposition BrowserView::GetDispositionForPopupBounds( |
1306 const gfx::Rect& bounds) { | 1306 const gfx::Rect& bounds) { |
1307 #if defined(USE_AURA) | 1307 #if defined(USE_AURA) |
1308 gfx::Size window_size = gfx::Screen::GetMonitorNearestWindow( | 1308 gfx::Size window_size = gfx::Screen::GetMonitorNearestWindow( |
1309 GetWidget()->GetNativeView()).size(); | 1309 GetWidget()->GetNativeView()).size(); |
1310 return browser::DispositionForPopupBounds( | 1310 return browser::DispositionForPopupBounds( |
1311 bounds, window_size.width(), window_size.height()); | 1311 bounds, window_size.width(), window_size.height()); |
| 1312 #elif defined(OS_WIN) |
| 1313 // If we are in windows metro-mode, we can't allow popup windows. |
| 1314 return (base::win::GetMetroModule() == NULL) ? NEW_POPUP : NEW_BACKGROUND_TAB; |
1312 #else | 1315 #else |
1313 return NEW_POPUP; | 1316 return NEW_POPUP; |
1314 #endif | 1317 #endif |
1315 } | 1318 } |
1316 | 1319 |
1317 FindBar* BrowserView::CreateFindBar() { | 1320 FindBar* BrowserView::CreateFindBar() { |
1318 return browser::CreateFindBar(this); | 1321 return browser::CreateFindBar(this); |
1319 } | 1322 } |
1320 | 1323 |
1321 #if defined(OS_CHROMEOS) | 1324 #if defined(OS_CHROMEOS) |
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2469 return; | 2472 return; |
2470 | 2473 |
2471 PasswordGenerationBubbleView* bubble = | 2474 PasswordGenerationBubbleView* bubble = |
2472 new PasswordGenerationBubbleView(bounds, | 2475 new PasswordGenerationBubbleView(bounds, |
2473 this, | 2476 this, |
2474 web_contents->GetRenderViewHost()); | 2477 web_contents->GetRenderViewHost()); |
2475 views::BubbleDelegateView::CreateBubble(bubble); | 2478 views::BubbleDelegateView::CreateBubble(bubble); |
2476 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); | 2479 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); |
2477 bubble->Show(); | 2480 bubble->Show(); |
2478 } | 2481 } |
OLD | NEW |