| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 #include "chrome/grit/chromium_strings.h" | 41 #include "chrome/grit/chromium_strings.h" |
| 42 #include "chrome/grit/generated_resources.h" | 42 #include "chrome/grit/generated_resources.h" |
| 43 #include "components/bubble/bubble_controller.h" | 43 #include "components/bubble/bubble_controller.h" |
| 44 #include "components/bubble/bubble_ui.h" | 44 #include "components/bubble/bubble_ui.h" |
| 45 #include "components/signin/core/browser/signin_metrics.h" | 45 #include "components/signin/core/browser/signin_metrics.h" |
| 46 #include "extensions/browser/install/extension_install_ui.h" | 46 #include "extensions/browser/install/extension_install_ui.h" |
| 47 #include "extensions/common/extension.h" | 47 #include "extensions/common/extension.h" |
| 48 #import "skia/ext/skia_utils_mac.h" | 48 #import "skia/ext/skia_utils_mac.h" |
| 49 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMUILocalizerAndLayoutTw
eaker.h" | 49 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMUILocalizerAndLayoutTw
eaker.h" |
| 50 #include "third_party/skia/include/core/SkBitmap.h" | 50 #include "third_party/skia/include/core/SkBitmap.h" |
| 51 #include "ui/base/cocoa/cocoa_base_utils.h" |
| 51 #import "ui/base/cocoa/controls/hyperlink_text_view.h" | 52 #import "ui/base/cocoa/controls/hyperlink_text_view.h" |
| 52 #include "ui/base/l10n/l10n_util.h" | 53 #include "ui/base/l10n/l10n_util.h" |
| 53 | 54 |
| 54 using content::BrowserThread; | 55 using content::BrowserThread; |
| 55 using extensions::BundleInstaller; | 56 using extensions::BundleInstaller; |
| 56 using extensions::Extension; | 57 using extensions::Extension; |
| 57 | 58 |
| 58 @interface ExtensionInstalledBubbleController () | 59 @interface ExtensionInstalledBubbleController () |
| 59 | 60 |
| 60 - (const Extension*)extension; | 61 - (const Extension*)extension; |
| (...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 // different than directly below the previous content if the icon is larger | 582 // different than directly below the previous content if the icon is larger |
| 582 // than the messages. Workaround by just always setting nextY to be at the | 583 // than the messages. Workaround by just always setting nextY to be at the |
| 583 // bottom. | 584 // bottom. |
| 584 nextY = NSHeight([promoContainer_ frame]) + | 585 nextY = NSHeight([promoContainer_ frame]) + |
| 585 extension_installed_bubble::kInnerVerticalMargin; | 586 extension_installed_bubble::kInnerVerticalMargin; |
| 586 adjustView(promoContainer_, &nextY); | 587 adjustView(promoContainer_, &nextY); |
| 587 } | 588 } |
| 588 } | 589 } |
| 589 | 590 |
| 590 - (void)updateAnchorPosition { | 591 - (void)updateAnchorPosition { |
| 591 self.anchorPoint = | 592 self.anchorPoint = ui::ConvertPointFromWindowToScreen( |
| 592 [self.parentWindow convertBaseToScreen:[self calculateArrowPoint]]; | 593 self.parentWindow, [self calculateArrowPoint]); |
| 593 } | 594 } |
| 594 | 595 |
| 595 - (IBAction)onManageShortcutClicked:(id)sender { | 596 - (IBAction)onManageShortcutClicked:(id)sender { |
| 596 DCHECK([self bubbleReference]); | 597 DCHECK([self bubbleReference]); |
| 597 bool didClose = [self bubbleReference]->CloseBubble(BUBBLE_CLOSE_ACCEPTED); | 598 bool didClose = [self bubbleReference]->CloseBubble(BUBBLE_CLOSE_ACCEPTED); |
| 598 DCHECK(didClose); | 599 DCHECK(didClose); |
| 599 std::string configure_url = chrome::kChromeUIExtensionsURL; | 600 std::string configure_url = chrome::kChromeUIExtensionsURL; |
| 600 configure_url += chrome::kExtensionConfigureCommandsSubPage; | 601 configure_url += chrome::kExtensionConfigureCommandsSubPage; |
| 601 chrome::NavigateParams params(chrome::GetSingletonTabNavigateParams( | 602 chrome::NavigateParams params(chrome::GetSingletonTabNavigateParams( |
| 602 browser_, GURL(configure_url))); | 603 browser_, GURL(configure_url))); |
| 603 chrome::Navigate(¶ms); | 604 chrome::Navigate(¶ms); |
| 604 } | 605 } |
| 605 | 606 |
| 606 - (IBAction)onAppShortcutClicked:(id)sender { | 607 - (IBAction)onAppShortcutClicked:(id)sender { |
| 607 scoped_ptr<extensions::ExtensionInstallUI> install_ui( | 608 scoped_ptr<extensions::ExtensionInstallUI> install_ui( |
| 608 extensions::CreateExtensionInstallUI(browser_->profile())); | 609 extensions::CreateExtensionInstallUI(browser_->profile())); |
| 609 install_ui->OpenAppInstalledUI([self extension]->id()); | 610 install_ui->OpenAppInstalledUI([self extension]->id()); |
| 610 } | 611 } |
| 611 | 612 |
| 612 - (void)doClose { | 613 - (void)doClose { |
| 613 installedBubble_ = nullptr; | 614 installedBubble_ = nullptr; |
| 614 [self close]; | 615 [self close]; |
| 615 } | 616 } |
| 616 | 617 |
| 617 @end | 618 @end |
| OLD | NEW |