This source file includes following definitions.
- theme_service_
- IsUsingNativeTheme
- OnWindowButtonOrderingChange
- Create
#include "chrome/browser/ui/views/frame/opaque_browser_frame_view_linux.h"
#include "chrome/browser/themes/theme_service.h"
#include "chrome/browser/themes/theme_service_factory.h"
#include "chrome/browser/ui/views/frame/opaque_browser_frame_view.h"
#include "chrome/browser/ui/views/frame/opaque_browser_frame_view_layout.h"
#include "ui/views/linux_ui/linux_ui.h"
OpaqueBrowserFrameViewLinux::OpaqueBrowserFrameViewLinux(
OpaqueBrowserFrameView* view,
OpaqueBrowserFrameViewLayout* layout,
Profile* profile)
: view_(view),
layout_(layout),
theme_service_(ThemeServiceFactory::GetForProfile(profile)) {
views::LinuxUI* ui = views::LinuxUI::instance();
if (ui)
ui->AddWindowButtonOrderObserver(this);
}
OpaqueBrowserFrameViewLinux::~OpaqueBrowserFrameViewLinux() {
views::LinuxUI* ui = views::LinuxUI::instance();
if (ui)
ui->RemoveWindowButtonOrderObserver(this);
}
bool OpaqueBrowserFrameViewLinux::IsUsingNativeTheme() {
return theme_service_->UsingNativeTheme();
}
void OpaqueBrowserFrameViewLinux::OnWindowButtonOrderingChange(
const std::vector<views::FrameButton>& leading_buttons,
const std::vector<views::FrameButton>& trailing_buttons) {
layout_->SetButtonOrdering(leading_buttons, trailing_buttons);
if (view_->GetWidget()) {
view_->Layout();
view_->SchedulePaint();
}
}
OpaqueBrowserFrameViewPlatformSpecific*
OpaqueBrowserFrameViewPlatformSpecific::Create(
OpaqueBrowserFrameView* view,
OpaqueBrowserFrameViewLayout* layout,
Profile* profile) {
return new OpaqueBrowserFrameViewLinux(view, layout, profile);
}