00001 /* 00002 00003 $Id$ 00004 00005 */ 00006 00007 #include "Error.h" 00008 00009 #include "BrowserWarmStart.h" 00010 00011 BrowserWarmStart *BrowserWarmStart::_instance(NULL); 00012 00013 // Public methods. 00014 00015 int BrowserWarmStart::init(const String &profilePath) 00016 { 00017 if (_instance) 00018 return OK; 00019 00020 _instance = new BrowserWarmStart(profilePath); 00021 CHECK_CREATION(_instance, "BrowserWarmStart"); 00022 00023 return OK; 00024 } 00025 00026 // Private methods. 00027 00028 BrowserWarmStart::BrowserWarmStart(const String &profilePath) : Support(), 00029 _mozEmbed(NULL) 00030 { 00031 gtk_moz_embed_set_profile_path(CSTRING(profilePath), "."); 00032 if (!(_mozEmbed = gtk_moz_embed_new())) { 00033 failure(ERROR(MSG_OBJECT_CANNOT_CREATE, "GtkMozEmbed")); 00034 return; 00035 } 00036 } 00037 00038 BrowserWarmStart::~BrowserWarmStart() 00039 { 00040 if (_mozEmbed) 00041 delete _mozEmbed; 00042 }
1.5.1