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

Side by Side Diff: chrome/browser/custom_handlers/protocol_handler_registry_unittest.cc

Issue 1657933003: Fixes the interactive default browser UX for policy setting (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 10 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 "chrome/browser/custom_handlers/protocol_handler_registry.h" 5 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 10
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
235 shell_integration::IS_DEFAULT; 235 shell_integration::IS_DEFAULT;
236 if (force_failure_) 236 if (force_failure_)
237 state = shell_integration::NOT_DEFAULT; 237 state = shell_integration::NOT_DEFAULT;
238 238
239 BrowserThread::PostTask( 239 BrowserThread::PostTask(
240 BrowserThread::UI, FROM_HERE, 240 BrowserThread::UI, FROM_HERE,
241 base::Bind(&FakeProtocolClientWorker::OnCheckIsDefaultComplete, this, 241 base::Bind(&FakeProtocolClientWorker::OnCheckIsDefaultComplete, this,
242 state)); 242 state));
243 } 243 }
244 244
245 void SetAsDefault(bool interactive_permitted) override { 245 void SetAsDefault() override {
246 BrowserThread::PostTask( 246 BrowserThread::PostTask(
247 BrowserThread::UI, FROM_HERE, 247 BrowserThread::UI, FROM_HERE,
248 base::Bind(&FakeProtocolClientWorker::OnSetAsDefaultAttemptComplete, 248 base::Bind(&FakeProtocolClientWorker::OnSetAsDefaultAttemptComplete,
249 this, AttemptResult::SUCCESS)); 249 this, AttemptResult::SUCCESS));
250 } 250 }
251 251
252 private: 252 private:
253 bool force_failure_; 253 bool force_failure_;
254 }; 254 };
255 255
(...skipping 847 matching lines...) Expand 10 before | Expand all | Expand 10 after
1103 // added to pref. 1103 // added to pref.
1104 ASSERT_EQ(InPrefIgnoredHandlerCount(), 2); 1104 ASSERT_EQ(InPrefIgnoredHandlerCount(), 2);
1105 ASSERT_EQ(InMemoryIgnoredHandlerCount(), 4); 1105 ASSERT_EQ(InMemoryIgnoredHandlerCount(), 4);
1106 1106
1107 registry()->RemoveIgnoredHandler(p2u1); 1107 registry()->RemoveIgnoredHandler(p2u1);
1108 1108
1109 // p2u1 installed by user and policy, so it is removed from pref alone. 1109 // p2u1 installed by user and policy, so it is removed from pref alone.
1110 ASSERT_EQ(InPrefIgnoredHandlerCount(), 1); 1110 ASSERT_EQ(InPrefIgnoredHandlerCount(), 1);
1111 ASSERT_EQ(InMemoryIgnoredHandlerCount(), 4); 1111 ASSERT_EQ(InMemoryIgnoredHandlerCount(), 4);
1112 } 1112 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698