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

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

Issue 2046653002: [UI Views] Unset the extension keybinding registry on frame destruction (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | 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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <memory> 10 #include <memory>
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 browser_->tab_strip_model()->RemoveObserver(this); 472 browser_->tab_strip_model()->RemoveObserver(this);
473 473
474 #if defined(OS_WIN) 474 #if defined(OS_WIN)
475 // Terminate the jumplist (must be called before browser_->profile() is 475 // Terminate the jumplist (must be called before browser_->profile() is
476 // destroyed. 476 // destroyed.
477 if (jumplist_.get()) { 477 if (jumplist_.get()) {
478 jumplist_->Terminate(); 478 jumplist_->Terminate();
479 } 479 }
480 #endif 480 #endif
481 481
482 extensions::ExtensionCommandsGlobalRegistry* global_registry =
483 extensions::ExtensionCommandsGlobalRegistry::Get(browser_->profile());
484 if (global_registry->registry_for_active_window() ==
485 extension_keybinding_registry_.get())
486 global_registry->set_registry_for_active_window(nullptr);
487
482 // We destroy the download shelf before |browser_| to remove its child 488 // We destroy the download shelf before |browser_| to remove its child
483 // download views from the set of download observers (since the observed 489 // download views from the set of download observers (since the observed
484 // downloads can be destroyed along with |browser_| and the observer 490 // downloads can be destroyed along with |browser_| and the observer
485 // notifications will call back into deleted objects). 491 // notifications will call back into deleted objects).
486 BrowserViewLayout* browser_view_layout = GetBrowserViewLayout(); 492 BrowserViewLayout* browser_view_layout = GetBrowserViewLayout();
487 if (browser_view_layout) 493 if (browser_view_layout)
488 browser_view_layout->set_download_shelf(nullptr); 494 browser_view_layout->set_download_shelf(nullptr);
489 download_shelf_.reset(); 495 download_shelf_.reset();
490 496
491 // The TabStrip attaches a listener to the model. Make sure we shut down the 497 // The TabStrip attaches a listener to the model. Make sure we shut down the
(...skipping 2129 matching lines...) Expand 10 before | Expand all | Expand 10 after
2621 } 2627 }
2622 2628
2623 extensions::ActiveTabPermissionGranter* 2629 extensions::ActiveTabPermissionGranter*
2624 BrowserView::GetActiveTabPermissionGranter() { 2630 BrowserView::GetActiveTabPermissionGranter() {
2625 content::WebContents* web_contents = GetActiveWebContents(); 2631 content::WebContents* web_contents = GetActiveWebContents();
2626 if (!web_contents) 2632 if (!web_contents)
2627 return nullptr; 2633 return nullptr;
2628 return extensions::TabHelper::FromWebContents(web_contents) 2634 return extensions::TabHelper::FromWebContents(web_contents)
2629 ->active_tab_permission_granter(); 2635 ->active_tab_permission_granter();
2630 } 2636 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698