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

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

Issue 9195018: Disable modal JavaScript dialogs for platform apps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 8 years, 11 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 | Annotate | Revision Log
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/extensions/extension_host.h" 5 #include "chrome/browser/extensions/extension_host.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE || 393 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE ||
394 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_INFOBAR || 394 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_INFOBAR ||
395 extension_host_type_ == chrome::VIEW_TYPE_APP_SHELL) { 395 extension_host_type_ == chrome::VIEW_TYPE_APP_SHELL) {
396 content::NotificationService::current()->Notify( 396 content::NotificationService::current()->Notify(
397 chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE, 397 chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE,
398 content::Source<Profile>(profile_), 398 content::Source<Profile>(profile_),
399 content::Details<ExtensionHost>(this)); 399 content::Details<ExtensionHost>(this));
400 } 400 }
401 } 401 }
402 402
403 bool ExtensionHost::ShouldSuppressDialogs() {
404 return extension_->is_platform_app();
405 }
406
403 WebContents* ExtensionHost::OpenURLFromTab(WebContents* source, 407 WebContents* ExtensionHost::OpenURLFromTab(WebContents* source,
404 const OpenURLParams& params) { 408 const OpenURLParams& params) {
405 // Whitelist the dispositions we will allow to be opened. 409 // Whitelist the dispositions we will allow to be opened.
406 switch (params.disposition) { 410 switch (params.disposition) {
407 case SINGLETON_TAB: 411 case SINGLETON_TAB:
408 case NEW_FOREGROUND_TAB: 412 case NEW_FOREGROUND_TAB:
409 case NEW_BACKGROUND_TAB: 413 case NEW_BACKGROUND_TAB:
410 case NEW_POPUP: 414 case NEW_POPUP:
411 case NEW_WINDOW: 415 case NEW_WINDOW:
412 case SAVE_TO_DISK: 416 case SAVE_TO_DISK:
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
548 browser::Navigate(&params); 552 browser::Navigate(&params);
549 } 553 }
550 554
551 555
552 void ExtensionHost::RenderViewReady() { 556 void ExtensionHost::RenderViewReady() {
553 content::NotificationService::current()->Notify( 557 content::NotificationService::current()->Notify(
554 chrome::NOTIFICATION_EXTENSION_HOST_CREATED, 558 chrome::NOTIFICATION_EXTENSION_HOST_CREATED,
555 content::Source<Profile>(profile_), 559 content::Source<Profile>(profile_),
556 content::Details<ExtensionHost>(this)); 560 content::Details<ExtensionHost>(this));
557 } 561 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698