OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/panels/panel_browser_window_gtk.h" | 5 #include "chrome/browser/ui/panels/panel_browser_window_gtk.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
9 #include "chrome/browser/ui/browser_list.h" | 9 #include "chrome/browser/ui/browser_list.h" |
10 #include "chrome/browser/ui/browser_window.h" | 10 #include "chrome/browser/ui/browser_window.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 PanelBrowserTitlebarGtk* PanelBrowserWindowGtk::GetPanelTitlebar() const { | 136 PanelBrowserTitlebarGtk* PanelBrowserWindowGtk::GetPanelTitlebar() const { |
137 return static_cast<PanelBrowserTitlebarGtk*>(titlebar()); | 137 return static_cast<PanelBrowserTitlebarGtk*>(titlebar()); |
138 } | 138 } |
139 | 139 |
140 bool PanelBrowserWindowGtk::UsingDefaultTheme() const { | 140 bool PanelBrowserWindowGtk::UsingDefaultTheme() const { |
141 // No theme is provided for attention painting. | 141 // No theme is provided for attention painting. |
142 if (paint_state_ == PAINT_FOR_ATTENTION) | 142 if (paint_state_ == PAINT_FOR_ATTENTION) |
143 return true; | 143 return true; |
144 | 144 |
145 GtkThemeService* theme_provider = GtkThemeService::GetFrom(panel_->profile()); | 145 GtkThemeService* theme_provider = GtkThemeService::GetFrom(panel_->profile()); |
146 return theme_provider->UsingDefaultTheme(); | 146 return theme_provider->UsingDefaultTheme() || |
| 147 theme_provider->UsingNativeTheme(); |
147 } | 148 } |
148 | 149 |
149 bool PanelBrowserWindowGtk::GetWindowEdge(int x, int y, GdkWindowEdge* edge) { | 150 bool PanelBrowserWindowGtk::GetWindowEdge(int x, int y, GdkWindowEdge* edge) { |
150 // Only detect the window edge when panels can be resized by the user. | 151 // Only detect the window edge when panels can be resized by the user. |
151 // This method is used by the base class to detect when the cursor has | 152 // This method is used by the base class to detect when the cursor has |
152 // hit the window edge in order to change the cursor to a resize cursor | 153 // hit the window edge in order to change the cursor to a resize cursor |
153 // and to detect when to initiate a resize drag. | 154 // and to detect when to initiate a resize drag. |
154 panel::Resizability resizability = panel_->CanResizeByMouse(); | 155 panel::Resizability resizability = panel_->CanResizeByMouse(); |
155 if (panel::NOT_RESIZABLE == resizability) | 156 if (panel::NOT_RESIZABLE == resizability) |
156 return false; | 157 return false; |
(...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 break; | 759 break; |
759 case panel::RESTORE_BUTTON: | 760 case panel::RESTORE_BUTTON: |
760 button = titlebar->restore_button(); | 761 button = titlebar->restore_button(); |
761 break; | 762 break; |
762 default: | 763 default: |
763 NOTREACHED(); | 764 NOTREACHED(); |
764 return false; | 765 return false; |
765 } | 766 } |
766 return gtk_widget_get_visible(button->widget()); | 767 return gtk_widget_get_visible(button->widget()); |
767 } | 768 } |
OLD | NEW |