Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Side by Side Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 10560015: Implement base::win::IsMetroProcess. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1295 matching lines...) Expand 10 before | Expand all | Expand 10 after
1306 return contents_->GetPreviewBounds(); 1306 return contents_->GetPreviewBounds();
1307 } 1307 }
1308 1308
1309 WindowOpenDisposition BrowserView::GetDispositionForPopupBounds( 1309 WindowOpenDisposition BrowserView::GetDispositionForPopupBounds(
1310 const gfx::Rect& bounds) { 1310 const gfx::Rect& bounds) {
1311 #if defined(OS_WIN) 1311 #if defined(OS_WIN)
1312 #if defined(USE_AURA) 1312 #if defined(USE_AURA)
1313 return NEW_POPUP; 1313 return NEW_POPUP;
1314 #else 1314 #else
1315 // If we are in windows metro-mode, we can't allow popup windows. 1315 // If we are in windows metro-mode, we can't allow popup windows.
1316 return (base::win::GetMetroModule() == NULL) ? NEW_POPUP : NEW_BACKGROUND_TAB; 1316 return base::win::InMetroMode() ? NEW_BACKGROUND_TAB : NEW_POPUP;
1317 #endif 1317 #endif
1318 #else 1318 #else
1319 return NEW_POPUP; 1319 return NEW_POPUP;
1320 #endif 1320 #endif
1321 } 1321 }
1322 1322
1323 FindBar* BrowserView::CreateFindBar() { 1323 FindBar* BrowserView::CreateFindBar() {
1324 return browser::CreateFindBar(this); 1324 return browser::CreateFindBar(this);
1325 } 1325 }
1326 1326
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
1482 return browser_->SupportsWindowFeature(Browser::FEATURE_TITLEBAR); 1482 return browser_->SupportsWindowFeature(Browser::FEATURE_TITLEBAR);
1483 } 1483 }
1484 1484
1485 bool BrowserView::ExecuteWindowsCommand(int command_id) { 1485 bool BrowserView::ExecuteWindowsCommand(int command_id) {
1486 // This function handles WM_SYSCOMMAND, WM_APPCOMMAND, and WM_COMMAND. 1486 // This function handles WM_SYSCOMMAND, WM_APPCOMMAND, and WM_COMMAND.
1487 #if defined(OS_WIN) && !defined(USE_AURA) 1487 #if defined(OS_WIN) && !defined(USE_AURA)
1488 if (command_id == IDC_DEBUG_FRAME_TOGGLE) 1488 if (command_id == IDC_DEBUG_FRAME_TOGGLE)
1489 GetWidget()->DebugToggleFrameType(); 1489 GetWidget()->DebugToggleFrameType();
1490 1490
1491 // In Windows 8 metro mode prevent sizing and moving. 1491 // In Windows 8 metro mode prevent sizing and moving.
1492 if (base::win::GetMetroModule()) { 1492 if (base::win::InMetroMode()) {
1493 // Windows uses the 4 lower order bits of |notification_code| for type- 1493 // Windows uses the 4 lower order bits of |notification_code| for type-
1494 // specific information so we must exclude this when comparing. 1494 // specific information so we must exclude this when comparing.
1495 static const int sc_mask = 0xFFF0; 1495 static const int sc_mask = 0xFFF0;
1496 if (((command_id & sc_mask) == SC_MOVE) || 1496 if (((command_id & sc_mask) == SC_MOVE) ||
1497 ((command_id & sc_mask) == SC_SIZE) || 1497 ((command_id & sc_mask) == SC_SIZE) ||
1498 ((command_id & sc_mask) == SC_MAXIMIZE)) 1498 ((command_id & sc_mask) == SC_MAXIMIZE))
1499 return true; 1499 return true;
1500 } 1500 }
1501 #endif 1501 #endif
1502 // Translate WM_APPCOMMAND command ids into a command id that the browser 1502 // Translate WM_APPCOMMAND command ids into a command id that the browser
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
1798 void BrowserView::OnSysColorChange() { 1798 void BrowserView::OnSysColorChange() {
1799 browser::MaybeShowInvertBubbleView(browser_->profile(), contents_); 1799 browser::MaybeShowInvertBubbleView(browser_->profile(), contents_);
1800 } 1800 }
1801 1801
1802 int BrowserView::GetOTRIconResourceID() const { 1802 int BrowserView::GetOTRIconResourceID() const {
1803 int otr_resource_id = IDR_OTR_ICON; 1803 int otr_resource_id = IDR_OTR_ICON;
1804 if (ui::GetDisplayLayout() == ui::LAYOUT_TOUCH) { 1804 if (ui::GetDisplayLayout() == ui::LAYOUT_TOUCH) {
1805 if (IsFullscreen()) 1805 if (IsFullscreen())
1806 otr_resource_id = IDR_OTR_ICON_FULLSCREEN; 1806 otr_resource_id = IDR_OTR_ICON_FULLSCREEN;
1807 #if defined(OS_WIN) && !defined(USE_AURA) 1807 #if defined(OS_WIN) && !defined(USE_AURA)
1808 if (base::win::GetMetroModule() != NULL) 1808 if (base::win::InMetroMode() != NULL)
ananta 2012/06/15 21:46:19 remove != NULL
Sigurður Ásgeirsson 2012/06/18 13:54:15 Done.
1809 otr_resource_id = IDR_OTR_ICON_FULLSCREEN; 1809 otr_resource_id = IDR_OTR_ICON_FULLSCREEN;
1810 #endif 1810 #endif
1811 } 1811 }
1812 1812
1813 return otr_resource_id; 1813 return otr_resource_id;
1814 } 1814 }
1815 1815
1816 views::LayoutManager* BrowserView::CreateLayoutManager() const { 1816 views::LayoutManager* BrowserView::CreateLayoutManager() const {
1817 return new BrowserViewLayout; 1817 return new BrowserViewLayout;
1818 } 1818 }
(...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after
2473 this, 2473 this,
2474 tab_contents->web_contents()->GetRenderViewHost(), 2474 tab_contents->web_contents()->GetRenderViewHost(),
2475 password_generator, 2475 password_generator,
2476 browser_.get(), 2476 browser_.get(),
2477 tab_contents->password_manager()); 2477 tab_contents->password_manager());
2478 2478
2479 views::BubbleDelegateView::CreateBubble(bubble); 2479 views::BubbleDelegateView::CreateBubble(bubble);
2480 bubble->SetAlignment(views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR); 2480 bubble->SetAlignment(views::BubbleBorder::ALIGN_ARROW_TO_MID_ANCHOR);
2481 bubble->Show(); 2481 bubble->Show();
2482 } 2482 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698