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

Side by Side Diff: chrome/browser/chrome_notification_types.h

Issue 425303002: Move extension notifications to extensions/browser/notification_types.h (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: (extension-notifications) rebase Created 6 years, 4 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #ifndef CHROME_BROWSER_CHROME_NOTIFICATION_TYPES_H_ 5 #ifndef CHROME_BROWSER_CHROME_NOTIFICATION_TYPES_H_
6 #define CHROME_BROWSER_CHROME_NOTIFICATION_TYPES_H_ 6 #define CHROME_BROWSER_CHROME_NOTIFICATION_TYPES_H_
7 7
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 #include "content/public/browser/notification_types.h" 9 #include "extensions/browser/notification_types.h"
10 10
11 namespace chrome { 11 namespace chrome {
12 12
13 enum NotificationType { 13 enum NotificationType {
14 NOTIFICATION_CHROME_START = content::NOTIFICATION_CONTENT_END, 14 NOTIFICATION_CHROME_START = extensions::NOTIFICATION_EXTENSIONS_END,
15 15
16 // Browser-window ---------------------------------------------------------- 16 // Browser-window ----------------------------------------------------------
17 17
18 // This message is sent after a window has been opened. The source is a 18 // This message is sent after a window has been opened. The source is a
19 // Source<Browser> containing the affected Browser. No details are 19 // Source<Browser> containing the affected Browser. No details are
20 // expected. 20 // expected.
21 NOTIFICATION_BROWSER_OPENED = NOTIFICATION_CHROME_START, 21 NOTIFICATION_BROWSER_OPENED = NOTIFICATION_CHROME_START,
22 22
23 // This message is sent soon after BROWSER_OPENED, and indicates that 23 // This message is sent soon after BROWSER_OPENED, and indicates that
24 // the Browser's |window_| is now non-NULL. The source is a Source<Browser> 24 // the Browser's |window_| is now non-NULL. The source is a Source<Browser>
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 // Source is the WebContents that holds the print job. 356 // Source is the WebContents that holds the print job.
357 NOTIFICATION_PRINT_JOB_RELEASED, 357 NOTIFICATION_PRINT_JOB_RELEASED,
358 358
359 // Shutdown ---------------------------------------------------------------- 359 // Shutdown ----------------------------------------------------------------
360 360
361 // Sent when WM_ENDSESSION has been received, after the browsers have been 361 // Sent when WM_ENDSESSION has been received, after the browsers have been
362 // closed but before browser process has been shutdown. The source/details 362 // closed but before browser process has been shutdown. The source/details
363 // are all source and no details. 363 // are all source and no details.
364 NOTIFICATION_SESSION_END, 364 NOTIFICATION_SESSION_END,
365 365
366 // User Scripts ------------------------------------------------------------
367
368 // Sent when there are new user scripts available. The details are a
369 // pointer to SharedMemory containing the new scripts.
370 NOTIFICATION_USER_SCRIPTS_UPDATED,
371
372 // Extensions --------------------------------------------------------------
373
374 // Sent when a CrxInstaller finishes. Source is the CrxInstaller that
375 // finished. The details are the extension which was installed.
376 NOTIFICATION_CRX_INSTALLER_DONE,
377
378 // Sent when the known installed extensions have all been loaded. In
379 // testing scenarios this can happen multiple times if extensions are
380 // unloaded and reloaded. The source is a Profile.
381 NOTIFICATION_EXTENSIONS_READY,
382
383 // DEPRECATED: Use ExtensionRegistry::AddObserver instead.
384 //
385 // Sent when a new extension is loaded. The details are an Extension, and
386 // the source is a Profile.
387 NOTIFICATION_EXTENSION_LOADED_DEPRECATED,
388
389 // An error occured while attempting to load an extension. The details are a
390 // string with details about why the load failed.
391 NOTIFICATION_EXTENSION_LOAD_ERROR,
392
393 // Sent when an extension is enabled. Under most circumstances, listeners
394 // will want to use NOTIFICATION_EXTENSION_LOADED_DEPRECATED. This
395 // notification is only
396 // fired when the "Enable" button is hit in the extensions tab. The details
397 // are an Extension, and the source is a Profile.
398 NOTIFICATION_EXTENSION_ENABLED,
399
400 // Sent when attempting to load a new extension, but they are disabled. The
401 // details are an Extension*, and the source is a Profile*.
402 NOTIFICATION_EXTENSION_UPDATE_DISABLED,
403
404 // Sent when an extension's permissions change. The details are an
405 // UpdatedExtensionPermissionsInfo, and the source is a Profile.
406 NOTIFICATION_EXTENSION_PERMISSIONS_UPDATED,
407
408 // DEPRECATED: Use ExtensionRegistry::AddObserver instead.
409 //
410 // Sent immediately before new extensions are installed or existing
411 // extensions are updated. The details are an InstalledExtensionInfo, and the
412 // source is a Profile.
413 NOTIFICATION_EXTENSION_WILL_BE_INSTALLED_DEPRECATED,
414
415 // An error occured during extension install. The details are a string with
416 // details about why the install failed.
417 NOTIFICATION_EXTENSION_INSTALL_ERROR,
418
419 // DEPRECATED: Use ExtensionRegistry::AddObserver instead.
420 //
421 // Sent when an extension has been uninstalled. The details are an Extension,
422 // and the source is a Profile.
423 NOTIFICATION_EXTENSION_UNINSTALLED_DEPRECATED,
424
425 // Sent when an extension uninstall is not allowed because the extension is
426 // not user manageable. The details are an Extension, and the source is a
427 // Profile.
428 NOTIFICATION_EXTENSION_UNINSTALL_NOT_ALLOWED,
429
430 // DEPRECATED: Use ExtensionRegistry::AddObserver instead.
431 //
432 // Sent when an extension is unloaded. This happens when an extension is
433 // uninstalled or disabled. The details are an UnloadedExtensionInfo, and
434 // the source is a Profile.
435 //
436 // Note that when this notification is sent, ExtensionService has already
437 // removed the extension from its internal state.
438 NOTIFICATION_EXTENSION_UNLOADED_DEPRECATED,
439
440 // Sent when an Extension object is removed from ExtensionService. This
441 // can happen when an extension is uninstalled, upgraded, or blacklisted,
442 // including all cases when the Extension is deleted. The details are an
443 // Extension, and the source is a Profile.
444 NOTIFICATION_EXTENSION_REMOVED,
445
446 // Sent after a new ExtensionHost is created. The details are
447 // an ExtensionHost* and the source is a Profile*.
448 NOTIFICATION_EXTENSION_HOST_CREATED,
449
450 // Sent before an ExtensionHost is destroyed. The details are
451 // an ExtensionHost* and the source is a Profile*.
452 NOTIFICATION_EXTENSION_HOST_DESTROYED,
453
454 // Sent by an ExtensionHost when it has finished its initial page load,
455 // including any external resources.
456 // The details are an ExtensionHost* and the source is a Profile*.
457 NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING,
458
459 // Sent by an ExtensionHost when its render view requests closing through
460 // window.close(). The details are an ExtensionHost* and the source is a
461 // Profile*.
462 NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE,
463
464 // Sent when extension render process ends (whether it crashes or closes).
465 // The details are an ExtensionHost* and the source is a Profile*. Not sent
466 // during browser shutdown.
467 NOTIFICATION_EXTENSION_PROCESS_TERMINATED,
468
469 // Sent when a background page is ready so other components can load.
470 NOTIFICATION_EXTENSION_BACKGROUND_PAGE_READY,
471
472 // Sent when a browser action's state has changed. The source is the
473 // ExtensionAction* that changed. The details are the Profile* that the
474 // browser action belongs to.
475 NOTIFICATION_EXTENSION_BROWSER_ACTION_UPDATED,
476
477 // Sent when the count of page actions has changed. Note that some of them
478 // may not apply to the current page. The source is a LocationBar*. There
479 // are no details.
480 NOTIFICATION_EXTENSION_PAGE_ACTION_COUNT_CHANGED,
481
482 // Sent when a browser action's visibility has changed. The source is the
483 // ExtensionPrefs* that changed, and the details are a std::string with the
484 // extension's ID.
485 NOTIFICATION_EXTENSION_BROWSER_ACTION_VISIBILITY_CHANGED,
486
487 // Sent when a page action's visibility has changed. The source is the
488 // ExtensionAction* that changed. The details are a WebContents*.
489 NOTIFICATION_EXTENSION_PAGE_ACTION_VISIBILITY_CHANGED,
490
491 // Sent when a system indicator action's state has changed. The source is the
492 // Profile* that the browser action belongs to. The details are the
493 // ExtensionAction* that changed.
494 NOTIFICATION_EXTENSION_SYSTEM_INDICATOR_UPDATED,
495
496 // Sent when an extension command has been removed. The source is the profile
497 // and the details is a std::pair of two std::string objects (an extension ID
498 // and the name of the command being removed).
499 NOTIFICATION_EXTENSION_COMMAND_REMOVED,
500
501 // Sent when an extension command has been added. The source is the profile
502 // and the details is a std::pair of two std::string objects (an extension ID
503 // and the name of the command being added).
504 NOTIFICATION_EXTENSION_COMMAND_ADDED,
505
506 // Sent when an extension command shortcut for a browser action is activated
507 // on Mac. The source is the profile and the details is a std::pair of a
508 // std::string containing an extension ID and a gfx::NativeWindow for the
509 // associated window.
510 NOTIFICATION_EXTENSION_COMMAND_BROWSER_ACTION_MAC,
511
512 // Sent when an extension command shortcut for a page action is activated
513 // on Mac. The source is the profile and the details is a std::pair of a
514 // std::string containing an extension ID and a gfx::NativeWindow for the
515 // associated window.
516 NOTIFICATION_EXTENSION_COMMAND_PAGE_ACTION_MAC,
517
518 // A new extension RenderViewHost has been registered. The details are
519 // the RenderViewHost*.
520 NOTIFICATION_EXTENSION_VIEW_REGISTERED,
521
522 // An extension RenderViewHost has been unregistered. The details are
523 // the RenderViewHost*.
524 NOTIFICATION_EXTENSION_VIEW_UNREGISTERED,
525
526 // Sent by an extension to notify the browser about the results of a unit
527 // test.
528 NOTIFICATION_EXTENSION_TEST_PASSED,
529 NOTIFICATION_EXTENSION_TEST_FAILED,
530
531 // Sent by extension test javascript code, typically in a browser test. The
532 // sender is a std::string representing the extension id, and the details
533 // are a std::string with some message. This is particularly useful when you
534 // want to have C++ code wait for javascript code to do something.
535 NOTIFICATION_EXTENSION_TEST_MESSAGE,
536
537 // Sent when an bookmarks extensions API function was successfully invoked.
538 // The source is the id of the extension that invoked the function, and the
539 // details are a pointer to the const BookmarksFunction in question.
540 NOTIFICATION_EXTENSION_BOOKMARKS_API_INVOKED,
541
542 // Sent when a downloads extensions API event is fired. The source is an
543 // ExtensionDownloadsEventRouter::NotificationSource, and the details is a
544 // std::string containing json. Used for testing.
545 NOTIFICATION_EXTENSION_DOWNLOADS_EVENT,
546
547 // Sent when an omnibox extension has sent back omnibox suggestions. The
548 // source is the profile, and the details are an
549 // extensions::api::omnibox::SendSuggestions::Params object.
550 NOTIFICATION_EXTENSION_OMNIBOX_SUGGESTIONS_READY,
551
552 // Sent when the user accepts the input in an extension omnibox keyword
553 // session. The source is the profile.
554 NOTIFICATION_EXTENSION_OMNIBOX_INPUT_ENTERED,
555
556 // Sent when an omnibox extension has updated the default suggestion. The
557 // source is the profile.
558 NOTIFICATION_EXTENSION_OMNIBOX_DEFAULT_SUGGESTION_CHANGED,
559
560 // Sent when the extension updater starts checking for updates to installed
561 // extensions. The source is a Profile, and there are no details.
562 NOTIFICATION_EXTENSION_UPDATING_STARTED,
563
564 // The extension updater found an update and will attempt to download and
565 // install it. The source is a Profile, and the details are an
566 // extensions::UpdateDetails object with the extension id and version of the
567 // found update.
568 NOTIFICATION_EXTENSION_UPDATE_FOUND,
569
570 // Upgrade notifications --------------------------------------------------- 366 // Upgrade notifications ---------------------------------------------------
571 367
572 // Sent when Chrome believes an update has been installed and available for 368 // Sent when Chrome believes an update has been installed and available for
573 // long enough with the user shutting down to let it take effect. See 369 // long enough with the user shutting down to let it take effect. See
574 // upgrade_detector.cc for details on how long it waits. No details are 370 // upgrade_detector.cc for details on how long it waits. No details are
575 // expected. 371 // expected.
576 NOTIFICATION_UPGRADE_RECOMMENDED, 372 NOTIFICATION_UPGRADE_RECOMMENDED,
577 373
578 // Sent when a critical update has been installed. No details are expected. 374 // Sent when a critical update has been installed. No details are expected.
579 NOTIFICATION_CRITICAL_UPGRADE_INSTALLED, 375 NOTIFICATION_CRITICAL_UPGRADE_INSTALLED,
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
792 NOTIFICATION_INSTANT_NTP_SUPPORT_DETERMINED, 588 NOTIFICATION_INSTANT_NTP_SUPPORT_DETERMINED,
793 589
794 // Sent when the CaptivePortalService checks if we're behind a captive portal. 590 // Sent when the CaptivePortalService checks if we're behind a captive portal.
795 // The Source is the Profile the CaptivePortalService belongs to, and the 591 // The Source is the Profile the CaptivePortalService belongs to, and the
796 // Details are a Details<CaptivePortalService::CheckResults>. 592 // Details are a Details<CaptivePortalService::CheckResults>.
797 NOTIFICATION_CAPTIVE_PORTAL_CHECK_RESULT, 593 NOTIFICATION_CAPTIVE_PORTAL_CHECK_RESULT,
798 594
799 // Sent when the applications in the NTP app launcher have been reordered. 595 // Sent when the applications in the NTP app launcher have been reordered.
800 // The details, if not NoDetails, is the std::string ID of the extension that 596 // The details, if not NoDetails, is the std::string ID of the extension that
801 // was moved. 597 // was moved.
802 NOTIFICATION_EXTENSION_LAUNCHER_REORDERED, 598 NOTIFICATION_APP_LAUNCHER_REORDERED,
803 599
804 // Sent when an app is installed and an NTP has been shown. Source is the 600 // Sent when an app is installed and an NTP has been shown. Source is the
805 // WebContents that was shown, and Details is the string ID of the extension 601 // WebContents that was shown, and Details is the string ID of the extension
806 // which was installed. 602 // which was installed.
807 NOTIFICATION_APP_INSTALLED_TO_NTP, 603 NOTIFICATION_APP_INSTALLED_TO_NTP,
808 604
809 // Similar to NOTIFICATION_APP_INSTALLED_TO_NTP but used to nofity ash AppList 605 // Similar to NOTIFICATION_APP_INSTALLED_TO_NTP but used to notify ash AppList
810 // about installed app. Source is the profile in which the app is installed 606 // about installed app. Source is the profile in which the app is installed
811 // and Details is the string ID of the extension. 607 // and Details is the string ID of the extension.
812 NOTIFICATION_APP_INSTALLED_TO_APPLIST, 608 NOTIFICATION_APP_INSTALLED_TO_APPLIST,
813 609
814 #if defined(USE_ASH) 610 #if defined(USE_ASH)
815 // Sent when wallpaper show animation has finished. 611 // Sent when wallpaper show animation has finished.
816 NOTIFICATION_WALLPAPER_ANIMATION_FINISHED, 612 NOTIFICATION_WALLPAPER_ANIMATION_FINISHED,
817 613
818 // Sent when the Ash session has started. In its current incantation this is 614 // Sent when the Ash session has started. In its current incantation this is
819 // generated when the metro app has connected to the browser IPC channel. 615 // generated when the metro app has connected to the browser IPC channel.
820 // Used only on Windows. 616 // Used only on Windows.
821 NOTIFICATION_ASH_SESSION_STARTED, 617 NOTIFICATION_ASH_SESSION_STARTED,
618
822 // Sent when the Ash session ended. Currently this means the metro app exited. 619 // Sent when the Ash session ended. Currently this means the metro app exited.
823 // Used only on Windows. 620 // Used only on Windows.
824 NOTIFICATION_ASH_SESSION_ENDED, 621 NOTIFICATION_ASH_SESSION_ENDED,
825 #endif 622 #endif
826 623
827 // Protocol Handler Registry ----------------------------------------------- 624 // Protocol Handler Registry -----------------------------------------------
828 // Sent when a ProtocolHandlerRegistry is changed. The source is the profile. 625 // Sent when a ProtocolHandlerRegistry is changed. The source is the profile.
829 NOTIFICATION_PROTOCOL_HANDLER_REGISTRY_CHANGED, 626 NOTIFICATION_PROTOCOL_HANDLER_REGISTRY_CHANGED,
830 627
831 // Sent when the cached profile info has changed. 628 // Sent when the cached profile info has changed.
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 // Note:- 705 // Note:-
909 // Currently only Content and Chrome define and use notifications. 706 // Currently only Content and Chrome define and use notifications.
910 // Custom notifications not belonging to Content and Chrome should start 707 // Custom notifications not belonging to Content and Chrome should start
911 // from here. 708 // from here.
912 NOTIFICATION_CHROME_END, 709 NOTIFICATION_CHROME_END,
913 }; 710 };
914 711
915 } // namespace chrome 712 } // namespace chrome
916 713
917 #endif // CHROME_BROWSER_CHROME_NOTIFICATION_TYPES_H_ 714 #endif // CHROME_BROWSER_CHROME_NOTIFICATION_TYPES_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698