| 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 #include "chrome/browser/ui/extensions/extension_installed_bubble.h" | 5 #include "chrome/browser/ui/extensions/extension_installed_bubble.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 205 | 205 |
| 206 bool ExtensionInstalledBubble::ShouldClose(BubbleCloseReason reason) const { | 206 bool ExtensionInstalledBubble::ShouldClose(BubbleCloseReason reason) const { |
| 207 // Installing an extension triggers a navigation event that should be ignored. | 207 // Installing an extension triggers a navigation event that should be ignored. |
| 208 return reason != BUBBLE_CLOSE_NAVIGATED; | 208 return reason != BUBBLE_CLOSE_NAVIGATED; |
| 209 } | 209 } |
| 210 | 210 |
| 211 std::string ExtensionInstalledBubble::GetName() const { | 211 std::string ExtensionInstalledBubble::GetName() const { |
| 212 return "ExtensionInstalled"; | 212 return "ExtensionInstalled"; |
| 213 } | 213 } |
| 214 | 214 |
| 215 const content::RenderFrameHost* ExtensionInstalledBubble::OwningFrame() const { |
| 216 return nullptr; |
| 217 } |
| 218 |
| 215 base::string16 ExtensionInstalledBubble::GetHowToUseDescription() const { | 219 base::string16 ExtensionInstalledBubble::GetHowToUseDescription() const { |
| 216 int message_id = 0; | 220 int message_id = 0; |
| 217 base::string16 extra; | 221 base::string16 extra; |
| 218 if (action_command_) | 222 if (action_command_) |
| 219 extra = action_command_->accelerator().GetShortcutText(); | 223 extra = action_command_->accelerator().GetShortcutText(); |
| 220 | 224 |
| 221 switch (type_) { | 225 switch (type_) { |
| 222 case BROWSER_ACTION: | 226 case BROWSER_ACTION: |
| 223 message_id = extra.empty() ? IDS_EXTENSION_INSTALLED_BROWSER_ACTION_INFO : | 227 message_id = extra.empty() ? IDS_EXTENSION_INSTALLED_BROWSER_ACTION_INFO : |
| 224 IDS_EXTENSION_INSTALLED_BROWSER_ACTION_INFO_WITH_SHORTCUT; | 228 IDS_EXTENSION_INSTALLED_BROWSER_ACTION_INFO_WITH_SHORTCUT; |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 break; | 292 break; |
| 289 case OMNIBOX_KEYWORD: | 293 case OMNIBOX_KEYWORD: |
| 290 options_ |= HOW_TO_USE | HOW_TO_MANAGE; | 294 options_ |= HOW_TO_USE | HOW_TO_MANAGE; |
| 291 anchor_position_ = ANCHOR_OMNIBOX; | 295 anchor_position_ = ANCHOR_OMNIBOX; |
| 292 break; | 296 break; |
| 293 case GENERIC: | 297 case GENERIC: |
| 294 anchor_position_ = ANCHOR_APP_MENU; | 298 anchor_position_ = ANCHOR_APP_MENU; |
| 295 break; | 299 break; |
| 296 } | 300 } |
| 297 } | 301 } |
| OLD | NEW |