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 2068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2079 | 2079 |
2080 void BrowserView::InitViews() { | 2080 void BrowserView::InitViews() { |
2081 GetWidget()->AddObserver(this); | 2081 GetWidget()->AddObserver(this); |
2082 | 2082 |
2083 // Stow a pointer to this object onto the window handle so that we can get at | 2083 // Stow a pointer to this object onto the window handle so that we can get at |
2084 // it later when all we have is a native view. | 2084 // it later when all we have is a native view. |
2085 GetWidget()->SetNativeWindowProperty(kBrowserViewKey, this); | 2085 GetWidget()->SetNativeWindowProperty(kBrowserViewKey, this); |
2086 | 2086 |
2087 // Stow a pointer to the browser's profile onto the window handle so that we | 2087 // Stow a pointer to the browser's profile onto the window handle so that we |
2088 // can get it later when all we have is a native view. | 2088 // can get it later when all we have is a native view. |
2089 GetWidget()->SetNativeWindowProperty(Profile::kProfileKey, | 2089 GetWidget()->SetNativeWindowProperty(Profile::kProfileKey, |
sky
2017/05/04 23:24:09
Could you instead use kProfileKey now? By that I m
Tom (Use chromium acct)
2017/05/04 23:41:46
Can we just make this change:
- Profile* GetTheme
sky
2017/05/08 21:44:37
Could you clarify why we need both kThemeProfileKe
Tom (Use chromium acct)
2017/05/09 05:12:26
Nevermind, I see what you mean now. I think we ca
| |
2090 browser_->profile()); | 2090 browser_->profile()); |
2091 | 2091 |
2092 #if defined(USE_AURA) | 2092 #if defined(USE_AURA) |
2093 // Stow a pointer to the browser's original profile onto the window handle so | 2093 // Stow a pointer to the browser's profile onto the window handle so |
2094 // that windows will be styled with the appropriate NativeTheme. | 2094 // that windows will be styled with the appropriate NativeTheme. |
2095 SetThemeProfileForWindow(GetNativeWindow(), | 2095 SetThemeProfileForWindow(GetNativeWindow(), browser_->profile()); |
2096 browser_->profile()->GetOriginalProfile()); | |
2097 #endif | 2096 #endif |
2098 | 2097 |
2099 LoadAccelerators(); | 2098 LoadAccelerators(); |
2100 | 2099 |
2101 contents_web_view_ = new ContentsWebView(browser_->profile()); | 2100 contents_web_view_ = new ContentsWebView(browser_->profile()); |
2102 contents_web_view_->set_id(VIEW_ID_TAB_CONTAINER); | 2101 contents_web_view_->set_id(VIEW_ID_TAB_CONTAINER); |
2103 contents_web_view_->SetEmbedFullscreenWidgetMode(true); | 2102 contents_web_view_->SetEmbedFullscreenWidgetMode(true); |
2104 | 2103 |
2105 web_contents_close_handler_.reset( | 2104 web_contents_close_handler_.reset( |
2106 new WebContentsCloseHandler(contents_web_view_)); | 2105 new WebContentsCloseHandler(contents_web_view_)); |
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2695 } | 2694 } |
2696 | 2695 |
2697 extensions::ActiveTabPermissionGranter* | 2696 extensions::ActiveTabPermissionGranter* |
2698 BrowserView::GetActiveTabPermissionGranter() { | 2697 BrowserView::GetActiveTabPermissionGranter() { |
2699 content::WebContents* web_contents = GetActiveWebContents(); | 2698 content::WebContents* web_contents = GetActiveWebContents(); |
2700 if (!web_contents) | 2699 if (!web_contents) |
2701 return nullptr; | 2700 return nullptr; |
2702 return extensions::TabHelper::FromWebContents(web_contents) | 2701 return extensions::TabHelper::FromWebContents(web_contents) |
2703 ->active_tab_permission_granter(); | 2702 ->active_tab_permission_granter(); |
2704 } | 2703 } |
OLD | NEW |