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

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

Issue 2335203003: Add metrics to keep track of the tab activate/deactivate cycle (Closed)
Patch Set: Addressed comments Created 4 years, 3 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
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 1522 matching lines...) Expand 10 before | Expand all | Expand 10 after
1533 return contents_web_view_; 1533 return contents_web_view_;
1534 } 1534 }
1535 1535
1536 ToolbarView* BrowserView::GetToolbarView() const { 1536 ToolbarView* BrowserView::GetToolbarView() const {
1537 return toolbar_; 1537 return toolbar_;
1538 } 1538 }
1539 1539
1540 /////////////////////////////////////////////////////////////////////////////// 1540 ///////////////////////////////////////////////////////////////////////////////
1541 // BrowserView, TabStripModelObserver implementation: 1541 // BrowserView, TabStripModelObserver implementation:
1542 1542
1543 void BrowserView::TabInsertedAt(WebContents* contents, 1543 void BrowserView::TabInsertedAt(TabStripModel* tab_strip_model,
1544 WebContents* contents,
1544 int index, 1545 int index,
1545 bool foreground) { 1546 bool foreground) {
1546 #if defined(USE_AURA) 1547 #if defined(USE_AURA)
1547 // WebContents inserted in tabs might not have been added to the root 1548 // WebContents inserted in tabs might not have been added to the root
1548 // window yet. Per http://crbug/342672 add them now since drawing the 1549 // window yet. Per http://crbug/342672 add them now since drawing the
1549 // WebContents requires root window specific data - information about 1550 // WebContents requires root window specific data - information about
1550 // the screen the WebContents is drawn on, for example. 1551 // the screen the WebContents is drawn on, for example.
1551 if (!contents->GetNativeView()->GetRootWindow()) { 1552 if (!contents->GetNativeView()->GetRootWindow()) {
1552 aura::Window* window = contents->GetNativeView(); 1553 aura::Window* window = contents->GetNativeView();
1553 aura::Window* root_window = GetNativeWindow()->GetRootWindow(); 1554 aura::Window* root_window = GetNativeWindow()->GetRootWindow();
(...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after
2661 } 2662 }
2662 2663
2663 extensions::ActiveTabPermissionGranter* 2664 extensions::ActiveTabPermissionGranter*
2664 BrowserView::GetActiveTabPermissionGranter() { 2665 BrowserView::GetActiveTabPermissionGranter() {
2665 content::WebContents* web_contents = GetActiveWebContents(); 2666 content::WebContents* web_contents = GetActiveWebContents();
2666 if (!web_contents) 2667 if (!web_contents)
2667 return nullptr; 2668 return nullptr;
2668 return extensions::TabHelper::FromWebContents(web_contents) 2669 return extensions::TabHelper::FromWebContents(web_contents)
2669 ->active_tab_permission_granter(); 2670 ->active_tab_permission_granter();
2670 } 2671 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698