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

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: fix spelling 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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after
397 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE || 397 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_BACKGROUND_PAGE ||
398 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_INFOBAR || 398 extension_host_type_ == chrome::VIEW_TYPE_EXTENSION_INFOBAR ||
399 extension_host_type_ == chrome::VIEW_TYPE_APP_SHELL) { 399 extension_host_type_ == chrome::VIEW_TYPE_APP_SHELL) {
400 content::NotificationService::current()->Notify( 400 content::NotificationService::current()->Notify(
401 chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE, 401 chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE,
402 content::Source<Profile>(profile_), 402 content::Source<Profile>(profile_),
403 content::Details<ExtensionHost>(this)); 403 content::Details<ExtensionHost>(this));
404 } 404 }
405 } 405 }
406 406
407 bool ExtensionHost::ShouldSuppressDialogs() {
408 return extension_->is_platform_app();
409 }
410
407 WebContents* ExtensionHost::OpenURLFromTab(WebContents* source, 411 WebContents* ExtensionHost::OpenURLFromTab(WebContents* source,
408 const OpenURLParams& params) { 412 const OpenURLParams& params) {
409 // Whitelist the dispositions we will allow to be opened. 413 // Whitelist the dispositions we will allow to be opened.
410 switch (params.disposition) { 414 switch (params.disposition) {
411 case SINGLETON_TAB: 415 case SINGLETON_TAB:
412 case NEW_FOREGROUND_TAB: 416 case NEW_FOREGROUND_TAB:
413 case NEW_BACKGROUND_TAB: 417 case NEW_BACKGROUND_TAB:
414 case NEW_POPUP: 418 case NEW_POPUP:
415 case NEW_WINDOW: 419 case NEW_WINDOW:
416 case SAVE_TO_DISK: 420 case SAVE_TO_DISK:
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 browser::Navigate(&params); 556 browser::Navigate(&params);
553 } 557 }
554 558
555 559
556 void ExtensionHost::RenderViewReady() { 560 void ExtensionHost::RenderViewReady() {
557 content::NotificationService::current()->Notify( 561 content::NotificationService::current()->Notify(
558 chrome::NOTIFICATION_EXTENSION_HOST_CREATED, 562 chrome::NOTIFICATION_EXTENSION_HOST_CREATED,
559 content::Source<Profile>(profile_), 563 content::Source<Profile>(profile_),
560 content::Details<ExtensionHost>(this)); 564 content::Details<ExtensionHost>(this));
561 } 565 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698