| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ui/views/frame/browser_frame_aura.h" | 5 #include "chrome/browser/ui/views/frame/browser_frame_aura.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
| 9 #include "chrome/browser/ui/views/frame/browser_view.h" | 9 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 10 #include "grit/chromium_strings.h" | 10 #include "grit/chromium_strings.h" |
| 11 #include "grit/generated_resources.h" | 11 #include "grit/generated_resources.h" |
| 12 #include "ui/aura/client/aura_constants.h" | 12 #include "ui/aura/client/aura_constants.h" |
| 13 #include "ui/aura/window.h" | 13 #include "ui/aura/window.h" |
| 14 #include "ui/aura/window_observer.h" | 14 #include "ui/aura/window_observer.h" |
| 15 #include "ui/base/hit_test.h" | 15 #include "ui/base/hit_test.h" |
| 16 #include "ui/base/l10n/l10n_util.h" | 16 #include "ui/base/l10n/l10n_util.h" |
| 17 #include "ui/gfx/font.h" | 17 #include "ui/gfx/font.h" |
| 18 #include "ui/views/view.h" | 18 #include "ui/views/view.h" |
| 19 | 19 |
| 20 #if defined(USE_ASH) | 20 #if defined(USE_ASH) |
| 21 #include "ash/wm/window_util.h" | 21 #include "ash/wm/window_util.h" |
| 22 #include "chrome/browser/ui/ash/ash_init.h" | |
| 23 #endif | |
| 24 | |
| 25 #if !defined(OS_CHROMEOS) | |
| 26 #include "chrome/browser/ui/views/frame/desktop_browser_frame_aura.h" | |
| 27 #endif | 22 #endif |
| 28 | 23 |
| 29 using aura::Window; | 24 using aura::Window; |
| 30 | 25 |
| 31 //////////////////////////////////////////////////////////////////////////////// | 26 //////////////////////////////////////////////////////////////////////////////// |
| 32 // BrowserFrameAura::WindowPropertyWatcher | 27 // BrowserFrameAura::WindowPropertyWatcher |
| 33 | 28 |
| 34 class BrowserFrameAura::WindowPropertyWatcher : public aura::WindowObserver { | 29 class BrowserFrameAura::WindowPropertyWatcher : public aura::WindowObserver { |
| 35 public: | 30 public: |
| 36 explicit WindowPropertyWatcher(BrowserFrameAura* browser_frame_aura, | 31 explicit WindowPropertyWatcher(BrowserFrameAura* browser_frame_aura, |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 150 |
| 156 //////////////////////////////////////////////////////////////////////////////// | 151 //////////////////////////////////////////////////////////////////////////////// |
| 157 // BrowserFrame, public: | 152 // BrowserFrame, public: |
| 158 | 153 |
| 159 // static | 154 // static |
| 160 const gfx::Font& BrowserFrame::GetTitleFont() { | 155 const gfx::Font& BrowserFrame::GetTitleFont() { |
| 161 static gfx::Font* title_font = new gfx::Font; | 156 static gfx::Font* title_font = new gfx::Font; |
| 162 return *title_font; | 157 return *title_font; |
| 163 } | 158 } |
| 164 | 159 |
| 165 //////////////////////////////////////////////////////////////////////////////// | |
| 166 // NativeBrowserFrame, public: | |
| 167 | |
| 168 // static | |
| 169 NativeBrowserFrame* NativeBrowserFrame::CreateNativeBrowserFrame( | |
| 170 BrowserFrame* browser_frame, | |
| 171 BrowserView* browser_view) { | |
| 172 #if !defined(OS_CHROMEOS) | |
| 173 if ( | |
| 174 #if defined(USE_ASH) | |
| 175 !chrome::ShouldOpenAshOnStartup() && | |
| 176 #endif | |
| 177 browser_view->browser()-> | |
| 178 host_desktop_type() == chrome::HOST_DESKTOP_TYPE_NATIVE) | |
| 179 return new DesktopBrowserFrameAura(browser_frame, browser_view); | |
| 180 #endif | |
| 181 return new BrowserFrameAura(browser_frame, browser_view); | |
| 182 } | |
| 183 | |
| 184 /////////////////////////////////////////////////////////////////////////////// | 160 /////////////////////////////////////////////////////////////////////////////// |
| 185 // BrowserFrameAura, private: | 161 // BrowserFrameAura, private: |
| 186 | 162 |
| 187 BrowserFrameAura::~BrowserFrameAura() { | 163 BrowserFrameAura::~BrowserFrameAura() { |
| 188 } | 164 } |
| 189 | 165 |
| 190 void BrowserFrameAura::SetWindowAutoManaged() { | 166 void BrowserFrameAura::SetWindowAutoManaged() { |
| 191 #if defined(USE_ASH) | 167 #if defined(USE_ASH) |
| 192 if (browser_view_->browser()->type() != Browser::TYPE_POPUP || | 168 if (browser_view_->browser()->type() != Browser::TYPE_POPUP || |
| 193 browser_view_->browser()->is_app()) | 169 browser_view_->browser()->is_app()) |
| 194 ash::wm::SetWindowPositionManaged(GetNativeWindow(), true); | 170 ash::wm::SetWindowPositionManaged(GetNativeWindow(), true); |
| 195 #endif | 171 #endif |
| 196 } | 172 } |
| OLD | NEW |