Chromium Code Reviews| 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 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 412 toolbar_(nullptr), | 412 toolbar_(nullptr), |
| 413 find_bar_host_view_(nullptr), | 413 find_bar_host_view_(nullptr), |
| 414 infobar_container_(nullptr), | 414 infobar_container_(nullptr), |
| 415 contents_web_view_(nullptr), | 415 contents_web_view_(nullptr), |
| 416 devtools_web_view_(nullptr), | 416 devtools_web_view_(nullptr), |
| 417 contents_container_(nullptr), | 417 contents_container_(nullptr), |
| 418 initialized_(false), | 418 initialized_(false), |
| 419 handling_theme_changed_(false), | 419 handling_theme_changed_(false), |
| 420 in_process_fullscreen_(false), | 420 in_process_fullscreen_(false), |
| 421 force_location_bar_focus_(false), | 421 force_location_bar_focus_(false), |
| 422 activate_modal_dialog_factory_(this) { | 422 activate_modal_dialog_factory_(this) {} |
| 423 } | |
| 424 | 423 |
| 425 BrowserView::~BrowserView() { | 424 BrowserView::~BrowserView() { |
| 426 // All the tabs should have been destroyed already. If we were closed by the | 425 // All the tabs should have been destroyed already. If we were closed by the |
| 427 // OS with some tabs than the NativeBrowserFrame should have destroyed them. | 426 // OS with some tabs than the NativeBrowserFrame should have destroyed them. |
| 428 DCHECK_EQ(0, browser_->tab_strip_model()->count()); | 427 DCHECK_EQ(0, browser_->tab_strip_model()->count()); |
| 429 | 428 |
| 430 // Stop the animation timer explicitly here to avoid running it in a nested | 429 // Stop the animation timer explicitly here to avoid running it in a nested |
| 431 // message loop, which may run by Browser destructor. | 430 // message loop, which may run by Browser destructor. |
| 432 loading_animation_timer_.Stop(); | 431 loading_animation_timer_.Stop(); |
| 433 | 432 |
| (...skipping 1559 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1993 } | 1992 } |
| 1994 | 1993 |
| 1995 void BrowserView::ViewHierarchyChanged( | 1994 void BrowserView::ViewHierarchyChanged( |
| 1996 const ViewHierarchyChangedDetails& details) { | 1995 const ViewHierarchyChangedDetails& details) { |
| 1997 if (!initialized_ && details.is_add && details.child == this && GetWidget()) { | 1996 if (!initialized_ && details.is_add && details.child == this && GetWidget()) { |
| 1998 InitViews(); | 1997 InitViews(); |
| 1999 initialized_ = true; | 1998 initialized_ = true; |
| 2000 } | 1999 } |
| 2001 } | 2000 } |
| 2002 | 2001 |
| 2002 void BrowserView::PaintChildren(const ui::PaintContext& context) { | |
| 2003 views::ClientView::PaintChildren(context); | |
| 2004 // Don't reset the instance before it had a chance to get compositor callback. | |
| 2005 if (!histogram_helper_.get()) | |
|
Alexei Svitkine (slow)
2017/04/18 16:01:32
Nit: {}
Also, does if (!histogram_helper_) work?
themblsha
2017/04/19 15:06:09
sky prefers the absence of curly brackets on singl
| |
| 2006 histogram_helper_ = BrowserWindowHistogramHelper::OnBrowserPainted( | |
| 2007 GetWidget()->GetCompositor()); | |
| 2008 } | |
| 2009 | |
| 2003 void BrowserView::ChildPreferredSizeChanged(View* child) { | 2010 void BrowserView::ChildPreferredSizeChanged(View* child) { |
| 2004 Layout(); | 2011 Layout(); |
| 2005 } | 2012 } |
| 2006 | 2013 |
| 2007 void BrowserView::GetAccessibleNodeData(ui::AXNodeData* node_data) { | 2014 void BrowserView::GetAccessibleNodeData(ui::AXNodeData* node_data) { |
| 2008 node_data->role = ui::AX_ROLE_CLIENT; | 2015 node_data->role = ui::AX_ROLE_CLIENT; |
| 2009 } | 2016 } |
| 2010 | 2017 |
| 2011 void BrowserView::OnThemeChanged() { | 2018 void BrowserView::OnThemeChanged() { |
| 2012 if (!IsRegularOrGuestSession()) { | 2019 if (!IsRegularOrGuestSession()) { |
| (...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2690 } | 2697 } |
| 2691 | 2698 |
| 2692 extensions::ActiveTabPermissionGranter* | 2699 extensions::ActiveTabPermissionGranter* |
| 2693 BrowserView::GetActiveTabPermissionGranter() { | 2700 BrowserView::GetActiveTabPermissionGranter() { |
| 2694 content::WebContents* web_contents = GetActiveWebContents(); | 2701 content::WebContents* web_contents = GetActiveWebContents(); |
| 2695 if (!web_contents) | 2702 if (!web_contents) |
| 2696 return nullptr; | 2703 return nullptr; |
| 2697 return extensions::TabHelper::FromWebContents(web_contents) | 2704 return extensions::TabHelper::FromWebContents(web_contents) |
| 2698 ->active_tab_permission_granter(); | 2705 ->active_tab_permission_granter(); |
| 2699 } | 2706 } |
| OLD | NEW |