blob: b32d5fb8d242b9a440ff6e475cdd2b348130e6d4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/chromeos/frame/browser_frame_chromeos.h"
#include "base/command_line.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h"
#include "chrome/common/chrome_switches.h"
// static (Factory method.)
BrowserFrame* BrowserFrame::Create(BrowserView* browser_view,
Profile* profile) {
chromeos::BrowserFrameChromeos* frame =
new chromeos::BrowserFrameChromeos(browser_view, profile);
frame->InitBrowserFrame();
return frame;
}
namespace chromeos {
BrowserFrameChromeos::BrowserFrameChromeos(
BrowserView* browser_view, Profile* profile)
: BrowserFrameGtk(browser_view, profile) {
}
BrowserFrameChromeos::~BrowserFrameChromeos() {
}
void BrowserFrameChromeos::InitBrowserFrame() {
// NOTE: This logic supersedes the logic in BrowserFrameGtk::Init()
// by always setting browser_frame_view_.
set_browser_frame_view(
browser::CreateBrowserNonClientFrameView(this, browser_view()));
BrowserFrameGtk::InitBrowserFrame();
if (!browser_view()->IsBrowserTypePopup()) {
// On chromeos we want windows to always render as active.
non_client_view()->DisableInactiveRendering(true);
}
}
bool BrowserFrameChromeos::IsMaximized() const {
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeosFrame))
return WindowGtk::IsMaximized();
bool is_popup = browser_view()->IsBrowserTypePopup();
return !IsFullscreen() && (!is_popup || WindowGtk::IsMaximized());
}
} // namespace chromeos
|