Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Side by Side Diff: chrome/browser/chrome_content_browser_client.cc

Issue 2194523002: [arc-intents] Handle redirects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Apply review feedback. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/chrome_content_browser_client.h" 5 #include "chrome/browser/chrome_content_browser_client.h"
6 6
7 #include <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 #include "chrome/browser/chromeos/file_system_provider/fileapi/backend_delegate. h" 195 #include "chrome/browser/chromeos/file_system_provider/fileapi/backend_delegate. h"
196 #include "chrome/browser/chromeos/fileapi/file_system_backend.h" 196 #include "chrome/browser/chromeos/fileapi/file_system_backend.h"
197 #include "chrome/browser/chromeos/fileapi/mtp_file_system_backend_delegate.h" 197 #include "chrome/browser/chromeos/fileapi/mtp_file_system_backend_delegate.h"
198 #include "chrome/browser/chromeos/login/signin/merge_session_navigation_throttle .h" 198 #include "chrome/browser/chromeos/login/signin/merge_session_navigation_throttle .h"
199 #include "chrome/browser/chromeos/login/signin/merge_session_throttling_utils.h" 199 #include "chrome/browser/chromeos/login/signin/merge_session_throttling_utils.h"
200 #include "chrome/browser/chromeos/login/startup_utils.h" 200 #include "chrome/browser/chromeos/login/startup_utils.h"
201 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" 201 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h"
202 #include "chrome/browser/chromeos/system/input_device_settings.h" 202 #include "chrome/browser/chromeos/system/input_device_settings.h"
203 #include "chrome/browser/ui/browser_dialogs.h" 203 #include "chrome/browser/ui/browser_dialogs.h"
204 #include "chromeos/chromeos_switches.h" 204 #include "chromeos/chromeos_switches.h"
205 #include "components/arc/arc_service_manager.h"
206 #include "components/arc/intent_helper/local_activity_resolver.h"
207 #include "components/user_manager/user_manager.h" 205 #include "components/user_manager/user_manager.h"
208 #if defined(MOJO_SHELL_CLIENT) 206 #if defined(MOJO_SHELL_CLIENT)
209 #include "chrome/browser/chromeos/chrome_interface_factory.h" 207 #include "chrome/browser/chromeos/chrome_interface_factory.h"
210 #include "chrome/browser/ui/ash/ash_util.h" 208 #include "chrome/browser/ui/ash/ash_util.h"
211 #endif // MOJO_SHELL_CLIENT 209 #endif // MOJO_SHELL_CLIENT
212 #elif defined(OS_LINUX) 210 #elif defined(OS_LINUX)
213 #include "chrome/browser/chrome_browser_main_linux.h" 211 #include "chrome/browser/chrome_browser_main_linux.h"
214 #elif defined(OS_ANDROID) 212 #elif defined(OS_ANDROID)
215 #include "chrome/browser/chrome_browser_main_android.h" 213 #include "chrome/browser/chrome_browser_main_android.h"
216 #include "chrome/common/descriptors_android.h" 214 #include "chrome/common/descriptors_android.h"
(...skipping 2714 matching lines...) Expand 10 before | Expand all | Expand 10 after
2931 if (merge_session_throttling_utils::ShouldAttachNavigationThrottle() && 2929 if (merge_session_throttling_utils::ShouldAttachNavigationThrottle() &&
2932 !merge_session_throttling_utils::AreAllSessionMergedAlready() && 2930 !merge_session_throttling_utils::AreAllSessionMergedAlready() &&
2933 handle->GetURL().SchemeIsHTTPOrHTTPS()) { 2931 handle->GetURL().SchemeIsHTTPOrHTTPS()) {
2934 throttles.push_back(MergeSessionNavigationThrottle::Create(handle)); 2932 throttles.push_back(MergeSessionNavigationThrottle::Create(handle));
2935 } 2933 }
2936 2934
2937 // TODO(djacobo): Support incognito mode by showing an aditional dialog as a 2935 // TODO(djacobo): Support incognito mode by showing an aditional dialog as a
2938 // warning that the selected app is not in incognito mode. 2936 // warning that the selected app is not in incognito mode.
2939 if (IsIntentPickerEnabled() && 2937 if (IsIntentPickerEnabled() &&
2940 !handle->GetWebContents()->GetBrowserContext()->IsOffTheRecord()) { 2938 !handle->GetWebContents()->GetBrowserContext()->IsOffTheRecord()) {
2941 arc::ArcServiceManager* arc_service_manager = 2939 prerender::PrerenderContents* prerender_contents =
2942 arc::ArcServiceManager::Get(); 2940 prerender::PrerenderContents::FromWebContents(
2943 DCHECK(arc_service_manager); 2941 handle->GetWebContents());
2944 scoped_refptr<arc::LocalActivityResolver> local_resolver = 2942 if (!prerender_contents) {
2945 arc_service_manager->activity_resolver(); 2943 auto intent_picker_cb = base::Bind(ShowIntentPickerBubble());
2946 if (!local_resolver->ShouldChromeHandleUrl(handle->GetURL())) { 2944 auto url_to_arc_throttle = base::MakeUnique<arc::ArcNavigationThrottle>(
2947 prerender::PrerenderContents* prerender_contents = 2945 handle, intent_picker_cb);
2948 prerender::PrerenderContents::FromWebContents( 2946 throttles.push_back(std::move(url_to_arc_throttle));
2949 handle->GetWebContents());
2950 if (!prerender_contents) {
2951 auto intent_picker_cb = base::Bind(ShowIntentPickerBubble());
2952 auto url_to_arc_throttle =
2953 base::MakeUnique<arc::ArcNavigationThrottle>(handle,
2954 intent_picker_cb);
2955 throttles.push_back(std::move(url_to_arc_throttle));
2956 }
2957 } 2947 }
2958 } 2948 }
2959 } 2949 }
2960 #endif 2950 #endif
2961 2951
2962 #if defined(ENABLE_EXTENSIONS) 2952 #if defined(ENABLE_EXTENSIONS)
2963 if (!handle->IsInMainFrame()) 2953 if (!handle->IsInMainFrame())
2964 throttles.push_back(new extensions::ExtensionNavigationThrottle(handle)); 2954 throttles.push_back(new extensions::ExtensionNavigationThrottle(handle));
2965 #endif 2955 #endif
2966 2956
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
3048 if (channel <= kMaxDisableEncryptionChannel) { 3038 if (channel <= kMaxDisableEncryptionChannel) {
3049 static const char* const kWebRtcDevSwitchNames[] = { 3039 static const char* const kWebRtcDevSwitchNames[] = {
3050 switches::kDisableWebRtcEncryption, 3040 switches::kDisableWebRtcEncryption,
3051 }; 3041 };
3052 to_command_line->CopySwitchesFrom(from_command_line, 3042 to_command_line->CopySwitchesFrom(from_command_line,
3053 kWebRtcDevSwitchNames, 3043 kWebRtcDevSwitchNames,
3054 arraysize(kWebRtcDevSwitchNames)); 3044 arraysize(kWebRtcDevSwitchNames));
3055 } 3045 }
3056 } 3046 }
3057 #endif // defined(ENABLE_WEBRTC) 3047 #endif // defined(ENABLE_WEBRTC)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698