1 // Copyright (c) 2011 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/ui/views/frame/browser_frame.h" 6 7 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" 8 #include "chrome/browser/ui/views/frame/browser_root_view.h" 9 #include "chrome/browser/ui/views/frame/browser_view.h" 10 #include "chrome/browser/ui/views/frame/native_browser_frame.h" 11 #include "views/widget/native_widget.h" 12 #include "views/widget/widget.h" 13 #include "views/window/native_window.h" 14 #include "views/window/window.h" 15 16 //////////////////////////////////////////////////////////////////////////////// 17 // BrowserFrame, public: 18 ~BrowserFrame()19BrowserFrame::~BrowserFrame() { 20 } 21 GetWindow()22views::Window* BrowserFrame::GetWindow() { 23 return native_browser_frame_->AsNativeWindow()->GetWindow(); 24 } 25 GetMinimizeButtonOffset() const26int BrowserFrame::GetMinimizeButtonOffset() const { 27 return native_browser_frame_->GetMinimizeButtonOffset(); 28 } 29 GetBoundsForTabStrip(views::View * tabstrip) const30gfx::Rect BrowserFrame::GetBoundsForTabStrip(views::View* tabstrip) const { 31 return browser_frame_view_->GetBoundsForTabStrip(tabstrip); 32 } 33 GetHorizontalTabStripVerticalOffset(bool restored) const34int BrowserFrame::GetHorizontalTabStripVerticalOffset(bool restored) const { 35 return browser_frame_view_->GetHorizontalTabStripVerticalOffset(restored); 36 } 37 UpdateThrobber(bool running)38void BrowserFrame::UpdateThrobber(bool running) { 39 browser_frame_view_->UpdateThrobber(running); 40 } 41 GetThemeProviderForFrame() const42ui::ThemeProvider* BrowserFrame::GetThemeProviderForFrame() const { 43 return native_browser_frame_->GetThemeProviderForFrame(); 44 } 45 AlwaysUseNativeFrame() const46bool BrowserFrame::AlwaysUseNativeFrame() const { 47 return native_browser_frame_->AlwaysUseNativeFrame(); 48 } 49 GetFrameView() const50views::View* BrowserFrame::GetFrameView() const { 51 return browser_frame_view_; 52 } 53 TabStripDisplayModeChanged()54void BrowserFrame::TabStripDisplayModeChanged() { 55 native_browser_frame_->TabStripDisplayModeChanged(); 56 } 57 58 //////////////////////////////////////////////////////////////////////////////// 59 // BrowserFrame, NativeBrowserFrameDelegate implementation: 60 DelegateCreateRootView()61views::RootView* BrowserFrame::DelegateCreateRootView() { 62 root_view_ = new BrowserRootView( 63 browser_view_, 64 native_browser_frame_->AsNativeWindow()->AsNativeWidget()->GetWidget()); 65 return root_view_; 66 } 67 DelegateCreateFrameViewForWindow()68views::NonClientFrameView* BrowserFrame::DelegateCreateFrameViewForWindow() { 69 browser_frame_view_ = 70 native_browser_frame_->CreateBrowserNonClientFrameView(); 71 return browser_frame_view_; 72 } 73 74 75 //////////////////////////////////////////////////////////////////////////////// 76 // BrowserFrame, protected: 77 BrowserFrame(BrowserView * browser_view)78BrowserFrame::BrowserFrame(BrowserView* browser_view) 79 : native_browser_frame_(NULL), 80 root_view_(NULL), 81 browser_frame_view_(NULL), 82 browser_view_(browser_view) { 83 } 84