Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(29)

Side by Side Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 2697513008: Linux Aura: Use Aura theme on all windows when 'Use Classic theme' is used (Closed)
Patch Set: Move kThemeProfileKey into c/b/ui/views/frame/browser_view.h Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 #include "ui/gfx/color_palette.h" 167 #include "ui/gfx/color_palette.h"
168 #include "ui/native_theme/native_theme_win.h" 168 #include "ui/native_theme/native_theme_win.h"
169 #include "ui/views/win/scoped_fullscreen_visibility.h" 169 #include "ui/views/win/scoped_fullscreen_visibility.h"
170 #endif 170 #endif
171 171
172 #if BUILDFLAG(ENABLE_ONE_CLICK_SIGNIN) 172 #if BUILDFLAG(ENABLE_ONE_CLICK_SIGNIN)
173 #include "chrome/browser/ui/sync/one_click_signin_links_delegate_impl.h" 173 #include "chrome/browser/ui/sync/one_click_signin_links_delegate_impl.h"
174 #include "chrome/browser/ui/views/sync/one_click_signin_dialog_view.h" 174 #include "chrome/browser/ui/views/sync/one_click_signin_dialog_view.h"
175 #endif 175 #endif
176 176
177 #if defined(OS_LINUX)
178 #endif
179
180 using base::TimeDelta; 177 using base::TimeDelta;
181 using base::UserMetricsAction; 178 using base::UserMetricsAction;
182 using content::NativeWebKeyboardEvent; 179 using content::NativeWebKeyboardEvent;
183 using content::WebContents; 180 using content::WebContents;
184 using views::ColumnSet; 181 using views::ColumnSet;
185 using views::GridLayout; 182 using views::GridLayout;
186 using web_modal::WebContentsModalDialogHost; 183 using web_modal::WebContentsModalDialogHost;
187 184
188 namespace { 185 namespace {
189 186
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
378 PaintDetachedBookmarkBar(canvas, bookmark_bar_view_); 375 PaintDetachedBookmarkBar(canvas, bookmark_bar_view_);
379 canvas->Restore(); 376 canvas->Restore();
380 } 377 }
381 378
382 /////////////////////////////////////////////////////////////////////////////// 379 ///////////////////////////////////////////////////////////////////////////////
383 // BrowserView, public: 380 // BrowserView, public:
384 381
385 // static 382 // static
386 const char BrowserView::kViewClassName[] = "BrowserView"; 383 const char BrowserView::kViewClassName[] = "BrowserView";
387 384
385 // static
386 const char BrowserView::kThemeProfileKey[] = "__THEME_PROFILE__";
387
388 BrowserView::BrowserView() 388 BrowserView::BrowserView()
389 : views::ClientView(nullptr, nullptr), 389 : views::ClientView(nullptr, nullptr),
390 last_focused_view_storage_id_( 390 last_focused_view_storage_id_(
391 views::ViewStorage::GetInstance()->CreateStorageID()), 391 views::ViewStorage::GetInstance()->CreateStorageID()),
392 frame_(nullptr), 392 frame_(nullptr),
393 top_container_(nullptr), 393 top_container_(nullptr),
394 tabstrip_(nullptr), 394 tabstrip_(nullptr),
395 toolbar_(nullptr), 395 toolbar_(nullptr),
396 find_bar_host_view_(nullptr), 396 find_bar_host_view_(nullptr),
397 infobar_container_(nullptr), 397 infobar_container_(nullptr),
(...skipping 1626 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 BrowserView::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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698