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

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

Issue 15690015: Fix crash when JS alert from background page appears during lock screen (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: JavascriptDialogTest.CopyFromIncognito on win7_aura Created 7 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
« ash/wm/stacking_controller.cc ('K') | « ash/wm/stacking_controller.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 1537 matching lines...) Expand 10 before | Expand all | Expand 10 after
1548 } 1548 }
1549 1549
1550 bool BrowserView::CanMaximize() const { 1550 bool BrowserView::CanMaximize() const {
1551 return true; 1551 return true;
1552 } 1552 }
1553 1553
1554 bool BrowserView::CanActivate() const { 1554 bool BrowserView::CanActivate() const {
1555 if (!AppModalDialogQueue::GetInstance()->active_dialog()) 1555 if (!AppModalDialogQueue::GetInstance()->active_dialog())
1556 return true; 1556 return true;
1557 1557
1558 #if defined(USE_AURA) && defined(OS_CHROMEOS)
1559 // On Aura window manager controls all windows so settings focus via PostTask
1560 // will make only worse because posted task will keep trying to steal focus.
1561 AppModalDialogQueue::GetInstance()->ActivateModalDialog();
1562 #else
1558 // If another browser is app modal, flash and activate the modal browser. This 1563 // If another browser is app modal, flash and activate the modal browser. This
1559 // has to be done in a post task, otherwise if the user clicked on a window 1564 // has to be done in a post task, otherwise if the user clicked on a window
1560 // that doesn't have the modal dialog the windows keep trying to get the focus 1565 // that doesn't have the modal dialog the windows keep trying to get the focus
1561 // from each other on Windows. http://crbug.com/141650. 1566 // from each other on Windows. http://crbug.com/141650.
1562 base::MessageLoop::current()->PostTask( 1567 base::MessageLoop::current()->PostTask(
1563 FROM_HERE, 1568 FROM_HERE,
1564 base::Bind(&BrowserView::ActivateAppModalDialog, 1569 base::Bind(&BrowserView::ActivateAppModalDialog,
1565 activate_modal_dialog_factory_.GetWeakPtr())); 1570 activate_modal_dialog_factory_.GetWeakPtr()));
1571 #endif
1566 return false; 1572 return false;
1567 } 1573 }
1568 1574
1569 string16 BrowserView::GetWindowTitle() const { 1575 string16 BrowserView::GetWindowTitle() const {
1570 return browser_->GetWindowTitleForCurrentTab(); 1576 return browser_->GetWindowTitleForCurrentTab();
1571 } 1577 }
1572 1578
1573 string16 BrowserView::GetAccessibleWindowTitle() const { 1579 string16 BrowserView::GetAccessibleWindowTitle() const {
1574 if (IsOffTheRecord()) { 1580 if (IsOffTheRecord()) {
1575 return l10n_util::GetStringFUTF16( 1581 return l10n_util::GetStringFUTF16(
(...skipping 1184 matching lines...) Expand 10 before | Expand all | Expand 10 after
2760 // The +1 in the next line creates a 1-px gap between icon and arrow tip. 2766 // The +1 in the next line creates a 1-px gap between icon and arrow tip.
2761 gfx::Point icon_bottom(0, location_icon_view->GetImageBounds().bottom() - 2767 gfx::Point icon_bottom(0, location_icon_view->GetImageBounds().bottom() -
2762 LocationBarView::kIconInternalPadding + 1); 2768 LocationBarView::kIconInternalPadding + 1);
2763 ConvertPointToTarget(location_icon_view, this, &icon_bottom); 2769 ConvertPointToTarget(location_icon_view, this, &icon_bottom);
2764 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL)); 2770 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(NULL));
2765 ConvertPointToTarget(infobar_container_, this, &infobar_top); 2771 ConvertPointToTarget(infobar_container_, this, &infobar_top);
2766 top_arrow_height = infobar_top.y() - icon_bottom.y(); 2772 top_arrow_height = infobar_top.y() - icon_bottom.y();
2767 } 2773 }
2768 return top_arrow_height; 2774 return top_arrow_height;
2769 } 2775 }
OLDNEW
« ash/wm/stacking_controller.cc ('K') | « ash/wm/stacking_controller.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698