OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_EXTENSIONS_EXTENSION_INSTALLED_BUBBLE_H_ | 5 #ifndef CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_INSTALLED_BUBBLE_H_ |
6 #define CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_INSTALLED_BUBBLE_H_ | 6 #define CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_INSTALLED_BUBBLE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 const extensions::Extension* extension() const { return extension_; } | 72 const extensions::Extension* extension() const { return extension_; } |
73 Browser* browser() { return browser_; } | 73 Browser* browser() { return browser_; } |
74 const Browser* browser() const { return browser_; } | 74 const Browser* browser() const { return browser_; } |
75 const SkBitmap& icon() const { return icon_; } | 75 const SkBitmap& icon() const { return icon_; } |
76 BubbleType type() const { return type_; } | 76 BubbleType type() const { return type_; } |
77 bool has_command_keybinding() const { return !!action_command_; } | 77 bool has_command_keybinding() const { return !!action_command_; } |
78 int options() const { return options_; } | 78 int options() const { return options_; } |
79 AnchorPosition anchor_position() const { return anchor_position_; } | 79 AnchorPosition anchor_position() const { return anchor_position_; } |
80 | 80 |
81 // BubbleDelegate: | 81 // BubbleDelegate: |
82 scoped_ptr<BubbleUi> BuildBubbleUi() override; | 82 std::unique_ptr<BubbleUi> BuildBubbleUi() override; |
83 bool ShouldClose(BubbleCloseReason reason) const override; | 83 bool ShouldClose(BubbleCloseReason reason) const override; |
84 std::string GetName() const override; | 84 std::string GetName() const override; |
85 const content::RenderFrameHost* OwningFrame() const override; | 85 const content::RenderFrameHost* OwningFrame() const override; |
86 | 86 |
87 // Returns false if the bubble could not be shown immediately, because of an | 87 // Returns false if the bubble could not be shown immediately, because of an |
88 // animation (eg. adding a new browser action to the toolbar). | 88 // animation (eg. adding a new browser action to the toolbar). |
89 // TODO(hcarmona): Detect animation in a platform-agnostic manner. | 89 // TODO(hcarmona): Detect animation in a platform-agnostic manner. |
90 bool ShouldShow(); | 90 bool ShouldShow(); |
91 | 91 |
92 // Returns the string describing how to use the new extension. | 92 // Returns the string describing how to use the new extension. |
93 base::string16 GetHowToUseDescription() const; | 93 base::string16 GetHowToUseDescription() const; |
94 | 94 |
95 // Handle initialization with the extension. | 95 // Handle initialization with the extension. |
96 void Initialize(); | 96 void Initialize(); |
97 | 97 |
98 private: | 98 private: |
99 // |extension_| is NULL when we are deleted. | 99 // |extension_| is NULL when we are deleted. |
100 const extensions::Extension* extension_; | 100 const extensions::Extension* extension_; |
101 Browser* browser_; | 101 Browser* browser_; |
102 const SkBitmap icon_; | 102 const SkBitmap icon_; |
103 BubbleType type_; | 103 BubbleType type_; |
104 | 104 |
105 // A bitmask containing the various options of bubble sections to show. | 105 // A bitmask containing the various options of bubble sections to show. |
106 int options_; | 106 int options_; |
107 | 107 |
108 // The location where the bubble should be anchored. | 108 // The location where the bubble should be anchored. |
109 AnchorPosition anchor_position_; | 109 AnchorPosition anchor_position_; |
110 | 110 |
111 // The command to execute the extension action, if one exists. | 111 // The command to execute the extension action, if one exists. |
112 scoped_ptr<extensions::Command> action_command_; | 112 std::unique_ptr<extensions::Command> action_command_; |
113 | 113 |
114 DISALLOW_COPY_AND_ASSIGN(ExtensionInstalledBubble); | 114 DISALLOW_COPY_AND_ASSIGN(ExtensionInstalledBubble); |
115 }; | 115 }; |
116 | 116 |
117 #endif // CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_INSTALLED_BUBBLE_H_ | 117 #endif // CHROME_BROWSER_UI_EXTENSIONS_EXTENSION_INSTALLED_BUBBLE_H_ |
OLD | NEW |