| 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 #ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_POPUP_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_POPUP_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_POPUP_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_POPUP_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "chrome/browser/extensions/extension_host.h" | 9 #include "chrome/browser/extensions/extension_host.h" |
| 10 #include "chrome/browser/ui/views/extensions/extension_view_views.h" | 10 #include "chrome/browser/extensions/extension_view_container.h" |
| 11 #include "content/public/browser/notification_observer.h" | 11 #include "content/public/browser/notification_observer.h" |
| 12 #include "googleurl/src/gurl.h" | 12 #include "googleurl/src/gurl.h" |
| 13 #include "ui/views/bubble/bubble_delegate.h" | 13 #include "ui/views/bubble/bubble_delegate.h" |
| 14 #include "ui/views/focus/widget_focus_manager.h" | 14 #include "ui/views/focus/widget_focus_manager.h" |
| 15 | 15 |
| 16 class Browser; | 16 class Browser; |
| 17 | 17 |
| 18 class ExtensionPopup : public views::BubbleDelegateView, | 18 class ExtensionPopup : public views::BubbleDelegateView, |
| 19 public ExtensionViewViews::Container, | 19 public ExtensionViewContainer, |
| 20 public content::NotificationObserver, | 20 public content::NotificationObserver, |
| 21 public views::WidgetFocusChangeListener { | 21 public views::WidgetFocusChangeListener { |
| 22 public: | 22 public: |
| 23 enum ShowAction { | 23 enum ShowAction { |
| 24 SHOW, | 24 SHOW, |
| 25 SHOW_AND_INSPECT | 25 SHOW_AND_INSPECT |
| 26 }; | 26 }; |
| 27 | 27 |
| 28 virtual ~ExtensionPopup(); | 28 virtual ~ExtensionPopup(); |
| 29 | 29 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 44 views::BubbleBorder::ArrowLocation arrow_location, | 44 views::BubbleBorder::ArrowLocation arrow_location, |
| 45 ShowAction show_action); | 45 ShowAction show_action); |
| 46 | 46 |
| 47 extensions::ExtensionHost* host() const { return extension_host_.get(); } | 47 extensions::ExtensionHost* host() const { return extension_host_.get(); } |
| 48 | 48 |
| 49 // content::NotificationObserver overrides. | 49 // content::NotificationObserver overrides. |
| 50 virtual void Observe(int type, | 50 virtual void Observe(int type, |
| 51 const content::NotificationSource& source, | 51 const content::NotificationSource& source, |
| 52 const content::NotificationDetails& details) OVERRIDE; | 52 const content::NotificationDetails& details) OVERRIDE; |
| 53 | 53 |
| 54 // ExtensionViewViews::Container overrides. | 54 // ExtensionViewContainer overrides. |
| 55 virtual void OnExtensionSizeChanged(ExtensionViewViews* view) OVERRIDE; | 55 virtual void OnExtensionSizeChanged(ExtensionView* view, |
| 56 const gfx::Size& new_size) OVERRIDE; |
| 57 virtual void OnExtensionViewDidShow(ExtensionView* view) OVERRIDE; |
| 56 | 58 |
| 57 // views::View overrides. | 59 // views::View overrides. |
| 58 virtual gfx::Size GetPreferredSize() OVERRIDE; | 60 virtual gfx::Size GetPreferredSize() OVERRIDE; |
| 59 | 61 |
| 60 // views::WidgetFocusChangeListener overrides. | 62 // views::WidgetFocusChangeListener overrides. |
| 61 virtual void OnNativeFocusChange(gfx::NativeView focused_before, | 63 virtual void OnNativeFocusChange(gfx::NativeView focused_before, |
| 62 gfx::NativeView focused_now) OVERRIDE; | 64 gfx::NativeView focused_now) OVERRIDE; |
| 63 | 65 |
| 64 // The min/max height of popups. | 66 // The min/max height of popups. |
| 65 static const int kMinWidth; | 67 static const int kMinWidth; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 87 bool inspect_with_devtools_; | 89 bool inspect_with_devtools_; |
| 88 | 90 |
| 89 content::NotificationRegistrar registrar_; | 91 content::NotificationRegistrar registrar_; |
| 90 | 92 |
| 91 base::WeakPtrFactory<ExtensionPopup> close_bubble_factory_; | 93 base::WeakPtrFactory<ExtensionPopup> close_bubble_factory_; |
| 92 | 94 |
| 93 DISALLOW_COPY_AND_ASSIGN(ExtensionPopup); | 95 DISALLOW_COPY_AND_ASSIGN(ExtensionPopup); |
| 94 }; | 96 }; |
| 95 | 97 |
| 96 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_POPUP_H_ | 98 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_POPUP_H_ |
| OLD | NEW |