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 2152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2163 BrowserViewLayout* BrowserView::GetBrowserViewLayout() const { | 2163 BrowserViewLayout* BrowserView::GetBrowserViewLayout() const { |
2164 return static_cast<BrowserViewLayout*>(GetLayoutManager()); | 2164 return static_cast<BrowserViewLayout*>(GetLayoutManager()); |
2165 } | 2165 } |
2166 | 2166 |
2167 ContentsLayoutManager* BrowserView::GetContentsLayoutManager() const { | 2167 ContentsLayoutManager* BrowserView::GetContentsLayoutManager() const { |
2168 return static_cast<ContentsLayoutManager*>( | 2168 return static_cast<ContentsLayoutManager*>( |
2169 contents_container_->GetLayoutManager()); | 2169 contents_container_->GetLayoutManager()); |
2170 } | 2170 } |
2171 | 2171 |
2172 bool BrowserView::MaybeShowBookmarkBar(WebContents* contents) { | 2172 bool BrowserView::MaybeShowBookmarkBar(WebContents* contents) { |
2173 bool show_bookmark_bar = contents && | 2173 bool show_bookmark_bar = |
2174 browser_->SupportsWindowFeature(Browser::FEATURE_BOOKMARKBAR); | 2174 browser_->SupportsWindowFeature(Browser::FEATURE_BOOKMARKBAR); |
2175 if (!show_bookmark_bar && !bookmark_bar_view_.get()) | 2175 if (!show_bookmark_bar && !bookmark_bar_view_.get()) |
2176 return false; | 2176 return false; |
2177 if (!bookmark_bar_view_.get()) { | 2177 if (!bookmark_bar_view_.get()) { |
2178 bookmark_bar_view_.reset(new BookmarkBarView(browser_.get(), this)); | 2178 bookmark_bar_view_.reset(new BookmarkBarView(browser_.get(), this)); |
2179 bookmark_bar_view_->set_owned_by_client(); | 2179 bookmark_bar_view_->set_owned_by_client(); |
2180 bookmark_bar_view_->SetBackground( | 2180 bookmark_bar_view_->SetBackground( |
2181 base::MakeUnique<BookmarkBarViewBackground>(this, | 2181 base::MakeUnique<BookmarkBarViewBackground>(this, |
2182 bookmark_bar_view_.get())); | 2182 bookmark_bar_view_.get())); |
2183 bookmark_bar_view_->SetBookmarkBarState( | 2183 bookmark_bar_view_->SetBookmarkBarState( |
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2657 } | 2657 } |
2658 | 2658 |
2659 extensions::ActiveTabPermissionGranter* | 2659 extensions::ActiveTabPermissionGranter* |
2660 BrowserView::GetActiveTabPermissionGranter() { | 2660 BrowserView::GetActiveTabPermissionGranter() { |
2661 content::WebContents* web_contents = GetActiveWebContents(); | 2661 content::WebContents* web_contents = GetActiveWebContents(); |
2662 if (!web_contents) | 2662 if (!web_contents) |
2663 return nullptr; | 2663 return nullptr; |
2664 return extensions::TabHelper::FromWebContents(web_contents) | 2664 return extensions::TabHelper::FromWebContents(web_contents) |
2665 ->active_tab_permission_granter(); | 2665 ->active_tab_permission_granter(); |
2666 } | 2666 } |
OLD | NEW |