diff options
-rw-r--r-- | chrome/browser/chromeos/login/login_utils.cc | 5 | ||||
-rw-r--r-- | chrome/browser/sessions/session_restore.cc | 6 | ||||
-rw-r--r-- | chrome/browser/sessions/tab_restore_service.cc | 6 | ||||
-rw-r--r-- | chrome/browser/ui/browser.cc | 12 | ||||
-rw-r--r-- | chrome/browser/ui/browser_init.cc | 7 | ||||
-rw-r--r-- | chrome/browser/ui/browser_navigator_browsertest_chromeos.cc | 2 | ||||
-rw-r--r-- | chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm | 6 | ||||
-rw-r--r-- | chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc | 6 | ||||
-rw-r--r-- | chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc | 6 | ||||
-rw-r--r-- | chrome/browser/ui/webui/app_launcher_handler.cc | 10 |
10 files changed, 27 insertions, 39 deletions
diff --git a/chrome/browser/chromeos/login/login_utils.cc b/chrome/browser/chromeos/login/login_utils.cc index 18652b7..8694f8a 100644 --- a/chrome/browser/chromeos/login/login_utils.cc +++ b/chrome/browser/chromeos/login/login_utils.cc @@ -72,6 +72,9 @@ const char kGuestModeLoggingLevel[] = "1"; // Format of command line switch. const char kSwitchFormatString[] = " --%s=\"%s\""; +// User name which is used in the Guest session. +const char kGuestUserName[] = ""; + // Resets the proxy configuration service for the default request context. class ResetDefaultProxyConfigServiceTask : public Task { public: @@ -424,6 +427,8 @@ std::string LoginUtilsImpl::GetOffTheRecordCommandLine( command_line->AppendSwitchASCII(switches::kLoggingLevel, kGuestModeLoggingLevel); + command_line->AppendSwitchASCII(switches::kLoginUser, kGuestUserName); + if (start_url.is_valid()) command_line->AppendArg(start_url.spec()); diff --git a/chrome/browser/sessions/session_restore.cc b/chrome/browser/sessions/session_restore.cc index 9795306..14d06a0 100644 --- a/chrome/browser/sessions/session_restore.cc +++ b/chrome/browser/sessions/session_restore.cc @@ -652,10 +652,8 @@ class SessionRestoreImpl : public NotificationObserver { // Record an app launch, if applicable. GURL url = tab.navigations.at(tab.current_navigation_index).virtual_url(); - // TODO: the ExtensionService should never be NULL, but in some cases it is, - // see bug 73768. After it is resolved, the explicit test can go away. - ExtensionService* service = browser->profile()->GetExtensionService(); - if (service && service->IsInstalledApp(url)) { + DCHECK(browser->profile()->GetExtensionService()); + if (browser->profile()->GetExtensionService()->IsInstalledApp(url)) { UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, extension_misc::APP_LAUNCH_SESSION_RESTORE, extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); diff --git a/chrome/browser/sessions/tab_restore_service.cc b/chrome/browser/sessions/tab_restore_service.cc index 7e24c0e..33c3ffc 100644 --- a/chrome/browser/sessions/tab_restore_service.cc +++ b/chrome/browser/sessions/tab_restore_service.cc @@ -155,10 +155,8 @@ void RemoveEntryByID(SessionID::id_type id, void RecordAppLaunch(Browser* browser, const TabRestoreService::Tab& tab) { GURL url = tab.navigations.at(tab.current_navigation_index).virtual_url(); Profile* profile = browser->profile(); - // TODO: the ExtensionService should never be NULL, but in some cases it is, - // see bug 73768. After it is resolved, the explicit test can go away. - ExtensionService* service = profile->GetExtensionService(); - if (!service || !service->IsInstalledApp(url)) + DCHECK(profile->GetExtensionService()); + if (!profile->GetExtensionService()->IsInstalledApp(url)) return; UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc index 6d60411..a9022c1 100644 --- a/chrome/browser/ui/browser.cc +++ b/chrome/browser/ui/browser.cc @@ -1312,10 +1312,8 @@ void Browser::OpenCurrentURL() { TabStripModel::ADD_FORCE_INDEX | TabStripModel::ADD_INHERIT_OPENER; browser::Navigate(¶ms); - // TODO: the ExtensionService should never be NULL, but in some cases it is, - // see bug 73768. After it is resolved, the explicit test can go away. - ExtensionService* service = profile_->GetExtensionService(); - if (service && service->IsInstalledApp(url)) { + DCHECK(profile_->GetExtensionService()); + if (profile_->GetExtensionService()->IsInstalledApp(url)) { UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, extension_misc::APP_LAUNCH_OMNIBOX_LOCATION, extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); @@ -3526,10 +3524,8 @@ void Browser::CommitInstant(TabContentsWrapper* preview_contents) { instant_unload_handler_->RunUnloadListenersOrDestroy(old_contents, index); GURL url = preview_contents->tab_contents()->GetURL(); - // TODO: the ExtensionService should never be NULL, but in some cases it is, - // see bug 73768. After it is resolved, the explicit test can go away. - ExtensionService* service = profile_->GetExtensionService(); - if (service && service->IsInstalledApp(url)) { + DCHECK(profile_->GetExtensionService()); + if (profile_->GetExtensionService()->IsInstalledApp(url)) { UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, extension_misc::APP_LAUNCH_OMNIBOX_INSTANT, extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); diff --git a/chrome/browser/ui/browser_init.cc b/chrome/browser/ui/browser_init.cc index f5e8ee1..781c48b 100644 --- a/chrome/browser/ui/browser_init.cc +++ b/chrome/browser/ui/browser_init.cc @@ -485,12 +485,8 @@ void RecordAppLaunches( Profile* profile, const std::vector<GURL>& cmd_line_urls, const std::vector<BrowserInit::LaunchWithProfile::Tab>& autolaunch_tabs) { - // TODO: the ExtensionService should never be NULL, but in some cases it is, - // see bug 73768. After it is resolved, the explicit test can go away. ExtensionService* extension_service = profile->GetExtensionService(); - if (!extension_service) - return; - + DCHECK(extension_service); for (size_t i = 0; i < cmd_line_urls.size(); ++i) { if (extension_service->IsInstalledApp(cmd_line_urls.at(i))) { UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, @@ -498,7 +494,6 @@ void RecordAppLaunches( extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); } } - for (size_t i = 0; i < autolaunch_tabs.size(); ++i) { if (extension_service->IsInstalledApp(autolaunch_tabs.at(i).url)) { UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, diff --git a/chrome/browser/ui/browser_navigator_browsertest_chromeos.cc b/chrome/browser/ui/browser_navigator_browsertest_chromeos.cc index 28006c1..48f5e8a 100644 --- a/chrome/browser/ui/browser_navigator_browsertest_chromeos.cc +++ b/chrome/browser/ui/browser_navigator_browsertest_chromeos.cc @@ -5,6 +5,7 @@ #include "chrome/browser/ui/browser_navigator_browsertest.h" #include "base/command_line.h" +#include "chrome/common/chrome_switches.h" #include "chrome/browser/chromeos/login/login_utils.h" #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/ui/browser.h" @@ -18,6 +19,7 @@ class BrowserGuestSessionNavigatorTest: public BrowserNavigatorTest { protected: virtual void SetUpCommandLine(CommandLine* command_line) { CommandLine command_line_copy = *command_line; + command_line_copy.AppendSwitchASCII(switches::kLoginProfile, "user"); chromeos::LoginUtils::Get()->GetOffTheRecordCommandLine(GetGoogleURL(), command_line_copy, command_line); diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm index 0242883..847b3cc 100644 --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.mm @@ -121,10 +121,8 @@ const CGFloat kBookmarkBarOverlap = 3.0; const NSTimeInterval kBookmarkBarAnimationDuration = 0.12; void RecordAppLaunch(Profile* profile, GURL url) { - // TODO: the ExtensionService should never be NULL, but in some cases it is, - // see bug 73768. After it is resolved, the explicit test can go away. - ExtensionService* service = profile->GetExtensionService(); - if (!service || !service->IsInstalledApp(url)) + DCHECK(profile->GetExtensionService()); + if (!profile->GetExtensionService()->IsInstalledApp(url)) return; UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, diff --git a/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc b/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc index 44d2438..39c7fbf 100644 --- a/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc +++ b/chrome/browser/ui/gtk/bookmarks/bookmark_bar_gtk.cc @@ -109,10 +109,8 @@ void SetToolBarStyle() { } void RecordAppLaunch(Profile* profile, GURL url) { - // TODO: the ExtensionService should never be NULL, but in some cases it is, - // see bug 73768. After it is resolved, the explicit test can go away. - ExtensionService* service = profile->GetExtensionService(); - if (!service || !service->IsInstalledApp(url)) + DCHECK(profile->GetExtensionService()); + if (!profile->GetExtensionService()->IsInstalledApp(url)) return; UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc index 638655f..c1cb88d89 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc @@ -232,10 +232,8 @@ class OverFlowButton : public views::MenuButton { }; void RecordAppLaunch(Profile* profile, GURL url) { - // TODO: the ExtensionService should never be NULL, but in some cases it is, - // see bug 73768. After it is resolved, the explicit test can go away. - ExtensionService* service = profile->GetExtensionService(); - if (!service || !service->IsInstalledApp(url)) + DCHECK(profile->GetExtensionService()); + if (!profile->GetExtensionService()->IsInstalledApp(url)) return; UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, diff --git a/chrome/browser/ui/webui/app_launcher_handler.cc b/chrome/browser/ui/webui/app_launcher_handler.cc index 3b23bff..ddde438 100644 --- a/chrome/browser/ui/webui/app_launcher_handler.cc +++ b/chrome/browser/ui/webui/app_launcher_handler.cc @@ -132,8 +132,10 @@ bool AppLauncherHandler::HandlePing(Profile* profile, const std::string& path) { // At this point, the user must have used the app launcher, so we hide the // promo if its still displayed. - if (is_promo_active) + if (is_promo_active) { + DCHECK(profile->GetExtensionService()); profile->GetExtensionService()->default_apps()->SetPromoHidden(); + } if (is_web_store_ping) { RecordWebStoreLaunch(is_promo_active); @@ -477,10 +479,8 @@ void AppLauncherHandler::RecordAppLaunchByURL( CHECK(bucket != extension_misc::APP_LAUNCH_BUCKET_INVALID); GURL url(UnescapeURLComponent(escaped_url, kUnescapeRules)); - // TODO: the ExtensionService should never be NULL, but in some cases it is, - // see bug 73768. After it is resolved, the explicit test can go away. - ExtensionService* service = profile->GetExtensionService(); - if (!service || !service->IsInstalledApp(url)) + DCHECK(profile->GetExtensionService()); + if (!profile->GetExtensionService()->IsInstalledApp(url)) return; UMA_HISTOGRAM_ENUMERATION(extension_misc::kAppLaunchHistogram, bucket, |