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

Side by Side Diff: chrome/browser/extensions/extension_tab_helper.cc

Issue 8400027: Add code to prompt for browser login during app notification setup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add virtual destructor to interface class Created 9 years, 1 month 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
« no previous file with comments | « chrome/browser/extensions/app_notify_channel_ui.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/extensions/extension_tab_helper.h" 5 #include "chrome/browser/extensions/extension_tab_helper.h"
6 6
7 #include "chrome/browser/extensions/extension_service.h" 7 #include "chrome/browser/extensions/extension_service.h"
8 #include "chrome/browser/extensions/webstore_inline_installer.h" 8 #include "chrome/browser/extensions/webstore_inline_installer.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/sessions/restore_tab_helper.h" 10 #include "chrome/browser/sessions/restore_tab_helper.h"
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 extension->HasAPIPermission( 180 extension->HasAPIPermission(
181 ExtensionAPIPermission::kExperimental) && 181 ExtensionAPIPermission::kExperimental) &&
182 (extension->is_hosted_app() || 182 (extension->is_hosted_app() ||
183 process_manager->GetExtensionProcess(requestor_url) == process); 183 process_manager->GetExtensionProcess(requestor_url) == process);
184 if (!allowed) { 184 if (!allowed) {
185 AppNotifyChannelSetupComplete("", "permission_error", return_route_id, 185 AppNotifyChannelSetupComplete("", "permission_error", return_route_id,
186 callback_id); 186 callback_id);
187 return; 187 return;
188 } 188 }
189 189
190 AppNotifyChannelUI* ui = new AppNotifyChannelUIImpl(
191 GetBrowser(), tab_contents_wrapper(), extension->name());
192
190 scoped_refptr<AppNotifyChannelSetup> channel_setup( 193 scoped_refptr<AppNotifyChannelSetup> channel_setup(
191 new AppNotifyChannelSetup(profile, 194 new AppNotifyChannelSetup(profile,
192 client_id, 195 client_id,
193 requestor_url, 196 requestor_url,
194 return_route_id, 197 return_route_id,
195 callback_id, 198 callback_id,
199 ui,
196 this->AsWeakPtr())); 200 this->AsWeakPtr()));
197 channel_setup->Start(); 201 channel_setup->Start();
198 // We'll get called back in AppNotifyChannelSetupComplete. 202 // We'll get called back in AppNotifyChannelSetupComplete.
199 } 203 }
200 204
201 void ExtensionTabHelper::AppNotifyChannelSetupComplete( 205 void ExtensionTabHelper::AppNotifyChannelSetupComplete(
202 const std::string& client_id, const std::string& error, int return_route_id, 206 const std::string& client_id, const std::string& error, int return_route_id,
203 int callback_id) { 207 int callback_id) {
204 Send(new ExtensionMsg_GetAppNotifyChannelResponse( 208 Send(new ExtensionMsg_GetAppNotifyChannelResponse(
205 return_route_id, client_id, error, callback_id)); 209 return_route_id, client_id, error, callback_id));
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 } 269 }
266 270
267 TabContents* ExtensionTabHelper::GetAssociatedTabContents() const { 271 TabContents* ExtensionTabHelper::GetAssociatedTabContents() const {
268 return tab_contents(); 272 return tab_contents();
269 } 273 }
270 274
271 gfx::NativeView ExtensionTabHelper::GetNativeViewOfHost() { 275 gfx::NativeView ExtensionTabHelper::GetNativeViewOfHost() {
272 RenderWidgetHostView* rwhv = tab_contents()->GetRenderWidgetHostView(); 276 RenderWidgetHostView* rwhv = tab_contents()->GetRenderWidgetHostView();
273 return rwhv ? rwhv->GetNativeView() : NULL; 277 return rwhv ? rwhv->GetNativeView() : NULL;
274 } 278 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/app_notify_channel_ui.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698