| 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 #include <algorithm> | 8 #include <algorithm> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 RemoveAllChildViews(true); | 524 RemoveAllChildViews(true); |
| 525 toolbar_ = nullptr; | 525 toolbar_ = nullptr; |
| 526 | 526 |
| 527 // Explicitly set browser_ to null. | 527 // Explicitly set browser_ to null. |
| 528 browser_.reset(); | 528 browser_.reset(); |
| 529 } | 529 } |
| 530 | 530 |
| 531 void BrowserView::Init(Browser* browser) { | 531 void BrowserView::Init(Browser* browser) { |
| 532 browser_.reset(browser); | 532 browser_.reset(browser); |
| 533 browser_->tab_strip_model()->AddObserver(this); | 533 browser_->tab_strip_model()->AddObserver(this); |
| 534 immersive_mode_controller_.reset( | 534 immersive_mode_controller_.reset(chrome::CreateImmersiveModeController()); |
| 535 chrome::CreateImmersiveModeController(browser_->host_desktop_type())); | |
| 536 } | 535 } |
| 537 | 536 |
| 538 // static | 537 // static |
| 539 BrowserView* BrowserView::GetBrowserViewForNativeWindow( | 538 BrowserView* BrowserView::GetBrowserViewForNativeWindow( |
| 540 gfx::NativeWindow window) { | 539 gfx::NativeWindow window) { |
| 541 views::Widget* widget = views::Widget::GetWidgetForNativeWindow(window); | 540 views::Widget* widget = views::Widget::GetWidgetForNativeWindow(window); |
| 542 return widget ? | 541 return widget ? |
| 543 reinterpret_cast<BrowserView*>(widget->GetNativeWindowProperty( | 542 reinterpret_cast<BrowserView*>(widget->GetNativeWindowProperty( |
| 544 kBrowserViewKey)) : nullptr; | 543 kBrowserViewKey)) : nullptr; |
| 545 } | 544 } |
| (...skipping 2191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2737 } | 2736 } |
| 2738 | 2737 |
| 2739 extensions::ActiveTabPermissionGranter* | 2738 extensions::ActiveTabPermissionGranter* |
| 2740 BrowserView::GetActiveTabPermissionGranter() { | 2739 BrowserView::GetActiveTabPermissionGranter() { |
| 2741 content::WebContents* web_contents = GetActiveWebContents(); | 2740 content::WebContents* web_contents = GetActiveWebContents(); |
| 2742 if (!web_contents) | 2741 if (!web_contents) |
| 2743 return nullptr; | 2742 return nullptr; |
| 2744 return extensions::TabHelper::FromWebContents(web_contents) | 2743 return extensions::TabHelper::FromWebContents(web_contents) |
| 2745 ->active_tab_permission_granter(); | 2744 ->active_tab_permission_granter(); |
| 2746 } | 2745 } |
| OLD | NEW |