| 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 "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
| 8 #include "chrome/browser/ui/views/frame/browser_view.h" | 9 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 9 #include "chrome/browser/ui/views/frame/system_menu_model_delegate.h" | 10 #include "chrome/browser/ui/views/frame/system_menu_model_delegate.h" |
| 10 #include "grit/chromium_strings.h" | 11 #include "grit/chromium_strings.h" |
| 11 #include "grit/generated_resources.h" | 12 #include "grit/generated_resources.h" |
| 12 #include "ui/aura/client/aura_constants.h" | 13 #include "ui/aura/client/aura_constants.h" |
| 13 #include "ui/aura/window.h" | 14 #include "ui/aura/window.h" |
| 14 #include "ui/aura/window_observer.h" | 15 #include "ui/aura/window_observer.h" |
| 15 #include "ui/base/hit_test.h" | 16 #include "ui/base/hit_test.h" |
| 16 #include "ui/base/l10n/l10n_util.h" | 17 #include "ui/base/l10n/l10n_util.h" |
| 17 #include "ui/base/models/simple_menu_model.h" | 18 #include "ui/base/models/simple_menu_model.h" |
| 18 #include "ui/gfx/font.h" | 19 #include "ui/gfx/font.h" |
| 19 #include "ui/views/controls/menu/menu_model_adapter.h" | 20 #include "ui/views/controls/menu/menu_model_adapter.h" |
| 20 #include "ui/views/controls/menu/menu_runner.h" | 21 #include "ui/views/controls/menu/menu_runner.h" |
| 21 #include "ui/views/view.h" | 22 #include "ui/views/view.h" |
| 23 #include "ui/views/views_switches.h" |
| 22 | 24 |
| 23 #if defined(USE_ASH) | 25 #if defined(USE_ASH) |
| 24 #include "ash/wm/property_util.h" | 26 #include "ash/wm/property_util.h" |
| 25 #endif | 27 #endif |
| 26 | 28 |
| 29 #if !defined(OS_CHROMEOS) |
| 30 #include "chrome/browser/ui/views/frame/desktop_browser_frame_aura.h" |
| 31 #endif |
| 32 |
| 27 using aura::Window; | 33 using aura::Window; |
| 28 | 34 |
| 29 //////////////////////////////////////////////////////////////////////////////// | 35 //////////////////////////////////////////////////////////////////////////////// |
| 30 // BrowserFrameAura::WindowPropertyWatcher | 36 // BrowserFrameAura::WindowPropertyWatcher |
| 31 | 37 |
| 32 class BrowserFrameAura::WindowPropertyWatcher : public aura::WindowObserver { | 38 class BrowserFrameAura::WindowPropertyWatcher : public aura::WindowObserver { |
| 33 public: | 39 public: |
| 34 explicit WindowPropertyWatcher(BrowserFrameAura* browser_frame_aura, | 40 explicit WindowPropertyWatcher(BrowserFrameAura* browser_frame_aura, |
| 35 BrowserFrame* browser_frame) | 41 BrowserFrame* browser_frame) |
| 36 : browser_frame_aura_(browser_frame_aura), | 42 : browser_frame_aura_(browser_frame_aura), |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 return *title_font; | 186 return *title_font; |
| 181 } | 187 } |
| 182 | 188 |
| 183 //////////////////////////////////////////////////////////////////////////////// | 189 //////////////////////////////////////////////////////////////////////////////// |
| 184 // NativeBrowserFrame, public: | 190 // NativeBrowserFrame, public: |
| 185 | 191 |
| 186 // static | 192 // static |
| 187 NativeBrowserFrame* NativeBrowserFrame::CreateNativeBrowserFrame( | 193 NativeBrowserFrame* NativeBrowserFrame::CreateNativeBrowserFrame( |
| 188 BrowserFrame* browser_frame, | 194 BrowserFrame* browser_frame, |
| 189 BrowserView* browser_view) { | 195 BrowserView* browser_view) { |
| 196 #if !defined(OS_CHROMEOS) |
| 197 if (CommandLine::ForCurrentProcess()->HasSwitch(views::switches::kWinAura)) |
| 198 return new DesktopBrowserFrameAura(browser_frame, browser_view); |
| 199 #endif |
| 190 return new BrowserFrameAura(browser_frame, browser_view); | 200 return new BrowserFrameAura(browser_frame, browser_view); |
| 191 } | 201 } |
| 192 | 202 |
| 193 /////////////////////////////////////////////////////////////////////////////// | 203 /////////////////////////////////////////////////////////////////////////////// |
| 194 // BrowserFrameAura, private: | 204 // BrowserFrameAura, private: |
| 195 | 205 |
| 196 BrowserFrameAura::~BrowserFrameAura() { | 206 BrowserFrameAura::~BrowserFrameAura() { |
| 197 } | 207 } |
| OLD | NEW |