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

Side by Side Diff: third_party/WebKit/Source/core/frame/Navigator.cpp

Issue 2886943007: Introduce NavigatorWebDriver interface
Patch Set: wip: need more tests Created 3 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2000 Harri Porten (porten@kde.org) 2 * Copyright (C) 2000 Harri Porten (porten@kde.org)
3 * Copyright (c) 2000 Daniel Molkentin (molkentin@kde.org) 3 * Copyright (c) 2000 Daniel Molkentin (molkentin@kde.org)
4 * Copyright (c) 2000 Stefan Schimanski (schimmi@kde.org) 4 * Copyright (c) 2000 Stefan Schimanski (schimmi@kde.org)
5 * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc. 5 * Copyright (C) 2003, 2004, 2005, 2006 Apple Computer, Inc.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public 9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 if (!GetFrame()) 66 if (!GetFrame())
67 return false; 67 return false;
68 68
69 Settings* settings = GetFrame()->GetSettings(); 69 Settings* settings = GetFrame()->GetSettings();
70 if (!settings || !settings->GetCookieEnabled()) 70 if (!settings || !settings->GetCookieEnabled())
71 return false; 71 return false;
72 72
73 return CookiesEnabled(GetFrame()->GetDocument()); 73 return CookiesEnabled(GetFrame()->GetDocument());
74 } 74 }
75 75
76 bool Navigator::webdriver() const {
77 if (!GetFrame())
78 return false;
79
80 Settings* settings = GetFrame()->GetSettings();
81 if (!settings)
82 return false;
83
84 return settings->GetAutomationControlled() || settings->GetHeadless();
85 }
86
76 Vector<String> Navigator::languages() { 87 Vector<String> Navigator::languages() {
77 Vector<String> languages; 88 Vector<String> languages;
78 89
79 if (!GetFrame() || !GetFrame()->GetPage()) { 90 if (!GetFrame() || !GetFrame()->GetPage()) {
80 languages.push_back(DefaultLanguage()); 91 languages.push_back(DefaultLanguage());
81 return languages; 92 return languages;
82 } 93 }
83 94
84 String accept_languages = 95 String accept_languages =
85 GetFrame()->GetPage()->GetChromeClient().AcceptLanguages(); 96 GetFrame()->GetPage()->GetChromeClient().AcceptLanguages();
(...skipping 11 matching lines...) Expand all
97 108
98 return languages; 109 return languages;
99 } 110 }
100 111
101 DEFINE_TRACE(Navigator) { 112 DEFINE_TRACE(Navigator) {
102 DOMWindowClient::Trace(visitor); 113 DOMWindowClient::Trace(visitor);
103 Supplementable<Navigator>::Trace(visitor); 114 Supplementable<Navigator>::Trace(visitor);
104 } 115 }
105 116
106 } // namespace blink 117 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/Navigator.h ('k') | third_party/WebKit/Source/core/frame/Navigator.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698