Chromium Code Reviews| 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> | 9 #include <limits> |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 #include "ash/shell.h" | 22 #include "ash/shell.h" |
| 23 #include "ash/wm/window_util.h" | 23 #include "ash/wm/window_util.h" |
| 24 #include "base/command_line.h" | 24 #include "base/command_line.h" |
| 25 #include "base/macros.h" | 25 #include "base/macros.h" |
| 26 #include "base/memory/ptr_util.h" | 26 #include "base/memory/ptr_util.h" |
| 27 #include "build/build_config.h" | 27 #include "build/build_config.h" |
| 28 #include "chrome/browser/app_mode/app_mode_utils.h" | 28 #include "chrome/browser/app_mode/app_mode_utils.h" |
| 29 #include "chrome/browser/chrome_notification_types.h" | 29 #include "chrome/browser/chrome_notification_types.h" |
| 30 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 30 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 31 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 31 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
| 32 #include "chrome/browser/chromeos/arc/fileapi/arc_content_file_system_url_util.h " | |
| 32 #include "chrome/browser/chromeos/background/ash_wallpaper_delegate.h" | 33 #include "chrome/browser/chromeos/background/ash_wallpaper_delegate.h" |
| 33 #include "chrome/browser/chromeos/display/display_configuration_observer.h" | 34 #include "chrome/browser/chromeos/display/display_configuration_observer.h" |
| 34 #include "chrome/browser/chromeos/display/display_preferences.h" | 35 #include "chrome/browser/chromeos/display/display_preferences.h" |
| 35 #include "chrome/browser/chromeos/policy/display_rotation_default_handler.h" | 36 #include "chrome/browser/chromeos/policy/display_rotation_default_handler.h" |
| 36 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 37 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 37 #include "chrome/browser/chromeos/system/input_device_settings.h" | 38 #include "chrome/browser/chromeos/system/input_device_settings.h" |
| 38 #include "chrome/browser/chromeos/ui/accessibility_focus_ring_controller.h" | 39 #include "chrome/browser/chromeos/ui/accessibility_focus_ring_controller.h" |
| 39 #include "chrome/browser/lifetime/application_lifetime.h" | 40 #include "chrome/browser/lifetime/application_lifetime.h" |
| 40 #include "chrome/browser/profiles/profile.h" | 41 #include "chrome/browser/profiles/profile.h" |
| 41 #include "chrome/browser/profiles/profile_manager.h" | 42 #include "chrome/browser/profiles/profile_manager.h" |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 399 | 400 |
| 400 void ChromeShellDelegate::PreShutdown() { | 401 void ChromeShellDelegate::PreShutdown() { |
| 401 display_configuration_observer_.reset(); | 402 display_configuration_observer_.reset(); |
| 402 } | 403 } |
| 403 | 404 |
| 404 void ChromeShellDelegate::Exit() { | 405 void ChromeShellDelegate::Exit() { |
| 405 chrome::AttemptUserExit(); | 406 chrome::AttemptUserExit(); |
| 406 } | 407 } |
| 407 | 408 |
| 408 void ChromeShellDelegate::OpenUrlFromArc(const GURL& url) { | 409 void ChromeShellDelegate::OpenUrlFromArc(const GURL& url) { |
| 409 if (!url.is_valid()) | 410 if (!url.is_valid()) |
|
oshima
2016/11/11 01:13:25
Just curious. Is there any reason why we don't sho
hashimoto
2016/11/11 01:26:19
This code was introduced by yusukes@, I have no id
| |
| 410 return; | 411 return; |
| 411 | 412 |
| 413 GURL url_to_open = url; | |
| 414 if (url.SchemeIs(url::kFileScheme) || url.SchemeIs(url::kContentScheme)) { | |
| 415 // Chrome cannot open this URL. Read the contents via ARC content file | |
| 416 // system with an external file URL. | |
| 417 url_to_open = arc::ArcUrlToExternalFileUrl(url_to_open); | |
| 418 } | |
| 419 | |
| 412 chrome::ScopedTabbedBrowserDisplayer displayer( | 420 chrome::ScopedTabbedBrowserDisplayer displayer( |
| 413 ProfileManager::GetActiveUserProfile()); | 421 ProfileManager::GetActiveUserProfile()); |
| 414 chrome::AddSelectedTabWithURL( | 422 chrome::AddSelectedTabWithURL( |
| 415 displayer.browser(), url, | 423 displayer.browser(), url_to_open, |
| 416 ui::PageTransitionFromInt(ui::PAGE_TRANSITION_LINK | | 424 ui::PageTransitionFromInt(ui::PAGE_TRANSITION_LINK | |
| 417 ui::PAGE_TRANSITION_FROM_API)); | 425 ui::PAGE_TRANSITION_FROM_API)); |
| 418 | 426 |
| 419 // Since the ScopedTabbedBrowserDisplayer does not guarantee that the | 427 // Since the ScopedTabbedBrowserDisplayer does not guarantee that the |
| 420 // browser will be shown on the active desktop, we ensure the visibility. | 428 // browser will be shown on the active desktop, we ensure the visibility. |
| 421 multi_user_util::MoveWindowToCurrentDesktop( | 429 multi_user_util::MoveWindowToCurrentDesktop( |
| 422 displayer.browser()->window()->GetNativeWindow()); | 430 displayer.browser()->window()->GetNativeWindow()); |
| 423 } | 431 } |
| 424 | 432 |
| 425 app_list::AppListPresenter* ChromeShellDelegate::GetAppListPresenter() { | 433 app_list::AppListPresenter* ChromeShellDelegate::GetAppListPresenter() { |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 547 NOTREACHED() << "Unexpected notification " << type; | 555 NOTREACHED() << "Unexpected notification " << type; |
| 548 } | 556 } |
| 549 } | 557 } |
| 550 | 558 |
| 551 void ChromeShellDelegate::PlatformInit() { | 559 void ChromeShellDelegate::PlatformInit() { |
| 552 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, | 560 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, |
| 553 content::NotificationService::AllSources()); | 561 content::NotificationService::AllSources()); |
| 554 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED, | 562 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED, |
| 555 content::NotificationService::AllSources()); | 563 content::NotificationService::AllSources()); |
| 556 } | 564 } |
| OLD | NEW |