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

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

Issue 2015223002: MacViews: Fixed BrowserViewTest.CloseWithTabsStartWithActive. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove DestroyBrowserWebContents. Created 4 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
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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 1734 matching lines...) Expand 10 before | Expand all | Expand 10 after
1745 } 1745 }
1746 1746
1747 views::View* BrowserView::GetContentsView() { 1747 views::View* BrowserView::GetContentsView() {
1748 return contents_web_view_; 1748 return contents_web_view_;
1749 } 1749 }
1750 1750
1751 views::ClientView* BrowserView::CreateClientView(views::Widget* widget) { 1751 views::ClientView* BrowserView::CreateClientView(views::Widget* widget) {
1752 return this; 1752 return this;
1753 } 1753 }
1754 1754
1755 void BrowserView::OnWidgetDestroying(views::Widget* widget) {
1756 // Destroy any remaining WebContents early on. Doing so may result in
1757 // calling back to one of the Views/LayoutManagers or supporting classes of
1758 // BrowserView. By destroying here we ensure all said classes are valid.
1759 ScopedVector<content::WebContents> contents;
1760 while (browser()->tab_strip_model()->count())
1761 contents.push_back(browser()->tab_strip_model()->DetachWebContentsAt(0));
1762 }
1763
1755 void BrowserView::OnWidgetActivationChanged(views::Widget* widget, 1764 void BrowserView::OnWidgetActivationChanged(views::Widget* widget,
1756 bool active) { 1765 bool active) {
1757 if (active) 1766 if (active)
1758 BrowserList::SetLastActive(browser_.get()); 1767 BrowserList::SetLastActive(browser_.get());
1759 1768
1760 if (!extension_keybinding_registry_ && 1769 if (!extension_keybinding_registry_ &&
1761 GetFocusManager()) { // focus manager can be null in tests. 1770 GetFocusManager()) { // focus manager can be null in tests.
1762 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryViews( 1771 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryViews(
1763 browser_->profile(), GetFocusManager(), 1772 browser_->profile(), GetFocusManager(),
1764 extensions::ExtensionKeybindingRegistry::ALL_EXTENSIONS, this)); 1773 extensions::ExtensionKeybindingRegistry::ALL_EXTENSIONS, this));
(...skipping 830 matching lines...) Expand 10 before | Expand all | Expand 10 after
2595 } 2604 }
2596 2605
2597 extensions::ActiveTabPermissionGranter* 2606 extensions::ActiveTabPermissionGranter*
2598 BrowserView::GetActiveTabPermissionGranter() { 2607 BrowserView::GetActiveTabPermissionGranter() {
2599 content::WebContents* web_contents = GetActiveWebContents(); 2608 content::WebContents* web_contents = GetActiveWebContents();
2600 if (!web_contents) 2609 if (!web_contents)
2601 return nullptr; 2610 return nullptr;
2602 return extensions::TabHelper::FromWebContents(web_contents) 2611 return extensions::TabHelper::FromWebContents(web_contents)
2603 ->active_tab_permission_granter(); 2612 ->active_tab_permission_granter();
2604 } 2613 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.h ('k') | chrome/browser/ui/views/frame/desktop_browser_frame_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698