| 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 #include "chrome/browser/ui/cocoa/browser_window_cocoa.h" | 5 #include "chrome/browser/ui/cocoa/browser_window_cocoa.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
| (...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 581 extensions::SetLaunchType(service, extension_id, launch_type); | 581 extensions::SetLaunchType(service, extension_id, launch_type); |
| 582 | 582 |
| 583 // Update name of app. | 583 // Update name of app. |
| 584 NSString* new_title = [app_title stringValue]; | 584 NSString* new_title = [app_title stringValue]; |
| 585 if (![original_title isEqualToString:new_title]) { | 585 if (![original_title isEqualToString:new_title]) { |
| 586 WebApplicationInfo new_web_app_info(web_app_info); | 586 WebApplicationInfo new_web_app_info(web_app_info); |
| 587 new_web_app_info.title = base::SysNSStringToUTF16(new_title); | 587 new_web_app_info.title = base::SysNSStringToUTF16(new_title); |
| 588 extensions::CreateOrUpdateBookmarkApp(service, &new_web_app_info); | 588 extensions::CreateOrUpdateBookmarkApp(service, &new_web_app_info); |
| 589 } | 589 } |
| 590 | 590 |
| 591 extensions::ExtensionRegistry* registry = | 591 // If we're not creating app shims, no need to reveal it in Finder. |
| 592 extensions::ExtensionRegistry::Get(profile); | 592 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 593 const extensions::Extension* app = registry->GetExtensionById( | 593 switches::kEnableHostedAppShimCreation)) { |
| 594 extension_id, extensions::ExtensionRegistry::ENABLED); | 594 extensions::ExtensionRegistry* registry = |
| 595 extensions::ExtensionRegistry::Get(profile); |
| 596 const extensions::Extension* app = registry->GetExtensionById( |
| 597 extension_id, extensions::ExtensionRegistry::ENABLED); |
| 595 | 598 |
| 596 web_app::RevealAppShimInFinderForApp(profile, app); | 599 web_app::RevealAppShimInFinderForApp(profile, app); |
| 600 } |
| 597 } else { | 601 } else { |
| 598 service->UninstallExtension(extension_id, | 602 service->UninstallExtension(extension_id, |
| 599 extensions::UNINSTALL_REASON_INSTALL_CANCELED, | 603 extensions::UNINSTALL_REASON_INSTALL_CANCELED, |
| 600 base::Bind(&base::DoNothing), NULL); | 604 base::Bind(&base::DoNothing), NULL); |
| 601 } | 605 } |
| 602 } | 606 } |
| 603 | 607 |
| 604 void BrowserWindowCocoa::ShowTranslateBubble( | 608 void BrowserWindowCocoa::ShowTranslateBubble( |
| 605 content::WebContents* contents, | 609 content::WebContents* contents, |
| 606 translate::TranslateStep step, | 610 translate::TranslateStep step, |
| (...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 if (browser_->bookmark_bar_state() != BookmarkBar::DETACHED) | 811 if (browser_->bookmark_bar_state() != BookmarkBar::DETACHED) |
| 808 return 0; | 812 return 0; |
| 809 return 40; | 813 return 40; |
| 810 } | 814 } |
| 811 | 815 |
| 812 void BrowserWindowCocoa::ExecuteExtensionCommand( | 816 void BrowserWindowCocoa::ExecuteExtensionCommand( |
| 813 const extensions::Extension* extension, | 817 const extensions::Extension* extension, |
| 814 const extensions::Command& command) { | 818 const extensions::Command& command) { |
| 815 [cocoa_controller() executeExtensionCommand:extension->id() command:command]; | 819 [cocoa_controller() executeExtensionCommand:extension->id() command:command]; |
| 816 } | 820 } |
| OLD | NEW |