| 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 2013 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2024 | 2024 |
| 2025 // Stow a pointer to this object onto the window handle so that we can get at | 2025 // Stow a pointer to this object onto the window handle so that we can get at |
| 2026 // it later when all we have is a native view. | 2026 // it later when all we have is a native view. |
| 2027 GetWidget()->SetNativeWindowProperty(kBrowserViewKey, this); | 2027 GetWidget()->SetNativeWindowProperty(kBrowserViewKey, this); |
| 2028 | 2028 |
| 2029 // Stow a pointer to the browser's profile onto the window handle so that we | 2029 // Stow a pointer to the browser's profile onto the window handle so that we |
| 2030 // can get it later when all we have is a native view. | 2030 // can get it later when all we have is a native view. |
| 2031 GetWidget()->SetNativeWindowProperty(Profile::kProfileKey, | 2031 GetWidget()->SetNativeWindowProperty(Profile::kProfileKey, |
| 2032 browser_->profile()); | 2032 browser_->profile()); |
| 2033 | 2033 |
| 2034 // Stow a pointer to the browser's original profile onto the window handle so |
| 2035 // that windows will be styled with the appropriate NativeTheme. |
| 2036 GetWidget()->SetNativeWindowProperty( |
| 2037 Profile::kThemeProfileKey, browser_->profile()->GetOriginalProfile()); |
| 2038 |
| 2034 LoadAccelerators(); | 2039 LoadAccelerators(); |
| 2035 | 2040 |
| 2036 contents_web_view_ = new ContentsWebView(browser_->profile()); | 2041 contents_web_view_ = new ContentsWebView(browser_->profile()); |
| 2037 contents_web_view_->set_id(VIEW_ID_TAB_CONTAINER); | 2042 contents_web_view_->set_id(VIEW_ID_TAB_CONTAINER); |
| 2038 contents_web_view_->SetEmbedFullscreenWidgetMode(true); | 2043 contents_web_view_->SetEmbedFullscreenWidgetMode(true); |
| 2039 | 2044 |
| 2040 web_contents_close_handler_.reset( | 2045 web_contents_close_handler_.reset( |
| 2041 new WebContentsCloseHandler(contents_web_view_)); | 2046 new WebContentsCloseHandler(contents_web_view_)); |
| 2042 | 2047 |
| 2043 devtools_web_view_ = new views::WebView(browser_->profile()); | 2048 devtools_web_view_ = new views::WebView(browser_->profile()); |
| (...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2630 } | 2635 } |
| 2631 | 2636 |
| 2632 extensions::ActiveTabPermissionGranter* | 2637 extensions::ActiveTabPermissionGranter* |
| 2633 BrowserView::GetActiveTabPermissionGranter() { | 2638 BrowserView::GetActiveTabPermissionGranter() { |
| 2634 content::WebContents* web_contents = GetActiveWebContents(); | 2639 content::WebContents* web_contents = GetActiveWebContents(); |
| 2635 if (!web_contents) | 2640 if (!web_contents) |
| 2636 return nullptr; | 2641 return nullptr; |
| 2637 return extensions::TabHelper::FromWebContents(web_contents) | 2642 return extensions::TabHelper::FromWebContents(web_contents) |
| 2638 ->active_tab_permission_granter(); | 2643 ->active_tab_permission_granter(); |
| 2639 } | 2644 } |
| OLD | NEW |