Fix after certificate popup
[framework/osp/web.git] / src / FWebHistoryItem.cpp
1 //
2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
8 //
9 //     http://www.apache.org/licenses/LICENSE-2.0
10 //
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
16 //
17
18 /**
19  * @file                FWebHistoryItem.cpp
20  * @brief               The file contains the definition of HistoryItem class.
21  *
22  * This file contains the definition of HistoryItem class.
23  */
24 #include <new>
25 #include <FBaseResult.h>
26 #include <FBaseSysLog.h>
27 #include <FGrpBitmap.h>
28 #include <FWebHistoryItem.h>
29 #include "FWeb_HistoryItemImpl.h"
30
31
32 using namespace Tizen::Base;
33 using namespace Tizen::Graphics;
34
35
36 namespace Tizen { namespace Web
37 {
38
39
40 HistoryItem::HistoryItem(void)
41         : __pHistoryItemImpl(new (std::nothrow) _HistoryItemImpl())
42 {
43         SysTryReturnVoidResult(NID_WEB, __pHistoryItemImpl, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY));
44 }
45
46
47 HistoryItem::~HistoryItem(void)
48 {
49         delete __pHistoryItemImpl;
50         __pHistoryItemImpl = null;
51 }
52
53
54 String
55 HistoryItem::GetTitle(void) const
56 {
57         SysAssertf(__pHistoryItemImpl != null, "Not yet constructed. Construct() should be called before use.");
58
59         return __pHistoryItemImpl->GetTitle();
60 }
61
62
63 String
64 HistoryItem::GetUrl(void) const
65 {
66         SysAssertf(__pHistoryItemImpl != null, "Not yet constructed. Construct() should be called before use.");
67
68         return __pHistoryItemImpl->GetUrl();
69 }
70
71 Bitmap*
72 HistoryItem::GetFaviconN(void) const
73 {
74         SysAssertf(__pHistoryItemImpl != null, "Not yet constructed. Construct() should be called before use.");
75
76         ClearLastResult();
77
78         Bitmap* pFavicon = __pHistoryItemImpl->GetFaviconN();
79         SysTryReturn(NID_WEB, GetLastResult() == E_SUCCESS, null, GetLastResult(), "[%s] Propagating.", GetErrorMessage(GetLastResult()));
80
81         return pFavicon;
82 }
83
84
85 }} // Tizen::Web