| OLD | NEW |
| 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 1796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1807 // BrowserView. By destroying here we ensure all said classes are valid. | 1807 // BrowserView. By destroying here we ensure all said classes are valid. |
| 1808 ScopedVector<content::WebContents> contents; | 1808 ScopedVector<content::WebContents> contents; |
| 1809 while (browser()->tab_strip_model()->count()) | 1809 while (browser()->tab_strip_model()->count()) |
| 1810 contents.push_back(browser()->tab_strip_model()->DetachWebContentsAt(0)); | 1810 contents.push_back(browser()->tab_strip_model()->DetachWebContentsAt(0)); |
| 1811 } | 1811 } |
| 1812 | 1812 |
| 1813 void BrowserView::OnWidgetActivationChanged(views::Widget* widget, | 1813 void BrowserView::OnWidgetActivationChanged(views::Widget* widget, |
| 1814 bool active) { | 1814 bool active) { |
| 1815 if (active) | 1815 if (active) |
| 1816 BrowserList::SetLastActive(browser_.get()); | 1816 BrowserList::SetLastActive(browser_.get()); |
| 1817 else |
| 1818 BrowserList::NotifyBrowserNoLongerActive(browser_.get()); |
| 1817 | 1819 |
| 1818 if (!extension_keybinding_registry_ && | 1820 if (!extension_keybinding_registry_ && |
| 1819 GetFocusManager()) { // focus manager can be null in tests. | 1821 GetFocusManager()) { // focus manager can be null in tests. |
| 1820 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryViews( | 1822 extension_keybinding_registry_.reset(new ExtensionKeybindingRegistryViews( |
| 1821 browser_->profile(), GetFocusManager(), | 1823 browser_->profile(), GetFocusManager(), |
| 1822 extensions::ExtensionKeybindingRegistry::ALL_EXTENSIONS, this)); | 1824 extensions::ExtensionKeybindingRegistry::ALL_EXTENSIONS, this)); |
| 1823 } | 1825 } |
| 1824 | 1826 |
| 1825 extensions::ExtensionCommandsGlobalRegistry* registry = | 1827 extensions::ExtensionCommandsGlobalRegistry* registry = |
| 1826 extensions::ExtensionCommandsGlobalRegistry::Get(browser_->profile()); | 1828 extensions::ExtensionCommandsGlobalRegistry::Get(browser_->profile()); |
| (...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2653 } | 2655 } |
| 2654 | 2656 |
| 2655 extensions::ActiveTabPermissionGranter* | 2657 extensions::ActiveTabPermissionGranter* |
| 2656 BrowserView::GetActiveTabPermissionGranter() { | 2658 BrowserView::GetActiveTabPermissionGranter() { |
| 2657 content::WebContents* web_contents = GetActiveWebContents(); | 2659 content::WebContents* web_contents = GetActiveWebContents(); |
| 2658 if (!web_contents) | 2660 if (!web_contents) |
| 2659 return nullptr; | 2661 return nullptr; |
| 2660 return extensions::TabHelper::FromWebContents(web_contents) | 2662 return extensions::TabHelper::FromWebContents(web_contents) |
| 2661 ->active_tab_permission_granter(); | 2663 ->active_tab_permission_granter(); |
| 2662 } | 2664 } |
| OLD | NEW |