~abreu-alexandre/oxide/add-ua-to-downloadrequested

« back to all changes in this revision

Viewing changes to shared/browser/oxide_off_the_record_browser_context_impl.h

  • Committer: Chris Coulson
  • Date: 2014-08-15 00:48:29 UTC
  • Revision ID: chris.coulson@canonical.com-20140815004829-32ijd5l00jlp5iu1
Strip down BrowserContextImpl / OTRBrowserContextImpl by introducing 2 new structs for data members shared between a BrowserContext pair (BrowserContextSharedData and BrowserContextSharedIOData), which allows us to drop all of the virtual methods that proxy calls between the 2 BrowserContexts

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
// vim:expandtab:shiftwidth=2:tabstop=2:
2
 
// Copyright (C) 2013 Canonical Ltd.
3
 
 
4
 
// This library is free software; you can redistribute it and/or
5
 
// modify it under the terms of the GNU Lesser General Public
6
 
// License as published by the Free Software Foundation; either
7
 
// version 2.1 of the License, or (at your option) any later version.
8
 
 
9
 
// This library is distributed in the hope that it will be useful,
10
 
// but WITHOUT ANY WARRANTY; without even the implied warranty of
11
 
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
 
// Lesser General Public License for more details.
13
 
 
14
 
// You should have received a copy of the GNU Lesser General Public
15
 
// License along with this library; if not, write to the Free Software
16
 
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
17
 
 
18
 
#ifndef _OXIDE_SHARED_BROWSER_OFF_THE_RECORD_BROWSER_CONTEXT_IMPL_H_
19
 
#define _OXIDE_SHARED_BROWSER_OFF_THE_RECORD_BROWSER_CONTEXT_IMPL_H_
20
 
 
21
 
#include "oxide_browser_context.h"
22
 
 
23
 
#include "base/basictypes.h"
24
 
#include "base/compiler_specific.h"
25
 
 
26
 
namespace oxide {
27
 
 
28
 
class BrowserContextImpl;
29
 
 
30
 
class OffTheRecordBrowserContextIODataImpl FINAL :
31
 
    public BrowserContextIOData {
32
 
 public:
33
 
  OffTheRecordBrowserContextIODataImpl(BrowserContextIOData* original_io_data);
34
 
 
35
 
  net::StaticCookiePolicy::Type GetCookiePolicy() const FINAL;
36
 
  content::CookieStoreConfig::SessionCookieMode GetSessionCookieMode() const FINAL;
37
 
 
38
 
  bool IsPopupBlockerEnabled() const FINAL;
39
 
 
40
 
  base::FilePath GetPath() const FINAL;
41
 
  base::FilePath GetCachePath() const FINAL;
42
 
 
43
 
  std::string GetAcceptLangs() const FINAL;
44
 
 
45
 
  std::string GetUserAgent() const FINAL;
46
 
 
47
 
  bool IsOffTheRecord() const FINAL;
48
 
 
49
 
 private:
50
 
  BrowserContextIOData* original_io_data_;
51
 
 
52
 
  DISALLOW_IMPLICIT_CONSTRUCTORS(OffTheRecordBrowserContextIODataImpl);
53
 
};
54
 
 
55
 
class OffTheRecordBrowserContextImpl FINAL : public BrowserContext {
56
 
 public:
57
 
  BrowserContext* GetOffTheRecordContext() FINAL;
58
 
  BrowserContext* GetOriginalContext() FINAL;
59
 
 
60
 
  void SetAcceptLangs(const std::string& langs) FINAL;
61
 
 
62
 
  std::string GetProduct() const FINAL;
63
 
  void SetProduct(const std::string& product) FINAL;
64
 
 
65
 
  void SetUserAgent(const std::string& user_agent) FINAL;
66
 
  void SetCookiePolicy(net::StaticCookiePolicy::Type policy) FINAL;
67
 
  void SetIsPopupBlockerEnabled(bool enabled) FINAL;
68
 
 
69
 
  bool GetDevtoolsEnabled() const FINAL;
70
 
  int GetDevtoolsPort() const FINAL;
71
 
  std::string GetDevtoolsBindIp() const FINAL;
72
 
 
73
 
  UserScriptMaster& UserScriptManager() FINAL;
74
 
 
75
 
 private:
76
 
  friend class BrowserContext;
77
 
  friend class BrowserContextImpl;
78
 
 
79
 
  OffTheRecordBrowserContextImpl(BrowserContextImpl* original_context);
80
 
 
81
 
  BrowserContextImpl* original_context_;
82
 
 
83
 
  DISALLOW_COPY_AND_ASSIGN(OffTheRecordBrowserContextImpl); 
84
 
};
85
 
 
86
 
} // namespace oxide
87
 
 
88
 
#endif // _OXIDE_SHARED_BROWSER_OFF_THE_RECORD_BROWSER_CONTEXT_IMPL_H_