WebKit2/Shared/WebPreferencesStore.cpp
changeset 0 4f2f89ce4247
equal deleted inserted replaced
-1:000000000000 0:4f2f89ce4247
       
     1 /*
       
     2  * Copyright (C) 2010 Apple Inc. All rights reserved.
       
     3  *
       
     4  * Redistribution and use in source and binary forms, with or without
       
     5  * modification, are permitted provided that the following conditions
       
     6  * are met:
       
     7  * 1. Redistributions of source code must retain the above copyright
       
     8  *    notice, this list of conditions and the following disclaimer.
       
     9  * 2. Redistributions in binary form must reproduce the above copyright
       
    10  *    notice, this list of conditions and the following disclaimer in the
       
    11  *    documentation and/or other materials provided with the distribution.
       
    12  *
       
    13  * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
       
    14  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
       
    15  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
       
    16  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
       
    17  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
       
    18  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
       
    19  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
       
    20  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
       
    21  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
       
    22  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
       
    23  * THE POSSIBILITY OF SUCH DAMAGE.
       
    24  */
       
    25 
       
    26 #include "WebPreferencesStore.h"
       
    27 
       
    28 namespace WebKit {
       
    29 
       
    30 WebPreferencesStore::WebPreferencesStore()
       
    31     : javaScriptEnabled(true)
       
    32     , loadsImagesAutomatically(true)
       
    33     , pluginsEnabled(true)
       
    34     , offlineWebApplicationCacheEnabled(false)
       
    35     , localStorageEnabled(true)
       
    36     , minimumFontSize(9)
       
    37     , minimumLogicalFontSize(9)
       
    38     , defaultFontSize(16)
       
    39     , defaultFixedFontSize(13)
       
    40     , standardFontFamily("Times")
       
    41     , cursiveFontFamily("Apple Chancery")
       
    42     , fantasyFontFamily("Papyrus")
       
    43     , fixedFontFamily("Courier")
       
    44     , sansSerifFontFamily("Helvetica")
       
    45     , serifFontFamily("Times")
       
    46 {
       
    47 }
       
    48 
       
    49 WebPreferencesStore::WebPreferencesStore(const WebPreferencesStore& other)
       
    50 {
       
    51     javaScriptEnabled = other.javaScriptEnabled;
       
    52     loadsImagesAutomatically = other.loadsImagesAutomatically;
       
    53     pluginsEnabled = other.pluginsEnabled;
       
    54     offlineWebApplicationCacheEnabled = other.offlineWebApplicationCacheEnabled;
       
    55     localStorageEnabled = other.localStorageEnabled;
       
    56     minimumFontSize = other.minimumFontSize;
       
    57     minimumLogicalFontSize = other.minimumLogicalFontSize;
       
    58     defaultFontSize = other.defaultFontSize;
       
    59     defaultFixedFontSize = other.defaultFixedFontSize;
       
    60     standardFontFamily = other.standardFontFamily;
       
    61     cursiveFontFamily = other.cursiveFontFamily;
       
    62     fantasyFontFamily = other.fantasyFontFamily;
       
    63     fixedFontFamily = other.fixedFontFamily;
       
    64     sansSerifFontFamily = other.sansSerifFontFamily;
       
    65     serifFontFamily = other.serifFontFamily;
       
    66 
       
    67 }
       
    68 
       
    69 WebPreferencesStore& WebPreferencesStore::operator=(const WebPreferencesStore& other)
       
    70 {
       
    71     WebPreferencesStore copy = other;
       
    72     swap(copy);
       
    73     return *this;
       
    74 }
       
    75 
       
    76 void WebPreferencesStore::swap(WebPreferencesStore& other)
       
    77 {
       
    78     std::swap(javaScriptEnabled, other.javaScriptEnabled);
       
    79     std::swap(loadsImagesAutomatically, other.loadsImagesAutomatically);
       
    80     std::swap(pluginsEnabled, other.pluginsEnabled);
       
    81     std::swap(offlineWebApplicationCacheEnabled, other.offlineWebApplicationCacheEnabled);
       
    82     std::swap(localStorageEnabled, other.localStorageEnabled);
       
    83     std::swap(minimumFontSize, other.minimumFontSize);
       
    84     std::swap(minimumLogicalFontSize, other.minimumLogicalFontSize);
       
    85     std::swap(defaultFontSize, other.defaultFontSize);
       
    86     std::swap(defaultFixedFontSize, other.defaultFixedFontSize);
       
    87     WebCore::swap(standardFontFamily, other.standardFontFamily);
       
    88     WebCore::swap(cursiveFontFamily, other.cursiveFontFamily);
       
    89     WebCore::swap(fantasyFontFamily, other.fantasyFontFamily);
       
    90     WebCore::swap(fixedFontFamily, other.fixedFontFamily);
       
    91     WebCore::swap(sansSerifFontFamily, other.sansSerifFontFamily);
       
    92     WebCore::swap(serifFontFamily, other.serifFontFamily);
       
    93 }
       
    94 
       
    95 } // namespace WebKit