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