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 1890 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1901 } | 1901 } |
1902 | 1902 |
1903 void BrowserView::OnThemeChanged() { | 1903 void BrowserView::OnThemeChanged() { |
1904 if (!IsRegularOrGuestSession()) { | 1904 if (!IsRegularOrGuestSession()) { |
1905 // When the theme changes, the native theme may also change (in incognito, | 1905 // When the theme changes, the native theme may also change (in incognito, |
1906 // the usage of dark or normal hinges on the browser theme), so we have to | 1906 // the usage of dark or normal hinges on the browser theme), so we have to |
1907 // propagate both kinds of change. | 1907 // propagate both kinds of change. |
1908 base::AutoReset<bool> reset(&handling_theme_changed_, true); | 1908 base::AutoReset<bool> reset(&handling_theme_changed_, true); |
1909 #if defined(OS_WIN) | 1909 #if defined(OS_WIN) |
1910 ui::NativeThemeDarkWin::instance()->NotifyObservers(); | 1910 ui::NativeThemeDarkWin::instance()->NotifyObservers(); |
1911 ui::NativeThemeWin::instance()->NotifyObservers(); | |
1912 #elif defined(OS_LINUX) | 1911 #elif defined(OS_LINUX) |
1913 ui::NativeThemeDarkAura::instance()->NotifyObservers(); | 1912 ui::NativeThemeDarkAura::instance()->NotifyObservers(); |
1914 ui::NativeThemeAura::instance()->NotifyObservers(); | |
1915 #endif | 1913 #endif |
| 1914 ui::NativeTheme::GetInstanceForNativeUi()->NotifyObservers(); |
1916 } | 1915 } |
1917 | 1916 |
1918 views::View::OnThemeChanged(); | 1917 views::View::OnThemeChanged(); |
1919 } | 1918 } |
1920 | 1919 |
1921 void BrowserView::OnNativeThemeChanged(const ui::NativeTheme* theme) { | 1920 void BrowserView::OnNativeThemeChanged(const ui::NativeTheme* theme) { |
1922 // Do not handle native theme changes before the browser view is initialized. | 1921 // Do not handle native theme changes before the browser view is initialized. |
1923 if (!initialized_) | 1922 if (!initialized_) |
1924 return; | 1923 return; |
1925 ClientView::OnNativeThemeChanged(theme); | 1924 ClientView::OnNativeThemeChanged(theme); |
(...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2589 } | 2588 } |
2590 | 2589 |
2591 extensions::ActiveTabPermissionGranter* | 2590 extensions::ActiveTabPermissionGranter* |
2592 BrowserView::GetActiveTabPermissionGranter() { | 2591 BrowserView::GetActiveTabPermissionGranter() { |
2593 content::WebContents* web_contents = GetActiveWebContents(); | 2592 content::WebContents* web_contents = GetActiveWebContents(); |
2594 if (!web_contents) | 2593 if (!web_contents) |
2595 return nullptr; | 2594 return nullptr; |
2596 return extensions::TabHelper::FromWebContents(web_contents) | 2595 return extensions::TabHelper::FromWebContents(web_contents) |
2597 ->active_tab_permission_granter(); | 2596 ->active_tab_permission_granter(); |
2598 } | 2597 } |
OLD | NEW |