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/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 Loading... |
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 Loading... |
552 browser::Navigate(¶ms); | 556 browser::Navigate(¶ms); |
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 } |
OLD | NEW |