| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 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 | 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/views/frame/browser_frame_gtk.h" | 5 #include "chrome/browser/views/frame/browser_frame_gtk.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "chrome/browser/browser_theme_provider.h" | 8 #include "chrome/browser/browser_theme_provider.h" |
| 9 #include "chrome/browser/profile.h" | 9 #include "chrome/browser/profile.h" |
| 10 #include "chrome/browser/status_bubble.h" | 10 #include "chrome/browser/status_bubble.h" |
| 11 #include "chrome/browser/views/frame/app_panel_browser_frame_view.h" | 11 #include "chrome/browser/views/frame/app_panel_browser_frame_view.h" |
| 12 #include "chrome/browser/views/frame/browser_root_view.h" | 12 #include "chrome/browser/views/frame/browser_root_view.h" |
| 13 #include "chrome/browser/views/frame/browser_view.h" | 13 #include "chrome/browser/views/frame/browser_view.h" |
| 14 #include "chrome/browser/views/frame/opaque_browser_frame_view.h" | 14 #include "chrome/browser/views/frame/opaque_browser_frame_view.h" |
| 15 #include "chrome/browser/views/frame/popup_non_client_frame_view.h" |
| 15 #include "gfx/font.h" | 16 #include "gfx/font.h" |
| 16 #include "views/widget/root_view.h" | 17 #include "views/widget/root_view.h" |
| 17 #include "views/window/hit_test.h" | 18 #include "views/window/hit_test.h" |
| 18 | 19 |
| 19 namespace { | |
| 20 | |
| 21 // BrowserNonClientFrameView implementation for popups. We let the window | |
| 22 // manager implementation render the decorations for popups, so this draws | |
| 23 // nothing. | |
| 24 class PopupNonClientFrameView : public BrowserNonClientFrameView { | |
| 25 public: | |
| 26 PopupNonClientFrameView() { | |
| 27 } | |
| 28 | |
| 29 // NonClientFrameView: | |
| 30 virtual gfx::Rect GetBoundsForClientView() const { | |
| 31 return gfx::Rect(0, 0, width(), height()); | |
| 32 } | |
| 33 virtual bool AlwaysUseCustomFrame() const { return false; } | |
| 34 virtual bool AlwaysUseNativeFrame() const { return true; } | |
| 35 virtual gfx::Rect GetWindowBoundsForClientBounds( | |
| 36 const gfx::Rect& client_bounds) const { | |
| 37 return client_bounds; | |
| 38 } | |
| 39 virtual int NonClientHitTest(const gfx::Point& point) { | |
| 40 return bounds().Contains(point) ? HTCLIENT : HTNOWHERE; | |
| 41 } | |
| 42 virtual void GetWindowMask(const gfx::Size& size, | |
| 43 gfx::Path* window_mask) {} | |
| 44 virtual void EnableClose(bool enable) {} | |
| 45 virtual void ResetWindowControls() {} | |
| 46 | |
| 47 // BrowserNonClientFrameView: | |
| 48 virtual gfx::Rect GetBoundsForTabStrip(BaseTabStrip* tabstrip) const { | |
| 49 return gfx::Rect(0, 0, width(), tabstrip->GetPreferredHeight()); | |
| 50 } | |
| 51 virtual void UpdateThrobber(bool running) {} | |
| 52 | |
| 53 private: | |
| 54 DISALLOW_COPY_AND_ASSIGN(PopupNonClientFrameView); | |
| 55 }; | |
| 56 | |
| 57 } | |
| 58 | |
| 59 #if !defined(OS_CHROMEOS) | 20 #if !defined(OS_CHROMEOS) |
| 60 // static (Factory method.) | 21 // static (Factory method.) |
| 61 BrowserFrame* BrowserFrame::Create(BrowserView* browser_view, | 22 BrowserFrame* BrowserFrame::Create(BrowserView* browser_view, |
| 62 Profile* profile) { | 23 Profile* profile) { |
| 63 BrowserFrameGtk* frame = new BrowserFrameGtk(browser_view, profile); | 24 BrowserFrameGtk* frame = new BrowserFrameGtk(browser_view, profile); |
| 64 frame->Init(); | 25 frame->Init(); |
| 65 return frame; | 26 return frame; |
| 66 } | 27 } |
| 67 #endif | 28 #endif |
| 68 | 29 |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 if (was_full_screen != IsFullscreen()) | 142 if (was_full_screen != IsFullscreen()) |
| 182 browser_view_->FullScreenStateChanged(); | 143 browser_view_->FullScreenStateChanged(); |
| 183 return result; | 144 return result; |
| 184 } | 145 } |
| 185 | 146 |
| 186 gboolean BrowserFrameGtk::OnConfigureEvent(GtkWidget* widget, | 147 gboolean BrowserFrameGtk::OnConfigureEvent(GtkWidget* widget, |
| 187 GdkEventConfigure* event) { | 148 GdkEventConfigure* event) { |
| 188 browser_view_->WindowMoved(); | 149 browser_view_->WindowMoved(); |
| 189 return views::WindowGtk::OnConfigureEvent(widget, event); | 150 return views::WindowGtk::OnConfigureEvent(widget, event); |
| 190 } | 151 } |
| OLD | NEW |