| 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.h" | 5 #include "chrome/browser/ui/views/frame/browser_frame.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/debug/leak_annotations.h" | 10 #include "base/debug/leak_annotations.h" |
| 11 #include "base/i18n/rtl.h" | 11 #include "base/i18n/rtl.h" |
| 12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 #include "chrome/browser/app_mode/app_mode_utils.h" | 13 #include "chrome/browser/app_mode/app_mode_utils.h" |
| 14 #include "chrome/browser/themes/theme_service.h" | 14 #include "chrome/browser/themes/theme_service.h" |
| 15 #include "chrome/browser/themes/theme_service_factory.h" | 15 #include "chrome/browser/themes/theme_service_factory.h" |
| 16 #include "chrome/browser/ui/ash/metrics/stylus_metrics_recorder.h" |
| 16 #include "chrome/browser/ui/browser.h" | 17 #include "chrome/browser/ui/browser.h" |
| 17 #include "chrome/browser/ui/browser_list.h" | 18 #include "chrome/browser/ui/browser_list.h" |
| 18 #include "chrome/browser/ui/browser_window_state.h" | 19 #include "chrome/browser/ui/browser_window_state.h" |
| 19 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" | 20 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" |
| 20 #include "chrome/browser/ui/views/frame/browser_root_view.h" | 21 #include "chrome/browser/ui/views/frame/browser_root_view.h" |
| 21 #include "chrome/browser/ui/views/frame/browser_view.h" | 22 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 22 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" | 23 #include "chrome/browser/ui/views/frame/immersive_mode_controller.h" |
| 23 #include "chrome/browser/ui/views/frame/native_browser_frame.h" | 24 #include "chrome/browser/ui/views/frame/native_browser_frame.h" |
| 24 #include "chrome/browser/ui/views/frame/native_browser_frame_factory.h" | 25 #include "chrome/browser/ui/views/frame/native_browser_frame_factory.h" |
| 25 #include "chrome/browser/ui/views/frame/system_menu_model_builder.h" | 26 #include "chrome/browser/ui/views/frame/system_menu_model_builder.h" |
| 26 #include "chrome/browser/ui/views/frame/top_container_view.h" | 27 #include "chrome/browser/ui/views/frame/top_container_view.h" |
| 27 #include "chrome/common/chrome_switches.h" | 28 #include "chrome/common/chrome_switches.h" |
| 29 #include "ui/aura/client/aura_constants.h" |
| 28 #include "ui/base/hit_test.h" | 30 #include "ui/base/hit_test.h" |
| 29 #include "ui/events/event_handler.h" | 31 #include "ui/events/event_handler.h" |
| 30 #include "ui/gfx/font_list.h" | 32 #include "ui/gfx/font_list.h" |
| 31 #include "ui/views/controls/menu/menu_model_adapter.h" | 33 #include "ui/views/controls/menu/menu_model_adapter.h" |
| 32 #include "ui/views/controls/menu/menu_runner.h" | 34 #include "ui/views/controls/menu/menu_runner.h" |
| 33 #include "ui/views/widget/native_widget.h" | 35 #include "ui/views/widget/native_widget.h" |
| 34 | 36 |
| 35 #if defined(OS_CHROMEOS) | 37 #if defined(OS_CHROMEOS) |
| 36 #include "ash/common/session/session_state_delegate.h" // nogncheck | 38 #include "ash/common/session/session_state_delegate.h" // nogncheck |
| 37 #include "ash/common/wm_shell.h" // nogncheck | 39 #include "ash/common/wm_shell.h" // nogncheck |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 const base::CommandLine& parsed_command_line = | 93 const base::CommandLine& parsed_command_line = |
| 92 *base::CommandLine::ForCurrentProcess(); | 94 *base::CommandLine::ForCurrentProcess(); |
| 93 | 95 |
| 94 if (parsed_command_line.HasSwitch(switches::kWindowWorkspace)) { | 96 if (parsed_command_line.HasSwitch(switches::kWindowWorkspace)) { |
| 95 params.workspace = | 97 params.workspace = |
| 96 parsed_command_line.GetSwitchValueASCII(switches::kWindowWorkspace); | 98 parsed_command_line.GetSwitchValueASCII(switches::kWindowWorkspace); |
| 97 } | 99 } |
| 98 } | 100 } |
| 99 | 101 |
| 100 Init(params); | 102 Init(params); |
| 103 browser_view_->GetNativeWindow()->SetProperty( |
| 104 aura::client::kStylusWindowTypeBucket, |
| 105 static_cast<int>(chromeos::StylusWindowType::WINDOW_TYPE_BROWSER_WINDOW)); |
| 101 | 106 |
| 102 if (!native_browser_frame_->UsesNativeSystemMenu()) { | 107 if (!native_browser_frame_->UsesNativeSystemMenu()) { |
| 103 DCHECK(non_client_view()); | 108 DCHECK(non_client_view()); |
| 104 non_client_view()->set_context_menu_controller(this); | 109 non_client_view()->set_context_menu_controller(this); |
| 105 } | 110 } |
| 106 | 111 |
| 107 #if defined(OS_LINUX) | 112 #if defined(OS_LINUX) |
| 108 browser_command_handler_.reset(new BrowserCommandHandlerLinux(browser_view_)); | 113 browser_command_handler_.reset(new BrowserCommandHandlerLinux(browser_view_)); |
| 109 #endif | 114 #endif |
| 110 } | 115 } |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 } | 299 } |
| 295 | 300 |
| 296 views::View* BrowserFrame::GetNewAvatarMenuButton() { | 301 views::View* BrowserFrame::GetNewAvatarMenuButton() { |
| 297 return browser_frame_view_->GetProfileSwitcherView(); | 302 return browser_frame_view_->GetProfileSwitcherView(); |
| 298 } | 303 } |
| 299 | 304 |
| 300 void BrowserFrame::OnMenuClosed() { | 305 void BrowserFrame::OnMenuClosed() { |
| 301 menu_model_adapter_.reset(); | 306 menu_model_adapter_.reset(); |
| 302 menu_runner_.reset(); | 307 menu_runner_.reset(); |
| 303 } | 308 } |
| OLD | NEW |