| 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(OS_WIN) | 1307 #if defined(OS_WIN) |
| 1308 #if defined(USE_AURA) | 1308 #if defined(USE_AURA) |
| 1309 return NEW_POPUP; | 1309 return NEW_POPUP; |
| 1310 #else | 1310 #else |
| 1311 // If we are in windows metro-mode, we can't allow popup windows. | 1311 // If we are in windows metro-mode, we can't allow popup windows. |
| 1312 return (base::win::GetMetroModule() == NULL) ? NEW_POPUP : NEW_BACKGROUND_TAB; | 1312 return base::win::IsMetroProcess() ? NEW_BACKGROUND_TAB : NEW_POPUP; |
| 1313 #endif | 1313 #endif |
| 1314 #else | 1314 #else |
| 1315 return NEW_POPUP; | 1315 return NEW_POPUP; |
| 1316 #endif | 1316 #endif |
| 1317 } | 1317 } |
| 1318 | 1318 |
| 1319 FindBar* BrowserView::CreateFindBar() { | 1319 FindBar* BrowserView::CreateFindBar() { |
| 1320 return browser::CreateFindBar(this); | 1320 return browser::CreateFindBar(this); |
| 1321 } | 1321 } |
| 1322 | 1322 |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1478 return browser_->SupportsWindowFeature(Browser::FEATURE_TITLEBAR); | 1478 return browser_->SupportsWindowFeature(Browser::FEATURE_TITLEBAR); |
| 1479 } | 1479 } |
| 1480 | 1480 |
| 1481 bool BrowserView::ExecuteWindowsCommand(int command_id) { | 1481 bool BrowserView::ExecuteWindowsCommand(int command_id) { |
| 1482 // This function handles WM_SYSCOMMAND, WM_APPCOMMAND, and WM_COMMAND. | 1482 // This function handles WM_SYSCOMMAND, WM_APPCOMMAND, and WM_COMMAND. |
| 1483 #if defined(OS_WIN) && !defined(USE_AURA) | 1483 #if defined(OS_WIN) && !defined(USE_AURA) |
| 1484 if (command_id == IDC_DEBUG_FRAME_TOGGLE) | 1484 if (command_id == IDC_DEBUG_FRAME_TOGGLE) |
| 1485 GetWidget()->DebugToggleFrameType(); | 1485 GetWidget()->DebugToggleFrameType(); |
| 1486 | 1486 |
| 1487 // In Windows 8 metro mode prevent sizing and moving. | 1487 // In Windows 8 metro mode prevent sizing and moving. |
| 1488 if (base::win::GetMetroModule()) { | 1488 if (base::win::IsMetroProcess()) { |
| 1489 // Windows uses the 4 lower order bits of |notification_code| for type- | 1489 // Windows uses the 4 lower order bits of |notification_code| for type- |
| 1490 // specific information so we must exclude this when comparing. | 1490 // specific information so we must exclude this when comparing. |
| 1491 static const int sc_mask = 0xFFF0; | 1491 static const int sc_mask = 0xFFF0; |
| 1492 if (((command_id & sc_mask) == SC_MOVE) || | 1492 if (((command_id & sc_mask) == SC_MOVE) || |
| 1493 ((command_id & sc_mask) == SC_SIZE) || | 1493 ((command_id & sc_mask) == SC_SIZE) || |
| 1494 ((command_id & sc_mask) == SC_MAXIMIZE)) | 1494 ((command_id & sc_mask) == SC_MAXIMIZE)) |
| 1495 return true; | 1495 return true; |
| 1496 } | 1496 } |
| 1497 #endif | 1497 #endif |
| 1498 // Translate WM_APPCOMMAND command ids into a command id that the browser | 1498 // Translate WM_APPCOMMAND command ids into a command id that the browser |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1794 void BrowserView::OnSysColorChange() { | 1794 void BrowserView::OnSysColorChange() { |
| 1795 browser::MaybeShowInvertBubbleView(browser_->profile(), contents_); | 1795 browser::MaybeShowInvertBubbleView(browser_->profile(), contents_); |
| 1796 } | 1796 } |
| 1797 | 1797 |
| 1798 int BrowserView::GetOTRIconResourceID() const { | 1798 int BrowserView::GetOTRIconResourceID() const { |
| 1799 int otr_resource_id = IDR_OTR_ICON; | 1799 int otr_resource_id = IDR_OTR_ICON; |
| 1800 if (ui::GetDisplayLayout() == ui::LAYOUT_TOUCH) { | 1800 if (ui::GetDisplayLayout() == ui::LAYOUT_TOUCH) { |
| 1801 if (IsFullscreen()) | 1801 if (IsFullscreen()) |
| 1802 otr_resource_id = IDR_OTR_ICON_FULLSCREEN; | 1802 otr_resource_id = IDR_OTR_ICON_FULLSCREEN; |
| 1803 #if defined(OS_WIN) && !defined(USE_AURA) | 1803 #if defined(OS_WIN) && !defined(USE_AURA) |
| 1804 if (base::win::GetMetroModule() != NULL) | 1804 if (base::win::IsMetroProcess()) |
| 1805 otr_resource_id = IDR_OTR_ICON_FULLSCREEN; | 1805 otr_resource_id = IDR_OTR_ICON_FULLSCREEN; |
| 1806 #endif | 1806 #endif |
| 1807 } | 1807 } |
| 1808 | 1808 |
| 1809 return otr_resource_id; | 1809 return otr_resource_id; |
| 1810 } | 1810 } |
| 1811 | 1811 |
| 1812 views::LayoutManager* BrowserView::CreateLayoutManager() const { | 1812 views::LayoutManager* BrowserView::CreateLayoutManager() const { |
| 1813 return new BrowserViewLayout; | 1813 return new BrowserViewLayout; |
| 1814 } | 1814 } |
| (...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2469 this, | 2469 this, |
| 2470 tab_contents->web_contents()->GetRenderViewHost(), | 2470 tab_contents->web_contents()->GetRenderViewHost(), |
| 2471 password_generator, | 2471 password_generator, |
| 2472 browser_.get(), | 2472 browser_.get(), |
| 2473 tab_contents->password_manager()); | 2473 tab_contents->password_manager()); |
| 2474 | 2474 |
| 2475 views::BubbleDelegateView::CreateBubble(bubble); | 2475 views::BubbleDelegateView::CreateBubble(bubble); |
| 2476 bubble->SetAlignment(views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR); | 2476 bubble->SetAlignment(views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR); |
| 2477 bubble->Show(); | 2477 bubble->Show(); |
| 2478 } | 2478 } |
| OLD | NEW |