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

Side by Side Diff: chrome/browser/ui/startup/startup_browser_creator_browsertest.cc

Issue 93883004: Sync the launch type pref for apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unfix nit because it prevents testing of how invalid values are handled Created 6 years, 11 months 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 <algorithm> 5 #include <algorithm>
6 #include <string> 6 #include <string>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/files/file_path.h" 9 #include "base/files/file_path.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 115
116 // Code that opens a new browser assumes we start with exactly one. 116 // Code that opens a new browser assumes we start with exactly one.
117 ASSERT_EQ(1u, chrome::GetBrowserCount(browser()->profile(), 117 ASSERT_EQ(1u, chrome::GetBrowserCount(browser()->profile(),
118 browser()->host_desktop_type())); 118 browser()->host_desktop_type()));
119 } 119 }
120 120
121 void SetAppLaunchPref(const std::string& app_id, 121 void SetAppLaunchPref(const std::string& app_id,
122 extensions::LaunchType launch_type) { 122 extensions::LaunchType launch_type) {
123 ExtensionService* service = extensions::ExtensionSystem::Get( 123 ExtensionService* service = extensions::ExtensionSystem::Get(
124 browser()->profile())->extension_service(); 124 browser()->profile())->extension_service();
125 extensions::SetLaunchType(service->extension_prefs(), app_id, launch_type); 125 extensions::SetLaunchType(service, app_id, launch_type);
126 } 126 }
127 127
128 Browser* FindOneOtherBrowserForProfile(Profile* profile, 128 Browser* FindOneOtherBrowserForProfile(Profile* profile,
129 Browser* not_this_browser) { 129 Browser* not_this_browser) {
130 for (chrome::BrowserIterator it; !it.done(); it.Next()) { 130 for (chrome::BrowserIterator it; !it.done(); it.Next()) {
131 if (*it != not_this_browser && it->profile() == profile) 131 if (*it != not_this_browser && it->profile() == profile)
132 return *it; 132 return *it;
133 } 133 }
134 return NULL; 134 return NULL;
135 } 135 }
(...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after
1401 ASSERT_EQ(1, tab_strip->count()); 1401 ASSERT_EQ(1, tab_strip->count());
1402 EXPECT_EQ("title1.html", 1402 EXPECT_EQ("title1.html",
1403 tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName()); 1403 tab_strip->GetWebContentsAt(0)->GetURL().ExtractFileName());
1404 } 1404 }
1405 #endif // defined(ENABLE_CONFIGURATION_POLICY) 1405 #endif // defined(ENABLE_CONFIGURATION_POLICY)
1406 1406
1407 #endif // !defined(OS_LINUX) || !defined(GOOGLE_CHROME_BUILD) || 1407 #endif // !defined(OS_LINUX) || !defined(GOOGLE_CHROME_BUILD) ||
1408 // defined(ENABLE_CONFIGURATION_POLICY) 1408 // defined(ENABLE_CONFIGURATION_POLICY)
1409 1409
1410 #endif // !defined(OS_CHROMEOS) 1410 #endif // !defined(OS_CHROMEOS)
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/launcher/launcher_context_menu.cc ('k') | chrome/browser/ui/webui/ntp/app_launcher_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698