| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/opaque_browser_frame_view_linux.h" | 5 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view_linux.h" |
| 6 | 6 |
| 7 #include "chrome/browser/themes/theme_service.h" | 7 #include "chrome/browser/themes/theme_service.h" |
| 8 #include "chrome/browser/themes/theme_service_factory.h" | 8 #include "chrome/browser/themes/theme_service_factory.h" |
| 9 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h" | 9 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h" |
| 10 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.h" | 10 #include "chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 if (ui) | 24 if (ui) |
| 25 ui->AddWindowButtonOrderObserver(this); | 25 ui->AddWindowButtonOrderObserver(this); |
| 26 } | 26 } |
| 27 | 27 |
| 28 OpaqueBrowserFrameViewLinux::~OpaqueBrowserFrameViewLinux() { | 28 OpaqueBrowserFrameViewLinux::~OpaqueBrowserFrameViewLinux() { |
| 29 views::LinuxUI* ui = views::LinuxUI::instance(); | 29 views::LinuxUI* ui = views::LinuxUI::instance(); |
| 30 if (ui) | 30 if (ui) |
| 31 ui->RemoveWindowButtonOrderObserver(this); | 31 ui->RemoveWindowButtonOrderObserver(this); |
| 32 } | 32 } |
| 33 | 33 |
| 34 bool OpaqueBrowserFrameViewLinux::IsUsingNativeTheme() { | 34 bool OpaqueBrowserFrameViewLinux::IsUsingSystemTheme() { |
| 35 // On X11, this does the correct thing. On Windows, UsingNativeTheme() will | 35 // On X11, this does the correct thing. On Windows, UsingSystemTheme() will |
| 36 // return true when using the default blue theme too. | 36 // return true when using the default blue theme too. |
| 37 return theme_service_->UsingNativeTheme(); | 37 return theme_service_->UsingSystemTheme(); |
| 38 } | 38 } |
| 39 | 39 |
| 40 /////////////////////////////////////////////////////////////////////////////// | 40 /////////////////////////////////////////////////////////////////////////////// |
| 41 // OpaqueBrowserFrameViewLinux, | 41 // OpaqueBrowserFrameViewLinux, |
| 42 // views::WindowButtonOrderObserver implementation: | 42 // views::WindowButtonOrderObserver implementation: |
| 43 | 43 |
| 44 void OpaqueBrowserFrameViewLinux::OnWindowButtonOrderingChange( | 44 void OpaqueBrowserFrameViewLinux::OnWindowButtonOrderingChange( |
| 45 const std::vector<views::FrameButton>& leading_buttons, | 45 const std::vector<views::FrameButton>& leading_buttons, |
| 46 const std::vector<views::FrameButton>& trailing_buttons) { | 46 const std::vector<views::FrameButton>& trailing_buttons) { |
| 47 layout_->SetButtonOrdering(leading_buttons, trailing_buttons); | 47 layout_->SetButtonOrdering(leading_buttons, trailing_buttons); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 59 // OpaqueBrowserFrameViewObserver: | 59 // OpaqueBrowserFrameViewObserver: |
| 60 | 60 |
| 61 // static | 61 // static |
| 62 OpaqueBrowserFrameViewPlatformSpecific* | 62 OpaqueBrowserFrameViewPlatformSpecific* |
| 63 OpaqueBrowserFrameViewPlatformSpecific::Create( | 63 OpaqueBrowserFrameViewPlatformSpecific::Create( |
| 64 OpaqueBrowserFrameView* view, | 64 OpaqueBrowserFrameView* view, |
| 65 OpaqueBrowserFrameViewLayout* layout, | 65 OpaqueBrowserFrameViewLayout* layout, |
| 66 Profile* profile) { | 66 Profile* profile) { |
| 67 return new OpaqueBrowserFrameViewLinux(view, layout, profile); | 67 return new OpaqueBrowserFrameViewLinux(view, layout, profile); |
| 68 } | 68 } |
| OLD | NEW |