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 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 | 161 |
162 #if defined(USE_AURA) | 162 #if defined(USE_AURA) |
163 #include "ui/aura/client/window_tree_client.h" | 163 #include "ui/aura/client/window_tree_client.h" |
164 #include "ui/aura/window.h" | 164 #include "ui/aura/window.h" |
165 #include "ui/aura/window_tree_host.h" | 165 #include "ui/aura/window_tree_host.h" |
166 #endif | 166 #endif |
167 | 167 |
168 #if defined(OS_WIN) | 168 #if defined(OS_WIN) |
169 #include "base/win/windows_version.h" | 169 #include "base/win/windows_version.h" |
170 #include "chrome/browser/win/jumplist.h" | 170 #include "chrome/browser/win/jumplist.h" |
| 171 #include "chrome/browser/win/jumplist_factory.h" |
171 #include "ui/gfx/color_palette.h" | 172 #include "ui/gfx/color_palette.h" |
172 #include "ui/native_theme/native_theme_dark_win.h" | 173 #include "ui/native_theme/native_theme_dark_win.h" |
173 #include "ui/views/win/scoped_fullscreen_visibility.h" | 174 #include "ui/views/win/scoped_fullscreen_visibility.h" |
174 #endif | 175 #endif |
175 | 176 |
176 #if BUILDFLAG(ENABLE_ONE_CLICK_SIGNIN) | 177 #if BUILDFLAG(ENABLE_ONE_CLICK_SIGNIN) |
177 #include "chrome/browser/ui/sync/one_click_signin_links_delegate_impl.h" | 178 #include "chrome/browser/ui/sync/one_click_signin_links_delegate_impl.h" |
178 #include "chrome/browser/ui/views/sync/one_click_signin_dialog_view.h" | 179 #include "chrome/browser/ui/views/sync/one_click_signin_dialog_view.h" |
179 #endif | 180 #endif |
180 | 181 |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 BrowserView::~BrowserView() { | 460 BrowserView::~BrowserView() { |
460 // All the tabs should have been destroyed already. If we were closed by the | 461 // All the tabs should have been destroyed already. If we were closed by the |
461 // OS with some tabs than the NativeBrowserFrame should have destroyed them. | 462 // OS with some tabs than the NativeBrowserFrame should have destroyed them. |
462 DCHECK_EQ(0, browser_->tab_strip_model()->count()); | 463 DCHECK_EQ(0, browser_->tab_strip_model()->count()); |
463 | 464 |
464 // Immersive mode may need to reparent views before they are removed/deleted. | 465 // Immersive mode may need to reparent views before they are removed/deleted. |
465 immersive_mode_controller_.reset(); | 466 immersive_mode_controller_.reset(); |
466 | 467 |
467 browser_->tab_strip_model()->RemoveObserver(this); | 468 browser_->tab_strip_model()->RemoveObserver(this); |
468 | 469 |
469 #if defined(OS_WIN) | |
470 // Terminate the jumplist (must be called before browser_->profile() is | |
471 // destroyed. | |
472 if (jumplist_.get()) { | |
473 jumplist_->Terminate(); | |
474 } | |
475 #endif | |
476 | |
477 extensions::ExtensionCommandsGlobalRegistry* global_registry = | 470 extensions::ExtensionCommandsGlobalRegistry* global_registry = |
478 extensions::ExtensionCommandsGlobalRegistry::Get(browser_->profile()); | 471 extensions::ExtensionCommandsGlobalRegistry::Get(browser_->profile()); |
479 if (global_registry->registry_for_active_window() == | 472 if (global_registry->registry_for_active_window() == |
480 extension_keybinding_registry_.get()) | 473 extension_keybinding_registry_.get()) |
481 global_registry->set_registry_for_active_window(nullptr); | 474 global_registry->set_registry_for_active_window(nullptr); |
482 | 475 |
483 // We destroy the download shelf before |browser_| to remove its child | 476 // We destroy the download shelf before |browser_| to remove its child |
484 // download views from the set of download observers (since the observed | 477 // download views from the set of download observers (since the observed |
485 // downloads can be destroyed along with |browser_| and the observer | 478 // downloads can be destroyed along with |browser_| and the observer |
486 // notifications will call back into deleted objects). | 479 // notifications will call back into deleted objects). |
(...skipping 1673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2160 // GetActiveWebContents can return null for example under Purify when | 2153 // GetActiveWebContents can return null for example under Purify when |
2161 // the animations are running slowly and this function is called on a timer | 2154 // the animations are running slowly and this function is called on a timer |
2162 // through LoadingAnimationCallback. | 2155 // through LoadingAnimationCallback. |
2163 frame_->UpdateThrobber(web_contents && web_contents->IsLoading()); | 2156 frame_->UpdateThrobber(web_contents && web_contents->IsLoading()); |
2164 } | 2157 } |
2165 } | 2158 } |
2166 | 2159 |
2167 void BrowserView::OnLoadCompleted() { | 2160 void BrowserView::OnLoadCompleted() { |
2168 #if defined(OS_WIN) | 2161 #if defined(OS_WIN) |
2169 DCHECK(!jumplist_.get()); | 2162 DCHECK(!jumplist_.get()); |
2170 jumplist_ = new JumpList(browser_->profile()); | 2163 jumplist_ = JumpListFactory::GetForProfile(browser_->profile()); |
2171 #endif | 2164 #endif |
2172 } | 2165 } |
2173 | 2166 |
2174 BrowserViewLayout* BrowserView::GetBrowserViewLayout() const { | 2167 BrowserViewLayout* BrowserView::GetBrowserViewLayout() const { |
2175 return static_cast<BrowserViewLayout*>(GetLayoutManager()); | 2168 return static_cast<BrowserViewLayout*>(GetLayoutManager()); |
2176 } | 2169 } |
2177 | 2170 |
2178 ContentsLayoutManager* BrowserView::GetContentsLayoutManager() const { | 2171 ContentsLayoutManager* BrowserView::GetContentsLayoutManager() const { |
2179 return static_cast<ContentsLayoutManager*>( | 2172 return static_cast<ContentsLayoutManager*>( |
2180 contents_container_->GetLayoutManager()); | 2173 contents_container_->GetLayoutManager()); |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2668 } | 2661 } |
2669 | 2662 |
2670 extensions::ActiveTabPermissionGranter* | 2663 extensions::ActiveTabPermissionGranter* |
2671 BrowserView::GetActiveTabPermissionGranter() { | 2664 BrowserView::GetActiveTabPermissionGranter() { |
2672 content::WebContents* web_contents = GetActiveWebContents(); | 2665 content::WebContents* web_contents = GetActiveWebContents(); |
2673 if (!web_contents) | 2666 if (!web_contents) |
2674 return nullptr; | 2667 return nullptr; |
2675 return extensions::TabHelper::FromWebContents(web_contents) | 2668 return extensions::TabHelper::FromWebContents(web_contents) |
2676 ->active_tab_permission_granter(); | 2669 ->active_tab_permission_granter(); |
2677 } | 2670 } |
OLD | NEW |