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> | |
oshima
2016/07/29 19:17:19
thanks:)
| |
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 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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::OpenUrl(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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
542 NOTREACHED() << "Unexpected notification " << type; | 546 NOTREACHED() << "Unexpected notification " << type; |
543 } | 547 } |
544 } | 548 } |
545 | 549 |
546 void ChromeShellDelegate::PlatformInit() { | 550 void ChromeShellDelegate::PlatformInit() { |
547 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, | 551 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, |
548 content::NotificationService::AllSources()); | 552 content::NotificationService::AllSources()); |
549 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED, | 553 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED, |
550 content::NotificationService::AllSources()); | 554 content::NotificationService::AllSources()); |
551 } | 555 } |
OLD | NEW |