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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 #if defined(OS_CHROMEOS) | 146 #if defined(OS_CHROMEOS) |
147 #include "chrome/browser/ui/ash/ash_util.h" | 147 #include "chrome/browser/ui/ash/ash_util.h" |
148 #endif // defined(OS_CHROMEOS) | 148 #endif // defined(OS_CHROMEOS) |
149 | 149 |
150 #if !defined(OS_CHROMEOS) | 150 #if !defined(OS_CHROMEOS) |
151 #include "chrome/browser/ui/signin_view_controller.h" | 151 #include "chrome/browser/ui/signin_view_controller.h" |
152 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" | 152 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" |
153 #endif // !defined(OS_CHROMEOS) | 153 #endif // !defined(OS_CHROMEOS) |
154 | 154 |
155 #if defined(USE_AURA) | 155 #if defined(USE_AURA) |
| 156 #include "chrome/browser/ui/views/theme_profile_key.h" |
156 #include "ui/aura/client/window_parenting_client.h" | 157 #include "ui/aura/client/window_parenting_client.h" |
157 #include "ui/aura/window.h" | 158 #include "ui/aura/window.h" |
158 #include "ui/aura/window_tree_host.h" | 159 #include "ui/aura/window_tree_host.h" |
159 #endif | 160 #endif |
160 | 161 |
161 #if defined(OS_WIN) | 162 #if defined(OS_WIN) |
162 #include "base/win/windows_version.h" | 163 #include "base/win/windows_version.h" |
163 #include "chrome/browser/win/jumplist.h" | 164 #include "chrome/browser/win/jumplist.h" |
164 #include "chrome/browser/win/jumplist_factory.h" | 165 #include "chrome/browser/win/jumplist_factory.h" |
165 #include "ui/gfx/color_palette.h" | 166 #include "ui/gfx/color_palette.h" |
(...skipping 1906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2072 | 2073 |
2073 // Stow a pointer to this object onto the window handle so that we can get at | 2074 // Stow a pointer to this object onto the window handle so that we can get at |
2074 // it later when all we have is a native view. | 2075 // it later when all we have is a native view. |
2075 GetWidget()->SetNativeWindowProperty(kBrowserViewKey, this); | 2076 GetWidget()->SetNativeWindowProperty(kBrowserViewKey, this); |
2076 | 2077 |
2077 // Stow a pointer to the browser's profile onto the window handle so that we | 2078 // Stow a pointer to the browser's profile onto the window handle so that we |
2078 // can get it later when all we have is a native view. | 2079 // can get it later when all we have is a native view. |
2079 GetWidget()->SetNativeWindowProperty(Profile::kProfileKey, | 2080 GetWidget()->SetNativeWindowProperty(Profile::kProfileKey, |
2080 browser_->profile()); | 2081 browser_->profile()); |
2081 | 2082 |
| 2083 #if defined(USE_AURA) |
| 2084 // Stow a pointer to the browser's profile onto the window handle so |
| 2085 // that windows will be styled with the appropriate NativeTheme. |
| 2086 SetThemeProfileForWindow(GetNativeWindow(), browser_->profile()); |
| 2087 #endif |
| 2088 |
2082 LoadAccelerators(); | 2089 LoadAccelerators(); |
2083 | 2090 |
2084 contents_web_view_ = new ContentsWebView(browser_->profile()); | 2091 contents_web_view_ = new ContentsWebView(browser_->profile()); |
2085 contents_web_view_->set_id(VIEW_ID_TAB_CONTAINER); | 2092 contents_web_view_->set_id(VIEW_ID_TAB_CONTAINER); |
2086 contents_web_view_->SetEmbedFullscreenWidgetMode(true); | 2093 contents_web_view_->SetEmbedFullscreenWidgetMode(true); |
2087 | 2094 |
2088 web_contents_close_handler_.reset( | 2095 web_contents_close_handler_.reset( |
2089 new WebContentsCloseHandler(contents_web_view_)); | 2096 new WebContentsCloseHandler(contents_web_view_)); |
2090 | 2097 |
2091 devtools_web_view_ = new views::WebView(browser_->profile()); | 2098 devtools_web_view_ = new views::WebView(browser_->profile()); |
(...skipping 589 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2681 } | 2688 } |
2682 | 2689 |
2683 extensions::ActiveTabPermissionGranter* | 2690 extensions::ActiveTabPermissionGranter* |
2684 BrowserView::GetActiveTabPermissionGranter() { | 2691 BrowserView::GetActiveTabPermissionGranter() { |
2685 content::WebContents* web_contents = GetActiveWebContents(); | 2692 content::WebContents* web_contents = GetActiveWebContents(); |
2686 if (!web_contents) | 2693 if (!web_contents) |
2687 return nullptr; | 2694 return nullptr; |
2688 return extensions::TabHelper::FromWebContents(web_contents) | 2695 return extensions::TabHelper::FromWebContents(web_contents) |
2689 ->active_tab_permission_granter(); | 2696 ->active_tab_permission_granter(); |
2690 } | 2697 } |
OLD | NEW |