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/ash/chrome_shell_delegate.h" | 5 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
| 9 #include <limits> |
| 10 |
9 #include "ash/accelerators/magnifier_key_scroller.h" | 11 #include "ash/accelerators/magnifier_key_scroller.h" |
10 #include "ash/accelerators/spoken_feedback_toggler.h" | 12 #include "ash/accelerators/spoken_feedback_toggler.h" |
11 #include "ash/aura/wm_window_aura.h" | 13 #include "ash/aura/wm_window_aura.h" |
12 #include "ash/common/accessibility_delegate.h" | 14 #include "ash/common/accessibility_delegate.h" |
13 #include "ash/common/accessibility_types.h" | 15 #include "ash/common/accessibility_types.h" |
14 #include "ash/common/session/session_state_delegate.h" | 16 #include "ash/common/session/session_state_delegate.h" |
15 #include "ash/common/wm/mru_window_tracker.h" | 17 #include "ash/common/wm/mru_window_tracker.h" |
16 #include "ash/common/wm/window_state.h" | 18 #include "ash/common/wm/window_state.h" |
17 #include "ash/common/wm_shell.h" | 19 #include "ash/common/wm_shell.h" |
18 #include "ash/content/gpu_support_impl.h" | 20 #include "ash/content/gpu_support_impl.h" |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
391 void ChromeShellDelegate::PreShutdown() { | 393 void ChromeShellDelegate::PreShutdown() { |
392 display_configuration_observer_.reset(); | 394 display_configuration_observer_.reset(); |
393 | 395 |
394 chrome_user_metrics_recorder_.reset(); | 396 chrome_user_metrics_recorder_.reset(); |
395 } | 397 } |
396 | 398 |
397 void ChromeShellDelegate::Exit() { | 399 void ChromeShellDelegate::Exit() { |
398 chrome::AttemptUserExit(); | 400 chrome::AttemptUserExit(); |
399 } | 401 } |
400 | 402 |
401 void ChromeShellDelegate::OpenUrl(const GURL& url) { | 403 void ChromeShellDelegate::OpenUrlFromArc(const GURL& url) { |
402 if (!url.is_valid()) | 404 if (!url.is_valid()) |
403 return; | 405 return; |
404 | 406 |
405 chrome::ScopedTabbedBrowserDisplayer displayer( | 407 chrome::ScopedTabbedBrowserDisplayer displayer( |
406 ProfileManager::GetActiveUserProfile()); | 408 ProfileManager::GetActiveUserProfile()); |
407 chrome::AddSelectedTabWithURL(displayer.browser(), url, | 409 chrome::AddSelectedTabWithURL( |
408 ui::PAGE_TRANSITION_LINK); | 410 displayer.browser(), url, |
| 411 ui::PageTransitionFromInt(ui::PAGE_TRANSITION_LINK | |
| 412 ui::PAGE_TRANSITION_FROM_API)); |
409 | 413 |
410 // Since the ScopedTabbedBrowserDisplayer does not guarantee that the | 414 // Since the ScopedTabbedBrowserDisplayer does not guarantee that the |
411 // browser will be shown on the active desktop, we ensure the visibility. | 415 // browser will be shown on the active desktop, we ensure the visibility. |
412 multi_user_util::MoveWindowToCurrentDesktop( | 416 multi_user_util::MoveWindowToCurrentDesktop( |
413 displayer.browser()->window()->GetNativeWindow()); | 417 displayer.browser()->window()->GetNativeWindow()); |
414 } | 418 } |
415 | 419 |
416 app_list::AppListPresenter* ChromeShellDelegate::GetAppListPresenter() { | 420 app_list::AppListPresenter* ChromeShellDelegate::GetAppListPresenter() { |
417 DCHECK(ash::Shell::HasInstance()); | 421 DCHECK(ash::Shell::HasInstance()); |
418 return AppListServiceAsh::GetInstance()->GetAppListPresenter(); | 422 return AppListServiceAsh::GetInstance()->GetAppListPresenter(); |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 NOTREACHED() << "Unexpected notification " << type; | 562 NOTREACHED() << "Unexpected notification " << type; |
559 } | 563 } |
560 } | 564 } |
561 | 565 |
562 void ChromeShellDelegate::PlatformInit() { | 566 void ChromeShellDelegate::PlatformInit() { |
563 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, | 567 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, |
564 content::NotificationService::AllSources()); | 568 content::NotificationService::AllSources()); |
565 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED, | 569 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED, |
566 content::NotificationService::AllSources()); | 570 content::NotificationService::AllSources()); |
567 } | 571 } |
OLD | NEW |