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 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 #if defined(OS_CHROMEOS) | 150 #if defined(OS_CHROMEOS) |
151 #include "chrome/browser/ui/ash/ash_util.h" | 151 #include "chrome/browser/ui/ash/ash_util.h" |
152 #endif // defined(OS_CHROMEOS) | 152 #endif // defined(OS_CHROMEOS) |
153 | 153 |
154 #if !defined(OS_CHROMEOS) | 154 #if !defined(OS_CHROMEOS) |
155 #include "chrome/browser/ui/signin_view_controller.h" | 155 #include "chrome/browser/ui/signin_view_controller.h" |
156 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" | 156 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h" |
157 #endif // !defined(OS_CHROMEOS) | 157 #endif // !defined(OS_CHROMEOS) |
158 | 158 |
159 #if defined(USE_AURA) | 159 #if defined(USE_AURA) |
160 #include "chrome/browser/ui/views/theme_profile_key.h" | |
161 #include "ui/aura/client/window_parenting_client.h" | 160 #include "ui/aura/client/window_parenting_client.h" |
162 #include "ui/aura/window.h" | 161 #include "ui/aura/window.h" |
163 #include "ui/aura/window_tree_host.h" | 162 #include "ui/aura/window_tree_host.h" |
164 #endif | 163 #endif |
165 | 164 |
166 #if defined(OS_WIN) | 165 #if defined(OS_WIN) |
167 #include "base/win/windows_version.h" | 166 #include "base/win/windows_version.h" |
168 #include "chrome/browser/win/jumplist.h" | 167 #include "chrome/browser/win/jumplist.h" |
169 #include "chrome/browser/win/jumplist_factory.h" | 168 #include "chrome/browser/win/jumplist_factory.h" |
170 #include "ui/gfx/color_palette.h" | 169 #include "ui/gfx/color_palette.h" |
(...skipping 1911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2082 | 2081 |
2083 // Stow a pointer to this object onto the window handle so that we can get at | 2082 // 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. | 2083 // it later when all we have is a native view. |
2085 GetWidget()->SetNativeWindowProperty(kBrowserViewKey, this); | 2084 GetWidget()->SetNativeWindowProperty(kBrowserViewKey, this); |
2086 | 2085 |
2087 // Stow a pointer to the browser's profile onto the window handle so that we | 2086 // 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. | 2087 // can get it later when all we have is a native view. |
2089 GetWidget()->SetNativeWindowProperty(Profile::kProfileKey, | 2088 GetWidget()->SetNativeWindowProperty(Profile::kProfileKey, |
2090 browser_->profile()); | 2089 browser_->profile()); |
2091 | 2090 |
2092 #if defined(USE_AURA) | |
2093 // Stow a pointer to the browser's original profile onto the window handle so | |
2094 // that windows will be styled with the appropriate NativeTheme. | |
2095 SetThemeProfileForWindow(GetNativeWindow(), | |
2096 browser_->profile()->GetOriginalProfile()); | |
2097 #endif | |
2098 | |
2099 LoadAccelerators(); | 2091 LoadAccelerators(); |
2100 | 2092 |
2101 contents_web_view_ = new ContentsWebView(browser_->profile()); | 2093 contents_web_view_ = new ContentsWebView(browser_->profile()); |
2102 contents_web_view_->set_id(VIEW_ID_TAB_CONTAINER); | 2094 contents_web_view_->set_id(VIEW_ID_TAB_CONTAINER); |
2103 contents_web_view_->SetEmbedFullscreenWidgetMode(true); | 2095 contents_web_view_->SetEmbedFullscreenWidgetMode(true); |
2104 | 2096 |
2105 web_contents_close_handler_.reset( | 2097 web_contents_close_handler_.reset( |
2106 new WebContentsCloseHandler(contents_web_view_)); | 2098 new WebContentsCloseHandler(contents_web_view_)); |
2107 | 2099 |
2108 devtools_web_view_ = new views::WebView(browser_->profile()); | 2100 devtools_web_view_ = new views::WebView(browser_->profile()); |
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2695 } | 2687 } |
2696 | 2688 |
2697 extensions::ActiveTabPermissionGranter* | 2689 extensions::ActiveTabPermissionGranter* |
2698 BrowserView::GetActiveTabPermissionGranter() { | 2690 BrowserView::GetActiveTabPermissionGranter() { |
2699 content::WebContents* web_contents = GetActiveWebContents(); | 2691 content::WebContents* web_contents = GetActiveWebContents(); |
2700 if (!web_contents) | 2692 if (!web_contents) |
2701 return nullptr; | 2693 return nullptr; |
2702 return extensions::TabHelper::FromWebContents(web_contents) | 2694 return extensions::TabHelper::FromWebContents(web_contents) |
2703 ->active_tab_permission_granter(); | 2695 ->active_tab_permission_granter(); |
2704 } | 2696 } |
OLD | NEW |