Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(713)

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_cocoa.mm

Issue 799273002: Added flag --enable-hosted-app-shim-creation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 bool create_app_shims = base::CommandLine::ForCurrentProcess()->HasSwitch(
593 const extensions::Extension* app = registry->GetExtensionById( 593 switches::kEnableAppShimCreation);
594 extension_id, extensions::ExtensionRegistry::ENABLED); 594 if (create_app_shims) {
595 extensions::ExtensionRegistry* registry =
596 extensions::ExtensionRegistry::Get(profile);
597 const extensions::Extension* app = registry->GetExtensionById(
598 extension_id, extensions::ExtensionRegistry::ENABLED);
595 599
596 web_app::RevealAppShimInFinderForApp(profile, app); 600 web_app::RevealAppShimInFinderForApp(profile, app);
601 }
597 } else { 602 } else {
598 service->UninstallExtension(extension_id, 603 service->UninstallExtension(extension_id,
599 extensions::UNINSTALL_REASON_INSTALL_CANCELED, 604 extensions::UNINSTALL_REASON_INSTALL_CANCELED,
600 base::Bind(&base::DoNothing), NULL); 605 base::Bind(&base::DoNothing), NULL);
601 } 606 }
602 } 607 }
603 608
604 void BrowserWindowCocoa::ShowTranslateBubble( 609 void BrowserWindowCocoa::ShowTranslateBubble(
605 content::WebContents* contents, 610 content::WebContents* contents,
606 translate::TranslateStep step, 611 translate::TranslateStep step,
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
807 if (browser_->bookmark_bar_state() != BookmarkBar::DETACHED) 812 if (browser_->bookmark_bar_state() != BookmarkBar::DETACHED)
808 return 0; 813 return 0;
809 return 40; 814 return 40;
810 } 815 }
811 816
812 void BrowserWindowCocoa::ExecuteExtensionCommand( 817 void BrowserWindowCocoa::ExecuteExtensionCommand(
813 const extensions::Extension* extension, 818 const extensions::Extension* extension,
814 const extensions::Command& command) { 819 const extensions::Command& command) {
815 [cocoa_controller() executeExtensionCommand:extension->id() command:command]; 820 [cocoa_controller() executeExtensionCommand:extension->id() command:command];
816 } 821 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698