OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "base/i18n/rtl.h" | 11 #include "base/i18n/rtl.h" |
12 #include "base/location.h" | 12 #include "base/location.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
15 #include "base/prefs/pref_service.h" | 15 #include "base/prefs/pref_service.h" |
16 #include "base/profiler/scoped_tracker.h" | 16 #include "base/profiler/scoped_tracker.h" |
17 #include "base/single_thread_task_runner.h" | 17 #include "base/single_thread_task_runner.h" |
18 #include "base/strings/string_number_conversions.h" | 18 #include "base/strings/string_number_conversions.h" |
19 #include "base/thread_task_runner_handle.h" | 19 #include "base/thread_task_runner_handle.h" |
20 #include "chrome/app/chrome_command_ids.h" | 20 #include "chrome/app/chrome_command_ids.h" |
21 #include "chrome/app/chrome_dll_resource.h" | 21 #include "chrome/app/chrome_dll_resource.h" |
22 #include "chrome/browser/app_mode/app_mode_utils.h" | 22 #include "chrome/browser/app_mode/app_mode_utils.h" |
23 #include "chrome/browser/bookmarks/bookmark_stats.h" | 23 #include "chrome/browser/bookmarks/bookmark_stats.h" |
24 #include "chrome/browser/browser_process.h" | 24 #include "chrome/browser/browser_process.h" |
25 #include "chrome/browser/chrome_notification_types.h" | 25 #include "chrome/browser/chrome_notification_types.h" |
26 #include "chrome/browser/extensions/extension_util.h" | 26 #include "chrome/browser/extensions/extension_util.h" |
27 #include "chrome/browser/extensions/tab_helper.h" | 27 #include "chrome/browser/extensions/tab_helper.h" |
28 #include "chrome/browser/infobars/infobar_service.h" | 28 #include "chrome/browser/infobars/infobar_service.h" |
29 #include "chrome/browser/mojo_runner_util.h" | |
30 #include "chrome/browser/native_window_notification_source.h" | 29 #include "chrome/browser/native_window_notification_source.h" |
31 #include "chrome/browser/profiles/avatar_menu.h" | 30 #include "chrome/browser/profiles/avatar_menu.h" |
32 #include "chrome/browser/profiles/profile.h" | 31 #include "chrome/browser/profiles/profile.h" |
33 #include "chrome/browser/profiles/profile_avatar_icon_util.h" | 32 #include "chrome/browser/profiles/profile_avatar_icon_util.h" |
34 #include "chrome/browser/profiles/profile_info_cache.h" | 33 #include "chrome/browser/profiles/profile_info_cache.h" |
35 #include "chrome/browser/profiles/profile_manager.h" | 34 #include "chrome/browser/profiles/profile_manager.h" |
36 #include "chrome/browser/profiles/profile_window.h" | 35 #include "chrome/browser/profiles/profile_window.h" |
37 #include "chrome/browser/profiles/profiles_state.h" | 36 #include "chrome/browser/profiles/profiles_state.h" |
38 #include "chrome/browser/search/search.h" | 37 #include "chrome/browser/search/search.h" |
39 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 38 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 #if defined(ENABLE_ONE_CLICK_SIGNIN) | 163 #if defined(ENABLE_ONE_CLICK_SIGNIN) |
165 #include "chrome/browser/ui/sync/one_click_signin_bubble_delegate.h" | 164 #include "chrome/browser/ui/sync/one_click_signin_bubble_delegate.h" |
166 #include "chrome/browser/ui/sync/one_click_signin_bubble_links_delegate.h" | 165 #include "chrome/browser/ui/sync/one_click_signin_bubble_links_delegate.h" |
167 #include "chrome/browser/ui/views/sync/one_click_signin_bubble_view.h" | 166 #include "chrome/browser/ui/views/sync/one_click_signin_bubble_view.h" |
168 #endif | 167 #endif |
169 | 168 |
170 #if defined(OS_CHROMEOS) | 169 #if defined(OS_CHROMEOS) |
171 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" | 170 #include "chrome/browser/ui/ash/multi_user/multi_user_window_manager.h" |
172 #endif | 171 #endif |
173 | 172 |
| 173 #if defined(MOJO_SHELL_CLIENT) |
| 174 #include "content/public/common/mojo_shell_connection.h" |
| 175 #endif |
| 176 |
174 using base::TimeDelta; | 177 using base::TimeDelta; |
175 using base::UserMetricsAction; | 178 using base::UserMetricsAction; |
176 using content::NativeWebKeyboardEvent; | 179 using content::NativeWebKeyboardEvent; |
177 using content::WebContents; | 180 using content::WebContents; |
178 using views::ColumnSet; | 181 using views::ColumnSet; |
179 using views::GridLayout; | 182 using views::GridLayout; |
180 using web_modal::WebContentsModalDialogHost; | 183 using web_modal::WebContentsModalDialogHost; |
181 | 184 |
182 namespace { | 185 namespace { |
183 | 186 |
(...skipping 2198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2382 return false; | 2385 return false; |
2383 } | 2386 } |
2384 | 2387 |
2385 return url.is_empty(); | 2388 return url.is_empty(); |
2386 } | 2389 } |
2387 | 2390 |
2388 void BrowserView::LoadAccelerators() { | 2391 void BrowserView::LoadAccelerators() { |
2389 // TODO(beng): for some reason GetFocusManager() returns null in this case, | 2392 // TODO(beng): for some reason GetFocusManager() returns null in this case, |
2390 // investigate, but for now just disable accelerators in this | 2393 // investigate, but for now just disable accelerators in this |
2391 // mode. | 2394 // mode. |
2392 if (IsRunningInMojoRunner()) | 2395 #if defined(MOJO_SHELL_CLIENT) |
| 2396 if (content::MojoShellConnection::Get()) |
2393 return; | 2397 return; |
| 2398 #endif |
2394 | 2399 |
2395 views::FocusManager* focus_manager = GetFocusManager(); | 2400 views::FocusManager* focus_manager = GetFocusManager(); |
2396 DCHECK(focus_manager); | 2401 DCHECK(focus_manager); |
2397 | 2402 |
2398 // Let's fill our own accelerator table. | 2403 // Let's fill our own accelerator table. |
2399 const bool is_app_mode = chrome::IsRunningInForcedAppMode(); | 2404 const bool is_app_mode = chrome::IsRunningInForcedAppMode(); |
2400 const std::vector<chrome::AcceleratorMapping> accelerator_list( | 2405 const std::vector<chrome::AcceleratorMapping> accelerator_list( |
2401 chrome::GetAcceleratorList()); | 2406 chrome::GetAcceleratorList()); |
2402 for (std::vector<chrome::AcceleratorMapping>::const_iterator it = | 2407 for (std::vector<chrome::AcceleratorMapping>::const_iterator it = |
2403 accelerator_list.begin(); it != accelerator_list.end(); ++it) { | 2408 accelerator_list.begin(); it != accelerator_list.end(); ++it) { |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2652 return immersive_mode_controller()->IsEnabled(); | 2657 return immersive_mode_controller()->IsEnabled(); |
2653 } | 2658 } |
2654 | 2659 |
2655 views::Widget* BrowserView::GetBubbleAssociatedWidget() { | 2660 views::Widget* BrowserView::GetBubbleAssociatedWidget() { |
2656 return GetWidget(); | 2661 return GetWidget(); |
2657 } | 2662 } |
2658 | 2663 |
2659 gfx::Rect BrowserView::GetTopContainerBoundsInScreen() { | 2664 gfx::Rect BrowserView::GetTopContainerBoundsInScreen() { |
2660 return top_container_->GetBoundsInScreen(); | 2665 return top_container_->GetBoundsInScreen(); |
2661 } | 2666 } |
OLD | NEW |