extension_installed_bubble_view.h revision 58537e28ecd584eab876aee8be7156509866d23a
1b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// Copyright 2013 The Chromium Authors. All rights reserved. 2b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// Use of this source code is governed by a BSD-style license that can be 3b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// found in the LICENSE file. 4b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org 5b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org#ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_INSTALLED_BUBBLE_VIEW_H_ 6b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org#define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_INSTALLED_BUBBLE_VIEW_H_ 7b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org 8b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org#include "base/compiler_specific.h" 9b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org#include "chrome/browser/ui/extensions/extension_installed_bubble.h" 10b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org#include "ui/views/bubble/bubble_delegate.h" 11b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org 12b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgclass Browser; 13b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org 1480b62056026ec31a642da519832b37e79b7eac4ephoglund@webrtc.orgnamespace extensions { 15b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgclass Extension; 16b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org} 17b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org 18b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// Provides feedback to the user upon successful installation of an 1980b62056026ec31a642da519832b37e79b7eac4ephoglund@webrtc.org// extension. Depending on the type of extension, the Bubble will 20b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// point to: 21b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// OMNIBOX_KEYWORD-> The omnibox. 22b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org// BROWSER_ACTION -> The browserAction icon in the toolbar. 2380b62056026ec31a642da519832b37e79b7eac4ephoglund@webrtc.org// PAGE_ACTION -> A preview of the pageAction icon in the location 2480b62056026ec31a642da519832b37e79b7eac4ephoglund@webrtc.org// bar which is shown while the Bubble is shown. 2580b62056026ec31a642da519832b37e79b7eac4ephoglund@webrtc.org// GENERIC -> The wrench menu. This case includes pageActions that 2680b62056026ec31a642da519832b37e79b7eac4ephoglund@webrtc.org// don't specify a default icon. 27b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.orgclass ExtensionInstalledBubbleView 2880b62056026ec31a642da519832b37e79b7eac4ephoglund@webrtc.org : public ExtensionInstalledBubble::Delegate, 2980b62056026ec31a642da519832b37e79b7eac4ephoglund@webrtc.org public views::BubbleDelegateView { 3080b62056026ec31a642da519832b37e79b7eac4ephoglund@webrtc.org public: 31b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org // Creates the ExtensionInstalledBubbleView and schedules it to be shown once 3280b62056026ec31a642da519832b37e79b7eac4ephoglund@webrtc.org // the extension has loaded. |extension| is the installed extension. |browser| 33b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org // is the browser window which will host the bubble. |icon| is the install 347affcd2236a1e8e9d5d70f21dc7a5c385f509d37pbos@webrtc.org // icon of the extension. 357affcd2236a1e8e9d5d70f21dc7a5c385f509d37pbos@webrtc.org static void Show(const extensions::Extension* extension, 367affcd2236a1e8e9d5d70f21dc7a5c385f509d37pbos@webrtc.org Browser* browser, 37b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org const SkBitmap& icon); 387affcd2236a1e8e9d5d70f21dc7a5c385f509d37pbos@webrtc.org 397affcd2236a1e8e9d5d70f21dc7a5c385f509d37pbos@webrtc.org private: 40b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org ExtensionInstalledBubbleView(const extensions::Extension* extension, 4180b62056026ec31a642da519832b37e79b7eac4ephoglund@webrtc.org Browser* browser, 4280b62056026ec31a642da519832b37e79b7eac4ephoglund@webrtc.org const SkBitmap& icon); 4380b62056026ec31a642da519832b37e79b7eac4ephoglund@webrtc.org 44b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org virtual ~ExtensionInstalledBubbleView(); 4580b62056026ec31a642da519832b37e79b7eac4ephoglund@webrtc.org 4680b62056026ec31a642da519832b37e79b7eac4ephoglund@webrtc.org // ExtensionInstalledBubble::Delegate: 4780b62056026ec31a642da519832b37e79b7eac4ephoglund@webrtc.org virtual bool MaybeShowNow() OVERRIDE; 48b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org 4980b62056026ec31a642da519832b37e79b7eac4ephoglund@webrtc.org // views::WidgetDelegate: 5080b62056026ec31a642da519832b37e79b7eac4ephoglund@webrtc.org virtual void WindowClosing() OVERRIDE; 5180b62056026ec31a642da519832b37e79b7eac4ephoglund@webrtc.org 52b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org // views::BubbleDelegate: 5380b62056026ec31a642da519832b37e79b7eac4ephoglund@webrtc.org virtual gfx::Rect GetAnchorRect() OVERRIDE; 5480b62056026ec31a642da519832b37e79b7eac4ephoglund@webrtc.org 5580b62056026ec31a642da519832b37e79b7eac4ephoglund@webrtc.org ExtensionInstalledBubble bubble_; 56b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org 5780b62056026ec31a642da519832b37e79b7eac4ephoglund@webrtc.org DISALLOW_COPY_AND_ASSIGN(ExtensionInstalledBubbleView); 5880b62056026ec31a642da519832b37e79b7eac4ephoglund@webrtc.org}; 5980b62056026ec31a642da519832b37e79b7eac4ephoglund@webrtc.org 6080b62056026ec31a642da519832b37e79b7eac4ephoglund@webrtc.org#endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_INSTALLED_BUBBLE_VIEW_H_ 61b015cbede88899f67a53fbbe581b02ce8e32794andrew@webrtc.org