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" |
(...skipping 17 matching lines...) Expand all Loading... | |
28 #include "ui/base/hit_test.h" | 28 #include "ui/base/hit_test.h" |
29 #include "ui/events/event_handler.h" | 29 #include "ui/events/event_handler.h" |
30 #include "ui/gfx/font_list.h" | 30 #include "ui/gfx/font_list.h" |
31 #include "ui/views/controls/menu/menu_model_adapter.h" | 31 #include "ui/views/controls/menu/menu_model_adapter.h" |
32 #include "ui/views/controls/menu/menu_runner.h" | 32 #include "ui/views/controls/menu/menu_runner.h" |
33 #include "ui/views/widget/native_widget.h" | 33 #include "ui/views/widget/native_widget.h" |
34 | 34 |
35 #if defined(OS_CHROMEOS) | 35 #if defined(OS_CHROMEOS) |
36 #include "ash/common/session/session_state_delegate.h" // nogncheck | 36 #include "ash/common/session/session_state_delegate.h" // nogncheck |
37 #include "ash/common/wm_shell.h" // nogncheck | 37 #include "ash/common/wm_shell.h" // nogncheck |
38 #include "chrome/browser/ui/ash/metrics/stylus_metrics_recorder_chromeos.h" | |
38 #include "ui/native_theme/native_theme_dark_aura.h" // nogncheck | 39 #include "ui/native_theme/native_theme_dark_aura.h" // nogncheck |
39 #endif | 40 #endif |
40 | 41 |
41 #if defined(OS_LINUX) | 42 #if defined(OS_LINUX) |
42 #include "chrome/browser/ui/views/frame/browser_command_handler_linux.h" | 43 #include "chrome/browser/ui/views/frame/browser_command_handler_linux.h" |
43 #endif | 44 #endif |
44 | 45 |
45 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 46 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
46 #include "ui/views/widget/desktop_aura/x11_desktop_handler.h" | 47 #include "ui/views/widget/desktop_aura/x11_desktop_handler.h" |
47 #endif | 48 #endif |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
92 *base::CommandLine::ForCurrentProcess(); | 93 *base::CommandLine::ForCurrentProcess(); |
93 | 94 |
94 if (parsed_command_line.HasSwitch(switches::kWindowWorkspace)) { | 95 if (parsed_command_line.HasSwitch(switches::kWindowWorkspace)) { |
95 params.workspace = | 96 params.workspace = |
96 parsed_command_line.GetSwitchValueASCII(switches::kWindowWorkspace); | 97 parsed_command_line.GetSwitchValueASCII(switches::kWindowWorkspace); |
97 } | 98 } |
98 } | 99 } |
99 | 100 |
100 Init(params); | 101 Init(params); |
101 | 102 |
103 #if defined(OS_CHROMEOS) | |
104 browser_view_->GetNativeWindow()->SetProperty( | |
105 chromeos::kStylusWindowTypeBucket, | |
106 chromeos::StylusWindowType::WINDOW_TYPE_BROWSER_WINDOW); | |
sky
2016/09/16 23:20:17
This also includes things like popups. Are you sur
xiaoyinh(OOO Sep 11-29)
2016/09/19 21:19:53
Moved to BrowserNonClientFrameViewAsh::Init()
I f
sky
2016/09/19 23:36:53
I'm not familiar with what you're considering 'bro
| |
107 #endif | |
108 | |
102 if (!native_browser_frame_->UsesNativeSystemMenu()) { | 109 if (!native_browser_frame_->UsesNativeSystemMenu()) { |
103 DCHECK(non_client_view()); | 110 DCHECK(non_client_view()); |
104 non_client_view()->set_context_menu_controller(this); | 111 non_client_view()->set_context_menu_controller(this); |
105 } | 112 } |
106 | 113 |
107 #if defined(OS_LINUX) | 114 #if defined(OS_LINUX) |
108 browser_command_handler_.reset(new BrowserCommandHandlerLinux(browser_view_)); | 115 browser_command_handler_.reset(new BrowserCommandHandlerLinux(browser_view_)); |
109 #endif | 116 #endif |
110 } | 117 } |
111 | 118 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
294 } | 301 } |
295 | 302 |
296 views::View* BrowserFrame::GetNewAvatarMenuButton() { | 303 views::View* BrowserFrame::GetNewAvatarMenuButton() { |
297 return browser_frame_view_->GetProfileSwitcherView(); | 304 return browser_frame_view_->GetProfileSwitcherView(); |
298 } | 305 } |
299 | 306 |
300 void BrowserFrame::OnMenuClosed() { | 307 void BrowserFrame::OnMenuClosed() { |
301 menu_model_adapter_.reset(); | 308 menu_model_adapter_.reset(); |
302 menu_runner_.reset(); | 309 menu_runner_.reset(); |
303 } | 310 } |
OLD | NEW |