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