| 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/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <shellapi.h> | 9 #include <shellapi.h> |
| 10 #endif // OS_WIN | 10 #endif // OS_WIN |
| (...skipping 2687 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2698 } | 2698 } |
| 2699 } | 2699 } |
| 2700 | 2700 |
| 2701 // static | 2701 // static |
| 2702 void Browser::RegisterIntentHandlerHelper(WebContents* tab, | 2702 void Browser::RegisterIntentHandlerHelper(WebContents* tab, |
| 2703 const string16& action, | 2703 const string16& action, |
| 2704 const string16& type, | 2704 const string16& type, |
| 2705 const string16& href, | 2705 const string16& href, |
| 2706 const string16& title, | 2706 const string16& title, |
| 2707 const string16& disposition) { | 2707 const string16& disposition) { |
| 2708 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableWebIntents)) | 2708 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents)) |
| 2709 return; | 2709 return; |
| 2710 | 2710 |
| 2711 TabContentsWrapper* tcw = TabContentsWrapper::GetCurrentWrapperForContents( | 2711 TabContentsWrapper* tcw = TabContentsWrapper::GetCurrentWrapperForContents( |
| 2712 tab); | 2712 tab); |
| 2713 if (!tcw || tcw->profile()->IsOffTheRecord()) | 2713 if (!tcw || tcw->profile()->IsOffTheRecord()) |
| 2714 return; | 2714 return; |
| 2715 | 2715 |
| 2716 FaviconService* favicon_service = | 2716 FaviconService* favicon_service = |
| 2717 tcw->profile()->GetFaviconService(Profile::EXPLICIT_ACCESS); | 2717 tcw->profile()->GetFaviconService(Profile::EXPLICIT_ACCESS); |
| 2718 | 2718 |
| (...skipping 1325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4044 const string16& action, | 4044 const string16& action, |
| 4045 const string16& type, | 4045 const string16& type, |
| 4046 const string16& href, | 4046 const string16& href, |
| 4047 const string16& title, | 4047 const string16& title, |
| 4048 const string16& disposition) { | 4048 const string16& disposition) { |
| 4049 RegisterIntentHandlerHelper(tab, action, type, href, title, disposition); | 4049 RegisterIntentHandlerHelper(tab, action, type, href, title, disposition); |
| 4050 } | 4050 } |
| 4051 | 4051 |
| 4052 void Browser::WebIntentDispatch( | 4052 void Browser::WebIntentDispatch( |
| 4053 WebContents* tab, content::WebIntentsDispatcher* intents_dispatcher) { | 4053 WebContents* tab, content::WebIntentsDispatcher* intents_dispatcher) { |
| 4054 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kDisableWebIntents)) | 4054 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents)) |
| 4055 return; | 4055 return; |
| 4056 | 4056 |
| 4057 TabContentsWrapper* tcw = | 4057 TabContentsWrapper* tcw = |
| 4058 TabContentsWrapper::GetCurrentWrapperForContents(tab); | 4058 TabContentsWrapper::GetCurrentWrapperForContents(tab); |
| 4059 tcw->web_intent_picker_controller()->SetIntentsDispatcher(intents_dispatcher); | 4059 tcw->web_intent_picker_controller()->SetIntentsDispatcher(intents_dispatcher); |
| 4060 tcw->web_intent_picker_controller()->ShowDialog( | 4060 tcw->web_intent_picker_controller()->ShowDialog( |
| 4061 this, | 4061 this, |
| 4062 intents_dispatcher->GetIntent().action, | 4062 intents_dispatcher->GetIntent().action, |
| 4063 intents_dispatcher->GetIntent().type); | 4063 intents_dispatcher->GetIntent().type); |
| 4064 } | 4064 } |
| (...skipping 1435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5500 local_state->SetBoolean(prefs::kShouldShowFirstRunBubble, false); | 5500 local_state->SetBoolean(prefs::kShouldShowFirstRunBubble, false); |
| 5501 window_->GetLocationBar()->ShowFirstRunBubble(); | 5501 window_->GetLocationBar()->ShowFirstRunBubble(); |
| 5502 } else { | 5502 } else { |
| 5503 GlobalErrorService* service = | 5503 GlobalErrorService* service = |
| 5504 GlobalErrorServiceFactory::GetForProfile(profile()); | 5504 GlobalErrorServiceFactory::GetForProfile(profile()); |
| 5505 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); | 5505 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); |
| 5506 if (error) | 5506 if (error) |
| 5507 error->ShowBubbleView(this); | 5507 error->ShowBubbleView(this); |
| 5508 } | 5508 } |
| 5509 } | 5509 } |
| OLD | NEW |