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

Side by Side Diff: chrome/test/testing_profile.h

Issue 255087: Adding a unique runtime Id to Profile objects, that can be used as the key... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/profile.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #ifndef CHROME_TEST_TESTING_PROFILE_H_ 5 #ifndef CHROME_TEST_TESTING_PROFILE_H_
6 #define CHROME_TEST_TESTING_PROFILE_H_ 6 #define CHROME_TEST_TESTING_PROFILE_H_
7 7
8 #include "base/base_paths.h" 8 #include "base/base_paths.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 // CreateBookmarkModel. 50 // CreateBookmarkModel.
51 void BlockUntilBookmarkModelLoaded(); 51 void BlockUntilBookmarkModelLoaded();
52 52
53 // Creates a TemplateURLModel. If not invoked the TemplateURLModel is NULL. 53 // Creates a TemplateURLModel. If not invoked the TemplateURLModel is NULL.
54 void CreateTemplateURLModel(); 54 void CreateTemplateURLModel();
55 55
56 // Uses a specific theme provider for this profile. TestingProfile takes 56 // Uses a specific theme provider for this profile. TestingProfile takes
57 // ownership of |theme_provider|. 57 // ownership of |theme_provider|.
58 void UseThemeProvider(BrowserThemeProvider* theme_provider); 58 void UseThemeProvider(BrowserThemeProvider* theme_provider);
59 59
60 virtual ProfileId GetRuntimeId() {
61 return reinterpret_cast<ProfileId>(this);
62 }
63
60 virtual FilePath GetPath() { 64 virtual FilePath GetPath() {
61 return path_; 65 return path_;
62 } 66 }
63 // Sets whether we're off the record. Default is false. 67 // Sets whether we're off the record. Default is false.
64 void set_off_the_record(bool off_the_record) { 68 void set_off_the_record(bool off_the_record) {
65 off_the_record_ = off_the_record; 69 off_the_record_ = off_the_record;
66 } 70 }
67 virtual bool IsOffTheRecord() { return off_the_record_; } 71 virtual bool IsOffTheRecord() { return off_the_record_; }
68 virtual Profile* GetOffTheRecordProfile() { return NULL; } 72 virtual Profile* GetOffTheRecordProfile() { return NULL; }
69 73
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 bool has_history_service_; 218 bool has_history_service_;
215 219
216 std::wstring id_; 220 std::wstring id_;
217 221
218 bool off_the_record_; 222 bool off_the_record_;
219 223
220 // Did the last session exit cleanly? Default is true. 224 // Did the last session exit cleanly? Default is true.
221 bool last_session_exited_cleanly_; 225 bool last_session_exited_cleanly_;
222 }; 226 };
223 227
228 // A profile that derives from another profile. This does not actually
229 // override anything except the GetRuntimeId() in order to test sharing of
230 // site information.
231 class DerivedTestingProfile : public TestingProfile {
232 public:
233 DerivedTestingProfile(Profile* profile) : original_profile_(profile) {
234 }
235
236 virtual ProfileId GetRuntimeId() {
237 return original_profile_->GetRuntimeId();
238 }
239
240 protected:
241 Profile* original_profile_;
242 };
243
224 #endif // CHROME_TEST_TESTING_PROFILE_H_ 244 #endif // CHROME_TEST_TESTING_PROFILE_H_
OLDNEW
« no previous file with comments | « chrome/browser/profile.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698