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

Side by Side Diff: chrome/browser/ui/browser_init.cc

Issue 5019005: Add "open as window" menu item to NTP app menu. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase for commit Created 10 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/browser_init.h" 5 #include "chrome/browser/ui/browser_init.h"
6 6
7 #include <algorithm> // For max(). 7 #include <algorithm> // For max().
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "app/resource_bundle.h" 10 #include "app/resource_bundle.h"
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
598 return true; 598 return true;
599 } 599 }
600 return false; 600 return false;
601 } 601 }
602 602
603 bool BrowserInit::LaunchWithProfile::OpenApplicationWindow(Profile* profile) { 603 bool BrowserInit::LaunchWithProfile::OpenApplicationWindow(Profile* profile) {
604 std::string url_string, app_id; 604 std::string url_string, app_id;
605 if (!IsAppLaunch(&url_string, &app_id)) 605 if (!IsAppLaunch(&url_string, &app_id))
606 return false; 606 return false;
607 607
608 // http://crbug.com/37548 608 // This can fail if the app_id is invalid. It can also fail if the
609 // TODO(rafaelw): There are two legitimate cases where the extensions 609 // extension is external, and has not yet been installed.
610 // service could not be ready at this point which need to be handled: 610 // TODO(skerner): Do something reasonable here. Pop up a warning panel?
611 // 1) The locale has changed and the manifests stored in the preferences
612 // need to be relocalized.
613 // 2) An externally installed extension will be found and installed.
614 // Note that this can also fail if the app_id is simply invalid.
615 // TODO(rafaelw): Do something reasonable here. Pop up a warning panel?
616 // Open an URL to the gallery page of the extension id? 611 // Open an URL to the gallery page of the extension id?
617 if (!app_id.empty()) 612 if (!app_id.empty())
618 return Browser::OpenApplication(profile, app_id, NULL) != NULL; 613 return Browser::OpenApplication(profile, app_id, NULL) != NULL;
619 614
620 if (url_string.empty()) 615 if (url_string.empty())
621 return false; 616 return false;
622 617
623 #if defined(OS_WIN) // Fix up Windows shortcuts. 618 #if defined(OS_WIN) // Fix up Windows shortcuts.
624 ReplaceSubstringsAfterOffset(&url_string, 0, "\\x", "%"); 619 ReplaceSubstringsAfterOffset(&url_string, 0, "\\x", "%");
625 #endif 620 #endif
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after
1032 scoped_refptr<AutomationProviderClass> automation = 1027 scoped_refptr<AutomationProviderClass> automation =
1033 new AutomationProviderClass(profile); 1028 new AutomationProviderClass(profile);
1034 automation->ConnectToChannel(channel_id); 1029 automation->ConnectToChannel(channel_id);
1035 automation->SetExpectedTabCount(expected_tabs); 1030 automation->SetExpectedTabCount(expected_tabs);
1036 1031
1037 AutomationProviderList* list = 1032 AutomationProviderList* list =
1038 g_browser_process->InitAutomationProviderList(); 1033 g_browser_process->InitAutomationProviderList();
1039 DCHECK(list); 1034 DCHECK(list);
1040 list->AddProvider(automation); 1035 list->AddProvider(automation);
1041 } 1036 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698