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 <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
412 | 412 |
413 browser_->tab_strip_model()->RemoveObserver(this); | 413 browser_->tab_strip_model()->RemoveObserver(this); |
414 | 414 |
415 #if defined(OS_WIN) | 415 #if defined(OS_WIN) |
416 // Stop hung plugin monitoring. | 416 // Stop hung plugin monitoring. |
417 ticker_.Stop(); | 417 ticker_.Stop(); |
418 ticker_.UnregisterTickHandler(&hung_window_detector_); | 418 ticker_.UnregisterTickHandler(&hung_window_detector_); |
419 | 419 |
420 // Terminate the jumplist (must be called before browser_->profile() is | 420 // Terminate the jumplist (must be called before browser_->profile() is |
421 // destroyed. | 421 // destroyed. |
422 if (jumplist_) { | 422 if (jumplist_.get()) { |
423 jumplist_->Terminate(); | 423 jumplist_->Terminate(); |
424 } | 424 } |
425 #endif | 425 #endif |
426 | 426 |
427 // We destroy the download shelf before |browser_| to remove its child | 427 // We destroy the download shelf before |browser_| to remove its child |
428 // download views from the set of download observers (since the observed | 428 // download views from the set of download observers (since the observed |
429 // downloads can be destroyed along with |browser_| and the observer | 429 // downloads can be destroyed along with |browser_| and the observer |
430 // notifications will call back into deleted objects). | 430 // notifications will call back into deleted objects). |
431 BrowserViewLayout* browser_view_layout = GetBrowserViewLayout(); | 431 BrowserViewLayout* browser_view_layout = GetBrowserViewLayout(); |
432 if (browser_view_layout) | 432 if (browser_view_layout) |
(...skipping 1580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2013 browser_->tab_strip_model()->GetActiveWebContents(); | 2013 browser_->tab_strip_model()->GetActiveWebContents(); |
2014 // GetActiveWebContents can return null for example under Purify when | 2014 // GetActiveWebContents can return null for example under Purify when |
2015 // the animations are running slowly and this function is called on a timer | 2015 // the animations are running slowly and this function is called on a timer |
2016 // through LoadingAnimationCallback. | 2016 // through LoadingAnimationCallback. |
2017 frame_->UpdateThrobber(web_contents && web_contents->IsLoading()); | 2017 frame_->UpdateThrobber(web_contents && web_contents->IsLoading()); |
2018 } | 2018 } |
2019 } | 2019 } |
2020 | 2020 |
2021 void BrowserView::OnLoadCompleted() { | 2021 void BrowserView::OnLoadCompleted() { |
2022 #if defined(OS_WIN) | 2022 #if defined(OS_WIN) |
2023 DCHECK(!jumplist_); | 2023 DCHECK(!jumplist_.get()); |
2024 jumplist_ = new JumpList(browser_->profile()); | 2024 jumplist_ = new JumpList(browser_->profile()); |
2025 #endif | 2025 #endif |
2026 } | 2026 } |
2027 | 2027 |
2028 BrowserViewLayout* BrowserView::GetBrowserViewLayout() const { | 2028 BrowserViewLayout* BrowserView::GetBrowserViewLayout() const { |
2029 return static_cast<BrowserViewLayout*>(GetLayoutManager()); | 2029 return static_cast<BrowserViewLayout*>(GetLayoutManager()); |
2030 } | 2030 } |
2031 | 2031 |
2032 ContentsLayoutManager* BrowserView::GetContentsLayoutManager() const { | 2032 ContentsLayoutManager* BrowserView::GetContentsLayoutManager() const { |
2033 return static_cast<ContentsLayoutManager*>( | 2033 return static_cast<ContentsLayoutManager*>( |
(...skipping 480 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2514 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { | 2514 !GetLocationBar()->GetOmniboxView()->model()->popup_model()->IsOpen()) { |
2515 gfx::Point icon_bottom( | 2515 gfx::Point icon_bottom( |
2516 toolbar_->location_bar()->GetLocationBarAnchorPoint()); | 2516 toolbar_->location_bar()->GetLocationBarAnchorPoint()); |
2517 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); | 2517 ConvertPointToTarget(toolbar_->location_bar(), this, &icon_bottom); |
2518 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(nullptr)); | 2518 gfx::Point infobar_top(0, infobar_container_->GetVerticalOverlap(nullptr)); |
2519 ConvertPointToTarget(infobar_container_, this, &infobar_top); | 2519 ConvertPointToTarget(infobar_container_, this, &infobar_top); |
2520 top_arrow_height = infobar_top.y() - icon_bottom.y(); | 2520 top_arrow_height = infobar_top.y() - icon_bottom.y(); |
2521 } | 2521 } |
2522 return top_arrow_height; | 2522 return top_arrow_height; |
2523 } | 2523 } |
OLD | NEW |