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

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

Issue 8666013: Add a public content/ interface for intents. Use it. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review comments and comment fixes Created 9 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 #include "content/browser/plugin_service.h" 145 #include "content/browser/plugin_service.h"
146 #include "content/browser/renderer_host/render_view_host.h" 146 #include "content/browser/renderer_host/render_view_host.h"
147 #include "content/browser/site_instance.h" 147 #include "content/browser/site_instance.h"
148 #include "content/browser/tab_contents/interstitial_page.h" 148 #include "content/browser/tab_contents/interstitial_page.h"
149 #include "content/browser/tab_contents/navigation_controller.h" 149 #include "content/browser/tab_contents/navigation_controller.h"
150 #include "content/browser/tab_contents/navigation_entry.h" 150 #include "content/browser/tab_contents/navigation_entry.h"
151 #include "content/browser/tab_contents/tab_contents_view.h" 151 #include "content/browser/tab_contents/tab_contents_view.h"
152 #include "content/browser/user_metrics.h" 152 #include "content/browser/user_metrics.h"
153 #include "content/public/browser/notification_service.h" 153 #include "content/public/browser/notification_service.h"
154 #include "content/public/browser/notification_details.h" 154 #include "content/public/browser/notification_details.h"
155 #include "content/public/browser/intents_host.h"
155 #include "content/public/common/content_restriction.h" 156 #include "content/public/common/content_restriction.h"
156 #include "content/public/common/content_switches.h" 157 #include "content/public/common/content_switches.h"
157 #include "content/public/common/page_zoom.h" 158 #include "content/public/common/page_zoom.h"
158 #include "grit/chromium_strings.h" 159 #include "grit/chromium_strings.h"
159 #include "grit/generated_resources.h" 160 #include "grit/generated_resources.h"
160 #include "grit/locale_settings.h" 161 #include "grit/locale_settings.h"
161 #include "grit/theme_resources_standard.h" 162 #include "grit/theme_resources_standard.h"
162 #include "net/base/cookie_monster.h" 163 #include "net/base/cookie_monster.h"
163 #include "net/base/net_util.h" 164 #include "net/base/net_util.h"
164 #include "net/base/registry_controlled_domain.h" 165 #include "net/base/registry_controlled_domain.h"
(...skipping 3704 matching lines...) Expand 10 before | Expand all | Expand 10 after
3869 void Browser::RegisterIntentHandler(TabContents* tab, 3870 void Browser::RegisterIntentHandler(TabContents* tab,
3870 const string16& action, 3871 const string16& action,
3871 const string16& type, 3872 const string16& type,
3872 const string16& href, 3873 const string16& href,
3873 const string16& title, 3874 const string16& title,
3874 const string16& disposition) { 3875 const string16& disposition) {
3875 RegisterIntentHandlerHelper(tab, action, type, href, title, disposition); 3876 RegisterIntentHandlerHelper(tab, action, type, href, title, disposition);
3876 } 3877 }
3877 3878
3878 void Browser::WebIntentDispatch(TabContents* tab, 3879 void Browser::WebIntentDispatch(TabContents* tab,
3879 int routing_id, 3880 content::IntentsHost* intents_host) {
3880 const webkit_glue::WebIntentData& intent,
3881 int intent_id) {
3882 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents)) 3881 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableWebIntents))
3883 return; 3882 return;
3884 3883
3885 TabContentsWrapper* tcw = 3884 TabContentsWrapper* tcw =
3886 TabContentsWrapper::GetCurrentWrapperForContents(tab); 3885 TabContentsWrapper::GetCurrentWrapperForContents(tab);
3887 tcw->web_intent_picker_controller()->SetIntent(routing_id, 3886 tcw->web_intent_picker_controller()->SetIntentsHost(intents_host);
3888 intent, 3887 tcw->web_intent_picker_controller()->ShowDialog(
3889 intent_id); 3888 this, intents_host->GetIntent().action, intents_host->GetIntent().type);
3890 tcw->web_intent_picker_controller()->ShowDialog(this,
3891 intent.action, intent.type);
3892 } 3889 }
3893 3890
3894 void Browser::FindReply(TabContents* tab, 3891 void Browser::FindReply(TabContents* tab,
3895 int request_id, 3892 int request_id,
3896 int number_of_matches, 3893 int number_of_matches,
3897 const gfx::Rect& selection_rect, 3894 const gfx::Rect& selection_rect,
3898 int active_match_ordinal, 3895 int active_match_ordinal,
3899 bool final_update) { 3896 bool final_update) {
3900 FindReplyHelper(tab, request_id, number_of_matches, selection_rect, 3897 FindReplyHelper(tab, request_id, number_of_matches, selection_rect,
3901 active_match_ordinal, final_update); 3898 active_match_ordinal, final_update);
(...skipping 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after
5313 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type); 5310 window_->GetLocationBar()->ShowFirstRunBubble(bubble_type);
5314 } else { 5311 } else {
5315 GlobalErrorService* service = 5312 GlobalErrorService* service =
5316 GlobalErrorServiceFactory::GetForProfile(profile()); 5313 GlobalErrorServiceFactory::GetForProfile(profile());
5317 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); 5314 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView();
5318 if (error) { 5315 if (error) {
5319 error->ShowBubbleView(this); 5316 error->ShowBubbleView(this);
5320 } 5317 }
5321 } 5318 }
5322 } 5319 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698