| 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 #import "chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controlle
r.h" | 5 #import "chrome/browser/ui/cocoa/extensions/extension_installed_bubble_controlle
r.h" |
| 6 | 6 |
| 7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
| 8 #include "base/mac/bundle_locations.h" | 8 #include "base/mac/bundle_locations.h" |
| 9 #include "base/mac/mac_util.h" | 9 #include "base/mac/mac_util.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/strings/sys_string_conversions.h" | 11 #include "base/strings/sys_string_conversions.h" |
| 12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 13 #include "chrome/browser/chrome_notification_types.h" | 13 #include "chrome/browser/chrome_notification_types.h" |
| 14 #include "chrome/browser/extensions/api/commands/command_service.h" | 14 #include "chrome/browser/extensions/api/commands/command_service.h" |
| 15 #include "chrome/browser/extensions/bundle_installer.h" | 15 #include "chrome/browser/extensions/bundle_installer.h" |
| 16 #include "chrome/browser/extensions/extension_action.h" | 16 #include "chrome/browser/extensions/extension_action.h" |
| 17 #include "chrome/browser/extensions/extension_action_manager.h" | 17 #include "chrome/browser/extensions/extension_action_manager.h" |
| 18 #include "chrome/browser/signin/signin_promo.h" | 18 #include "chrome/browser/signin/signin_promo.h" |
| 19 #include "chrome/browser/ui/browser.h" | 19 #include "chrome/browser/ui/browser.h" |
| 20 #include "chrome/browser/ui/browser_navigator.h" | 20 #include "chrome/browser/ui/browser_navigator.h" |
| 21 #include "chrome/browser/ui/browser_window.h" | 21 #include "chrome/browser/ui/browser_window.h" |
| 22 #include "chrome/browser/ui/chrome_pages.h" |
| 22 #include "chrome/browser/ui/chrome_style.h" | 23 #include "chrome/browser/ui/chrome_style.h" |
| 23 #include "chrome/browser/ui/cocoa/browser_window_cocoa.h" | 24 #include "chrome/browser/ui/cocoa/browser_window_cocoa.h" |
| 24 #include "chrome/browser/ui/cocoa/browser_window_controller.h" | 25 #include "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 25 #include "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h" | 26 #include "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h" |
| 26 #include "chrome/browser/ui/cocoa/hover_close_button.h" | 27 #include "chrome/browser/ui/cocoa/hover_close_button.h" |
| 27 #include "chrome/browser/ui/cocoa/info_bubble_view.h" | 28 #include "chrome/browser/ui/cocoa/info_bubble_view.h" |
| 28 #include "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" | 29 #include "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" |
| 29 #include "chrome/browser/ui/cocoa/new_tab_button.h" | 30 #include "chrome/browser/ui/cocoa/new_tab_button.h" |
| 30 #include "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" | 31 #include "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" |
| 31 #include "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" | 32 #include "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 | 195 |
| 195 - (IBAction)closeWindow:(id)sender { | 196 - (IBAction)closeWindow:(id)sender { |
| 196 DCHECK([[self window] isVisible]); | 197 DCHECK([[self window] isVisible]); |
| 197 [self close]; | 198 [self close]; |
| 198 } | 199 } |
| 199 | 200 |
| 200 - (BOOL)textView:(NSTextView*)aTextView | 201 - (BOOL)textView:(NSTextView*)aTextView |
| 201 clickedOnLink:(id)link | 202 clickedOnLink:(id)link |
| 202 atIndex:(NSUInteger)charIndex { | 203 atIndex:(NSUInteger)charIndex { |
| 203 DCHECK_EQ(promo_.get(), aTextView); | 204 DCHECK_EQ(promo_.get(), aTextView); |
| 204 GURL promo_url = | 205 chrome::ShowBrowserSignin(browser_, signin::SOURCE_EXTENSION_INSTALL_BUBBLE); |
| 205 signin::GetPromoURL(signin::SOURCE_EXTENSION_INSTALL_BUBBLE, false); | |
| 206 chrome::NavigateParams params( | |
| 207 chrome::GetSingletonTabNavigateParams(browser_, promo_url)); | |
| 208 chrome::Navigate(¶ms); | |
| 209 return YES; | 206 return YES; |
| 210 } | 207 } |
| 211 | 208 |
| 212 // Extracted to a function here so that it can be overridden for unit testing. | 209 // Extracted to a function here so that it can be overridden for unit testing. |
| 213 - (void)removePageActionPreviewIfNecessary { | 210 - (void)removePageActionPreviewIfNecessary { |
| 214 if (!extension_ || !pageActionPreviewShowing_) | 211 if (!extension_ || !pageActionPreviewShowing_) |
| 215 return; | 212 return; |
| 216 ExtensionAction* page_action = | 213 ExtensionAction* page_action = |
| 217 extensions::ExtensionActionManager::Get(browser_->profile())-> | 214 extensions::ExtensionActionManager::Get(browser_->profile())-> |
| 218 GetPageAction(*extension_); | 215 GetPageAction(*extension_); |
| (...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 install_ui->OpenAppInstalledUI(extension_->id()); | 697 install_ui->OpenAppInstalledUI(extension_->id()); |
| 701 } | 698 } |
| 702 | 699 |
| 703 - (void)awakeFromNib { | 700 - (void)awakeFromNib { |
| 704 if (bundle_) | 701 if (bundle_) |
| 705 return; | 702 return; |
| 706 [self initializeLabel]; | 703 [self initializeLabel]; |
| 707 } | 704 } |
| 708 | 705 |
| 709 @end | 706 @end |
| OLD | NEW |