1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
|
// Copyright (c) 2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "temp_scaffolding_stubs.h"
#include "build/build_config.h"
#include <vector>
#include "base/file_util.h"
#include "base/logging.h"
#include "base/thread.h"
#include "base/path_service.h"
#include "base/string_piece.h"
#include "base/singleton.h"
#include "base/task.h"
#include "chrome/browser/autocomplete/history_url_provider.h"
#include "chrome/browser/automation/automation_provider.h"
#include "chrome/browser/browser.h"
#include "chrome/browser/browser_shutdown.h"
#include "chrome/browser/cache_manager_host.h"
#include "chrome/browser/debugger/debugger_shell.h"
#include "chrome/browser/dom_ui/dom_ui.h"
#include "chrome/browser/download/download_request_dialog_delegate.h"
#include "chrome/browser/download/download_request_manager.h"
#include "chrome/browser/first_run.h"
#include "chrome/browser/history/in_memory_history_backend.h"
#include "chrome/browser/memory_details.h"
#include "chrome/browser/profile_manager.h"
#include "chrome/browser/renderer_host/render_widget_helper.h"
#include "chrome/browser/renderer_host/resource_message_filter.h"
#include "chrome/browser/rlz/rlz.h"
#include "chrome/browser/search_engines/template_url_prepopulate_data.h"
#include "chrome/browser/shell_integration.h"
#include "chrome/browser/tab_contents/web_contents.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_plugin_util.h"
#include "chrome/common/gfx/chrome_font.h"
#include "chrome/common/gfx/text_elider.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/pref_service.h"
#include "chrome/common/process_watcher.h"
#include "net/url_request/url_request_context.h"
#include "webkit/glue/webcursor.h"
#include "webkit/glue/webkit_glue.h"
//--------------------------------------------------------------------------
WebContents* AutomationProvider::GetWebContentsForHandle(
int handle, NavigationController** tab) {
NOTIMPLEMENTED();
return NULL;
}
void AutomationProvider::GetActiveWindow(int* handle) { NOTIMPLEMENTED(); }
void AutomationProvider::IsWindowActive(int handle, bool* success,
bool* is_active) {
*success = false;
NOTIMPLEMENTED();
}
void AutomationProvider::ActivateWindow(int handle) { NOTIMPLEMENTED(); }
void AutomationProvider::SetWindowVisible(int handle, bool visible,
bool* result) { NOTIMPLEMENTED(); }
void AutomationProvider::GetFocusedViewID(int handle, int* view_id) {
NOTIMPLEMENTED();
}
void AutomationProvider::OpenNewBrowserWindow(int show_command) {
NOTIMPLEMENTED();
}
void AutomationProvider::GetWindowForBrowser(int browser_handle,
bool* success,
int* handle) {
*success = false;
NOTIMPLEMENTED();
}
void AutomationProvider::GetAutocompleteEditForBrowser(
int browser_handle,
bool* success,
int* autocomplete_edit_handle) {
*success = false;
NOTIMPLEMENTED();
}
void AutomationProvider::GetBrowserForWindow(int window_handle,
bool* success,
int* browser_handle) {
*success = false;
NOTIMPLEMENTED();
}
void AutomationProvider::GetSecurityState(int handle, bool* success,
SecurityStyle* security_style,
int* ssl_cert_status,
int* mixed_content_status) {
*success = false;
NOTIMPLEMENTED();
}
void AutomationProvider::GetPageType(int handle, bool* success,
NavigationEntry::PageType* page_type) {
*success = false;
NOTIMPLEMENTED();
}
void AutomationProvider::ActionOnSSLBlockingPage(int handle, bool proceed,
IPC::Message* reply_message) {
NOTIMPLEMENTED();
}
void AutomationProvider::PrintNow(int tab_handle,
IPC::Message* reply_message) {
NOTIMPLEMENTED();
}
void AutomationProvider::SavePage(int tab_handle,
const std::wstring& file_name,
const std::wstring& dir_path,
int type,
bool* success) {
*success = false;
NOTIMPLEMENTED();
}
void AutomationProvider::GetAutocompleteEditText(int autocomplete_edit_handle,
bool* success,
std::wstring* text) {
*success = false;
NOTIMPLEMENTED();
}
void AutomationProvider::SetAutocompleteEditText(int autocomplete_edit_handle,
const std::wstring& text,
bool* success) {
*success = false;
NOTIMPLEMENTED();
}
void AutomationProvider::AutocompleteEditGetMatches(
int autocomplete_edit_handle,
bool* success,
std::vector<AutocompleteMatchData>* matches) {
*success = false;
NOTIMPLEMENTED();
}
void AutomationProvider::AutocompleteEditIsQueryInProgress(
int autocomplete_edit_handle,
bool* success,
bool* query_in_progress) {
*success = false;
NOTIMPLEMENTED();
}
void AutomationProvider::OnMessageFromExternalHost(
int handle, const std::string& message) {
NOTIMPLEMENTED();
}
void AutomationProvider::GetShowingAppModalDialog(bool* showing_dialog,
int* dialog_button) {
NOTIMPLEMENTED();
}
void AutomationProvider::ClickAppModalDialogButton(int button, bool* success) {
*success = false;
NOTIMPLEMENTED();
}
//--------------------------------------------------------------------------
bool ShellIntegration::SetAsDefaultBrowser() {
NOTIMPLEMENTED();
return true;
}
bool ShellIntegration::IsDefaultBrowser() {
NOTIMPLEMENTED();
return true;
}
//--------------------------------------------------------------------------
// static
bool FirstRun::IsChromeFirstRun() {
NOTIMPLEMENTED();
return false;
}
// static
bool FirstRun::ProcessMasterPreferences(const FilePath& user_data_dir,
const FilePath& master_prefs_path,
int* preference_details) {
NOTIMPLEMENTED();
return false;
}
// static
int FirstRun::ImportNow(Profile* profile, const CommandLine& cmdline) {
NOTIMPLEMENTED();
return 0;
}
// static
bool Upgrade::IsBrowserAlreadyRunning() {
NOTIMPLEMENTED();
return false;
}
// static
bool Upgrade::RelaunchChromeBrowser(const CommandLine& command_line) {
NOTIMPLEMENTED();
return true;
}
// static
bool Upgrade::SwapNewChromeExeIfPresent() {
NOTIMPLEMENTED();
return true;
}
void OpenFirstRunDialog(Profile* profile) { NOTIMPLEMENTED(); }
//--------------------------------------------------------------------------
void InstallJankometer(const CommandLine&) {
// http://code.google.com/p/chromium/issues/detail?id=8077
}
void UninstallJankometer() {
// http://code.google.com/p/chromium/issues/detail?id=8077
}
//--------------------------------------------------------------------------
void TabContents::SetupController(Profile* profile) {
DCHECK(!controller_);
controller_ = new NavigationController(this, profile);
}
Profile* TabContents::profile() const {
return controller_ ? controller_->profile() : NULL;
}
void TabContents::CloseContents() {
// Destroy our NavigationController, which will Destroy all tabs it owns.
controller_->Destroy();
// Note that the controller may have deleted us at this point,
// so don't touch any member variables here.
}
void TabContents::Destroy() {
// TODO(pinkerton): this isn't the real version of Destroy(), just enough to
// get the scaffolding working.
is_being_destroyed_ = true;
// Notify any observer that have a reference on this tab contents.
NotificationService::current()->Notify(
NotificationType::TAB_CONTENTS_DESTROYED,
Source<TabContents>(this),
NotificationService::NoDetails());
// Notify our NavigationController. Make sure we are deleted first, so
// that the controller is the last to die.
NavigationController* controller = controller_;
TabContentsType type = this->type();
delete this;
controller->TabContentsWasDestroyed(type);
}
const GURL& TabContents::GetURL() const {
// We may not have a navigation entry yet
NavigationEntry* entry = controller_->GetActiveEntry();
return entry ? entry->display_url() : GURL::EmptyGURL();
}
const std::wstring& TabContents::GetTitle() const {
// We use the title for the last committed entry rather than a pending
// navigation entry. For example, when the user types in a URL, we want to
// keep the old page's title until the new load has committed and we get a new
// title.
// The exception is with transient pages, for which we really want to use
// their title, as they are not committed.
NavigationEntry* entry = controller_->GetTransientEntry();
if (entry)
return entry->GetTitleForDisplay();
entry = controller_->GetLastCommittedEntry();
if (entry)
return entry->GetTitleForDisplay();
else if (controller_->LoadingURLLazily())
return controller_->GetLazyTitle();
return EmptyWString();
}
void TabContents::NotifyNavigationStateChanged(unsigned changed_flags) {
if (delegate_)
delegate_->NavigationStateChanged(this, changed_flags);
}
void TabContents::OpenURL(const GURL& url, const GURL& referrer,
WindowOpenDisposition disposition,
PageTransition::Type transition) {
if (delegate_)
delegate_->OpenURLFromTab(this, url, referrer, disposition, transition);
}
void TabContents::SetIsLoading(bool is_loading,
LoadNotificationDetails* details) {
if (is_loading == is_loading_)
return;
is_loading_ = is_loading;
waiting_for_response_ = is_loading;
// Suppress notifications for this TabContents if we are not active.
if (!is_active_)
return;
if (delegate_)
delegate_->LoadingStateChanged(this);
NotificationType type = is_loading ? NotificationType::LOAD_START :
NotificationType::LOAD_STOP;
NotificationDetails det = NotificationService::NoDetails();;
if (details)
det = Details<LoadNotificationDetails>(details);
NotificationService::current()->Notify(type,
Source<NavigationController>(this->controller()),
det);
}
bool TabContents::SupportsURL(GURL* url) {
GURL u(*url);
if (TabContents::TypeForURL(&u) == type()) {
*url = u;
return true;
}
return false;
}
int32 TabContents::GetMaxPageID() {
if (GetSiteInstance())
return GetSiteInstance()->max_page_id();
else
return max_page_id_;
}
void TabContents::UpdateMaxPageID(int32 page_id) {
// Ensure both the SiteInstance and RenderProcessHost update their max page
// IDs in sync. Only WebContents will also have site instances, except during
// testing.
if (GetSiteInstance())
GetSiteInstance()->UpdateMaxPageID(page_id);
if (AsWebContents())
AsWebContents()->process()->UpdateMaxPageID(page_id);
else
max_page_id_ = std::max(max_page_id_, page_id);
}
void TabContents::SetIsCrashed(bool state) {
if (state == is_crashed_)
return;
is_crashed_ = state;
if (delegate_)
delegate_->ContentsStateChanged(this);
}
void TabContents::SetDownloadShelfVisible(bool visible) {
if (shelf_visible_ != visible) {
if (visible) {
// Invoke GetDownloadShelf to force the shelf to be created.
GetDownloadShelf();
}
shelf_visible_ = visible;
if (delegate_)
delegate_->ContentsStateChanged(this);
}
// SetShelfVisible can force-close the shelf, so make sure we lay out
// everything correctly, as if the animation had finished. This doesn't
// matter for showing the shelf, as the show animation will do it.
ToolbarSizeChanged(false);
}
void TabContents::ToolbarSizeChanged(bool is_animating) {
TabContentsDelegate* d = delegate();
if (d)
d->ToolbarSizeChanged(this, is_animating);
}
//--------------------------------------------------------------------------
void RLZTracker::CleanupRlz() {
// http://code.google.com/p/chromium/issues/detail?id=8152
}
bool RLZTracker::GetAccessPointRlz(AccessPoint point, std::wstring* rlz) {
// http://code.google.com/p/chromium/issues/detail?id=8152
return false;
}
bool RLZTracker::RecordProductEvent(Product product, AccessPoint point,
Event event) {
// http://code.google.com/p/chromium/issues/detail?id=8152
return false;
}
// This depends on porting all the plugin IPC messages.
bool IsPluginProcess() {
return false;
}
//--------------------------------------------------------------------------
void RunJavascriptMessageBox(WebContents* web_contents,
int dialog_flags,
const std::wstring& message_text,
const std::wstring& default_prompt_text,
bool display_suppress_checkbox,
IPC::Message* reply_msg) {
NOTIMPLEMENTED();
}
void RunBeforeUnloadDialog(WebContents* web_contents,
const std::wstring& message_text,
IPC::Message* reply_msg) {
NOTIMPLEMENTED();
}
//--------------------------------------------------------------------------
void RunRepostFormWarningDialog(NavigationController*) {
}
LoginHandler* CreateLoginPrompt(net::AuthChallengeInfo* auth_info,
URLRequest* request,
MessageLoop* ui_loop) {
NOTIMPLEMENTED();
return NULL;
}
void ProcessWatcher::EnsureProcessTerminated(int) {
NOTIMPLEMENTED();
}
//--------------------------------------------------------------------------
namespace webkit_glue {
bool IsDefaultPluginEnabled() {
NOTIMPLEMENTED();
return false;
}
#if defined(OS_MACOSX)
bool ClipboardIsFormatAvailable(Clipboard::FormatType format) {
NOTIMPLEMENTED();
return false;
}
#endif
} // webkit_glue
#ifndef CHROME_DEBUGGER_DISABLED
DebuggerShell::DebuggerShell(DebuggerInputOutput *io) { }
DebuggerShell::~DebuggerShell() { }
void DebuggerShell::Start() { NOTIMPLEMENTED(); }
void DebuggerShell::Debug(TabContents* tab) { NOTIMPLEMENTED(); }
void DebuggerShell::DebugMessage(const std::wstring& msg) { NOTIMPLEMENTED(); }
void DebuggerShell::OnDebugAttach() { NOTIMPLEMENTED(); }
void DebuggerShell::OnDebugDisconnect() { NOTIMPLEMENTED(); }
void DebuggerShell::DidConnect() { NOTIMPLEMENTED(); }
void DebuggerShell::DidDisconnect() { NOTIMPLEMENTED(); }
void DebuggerShell::ProcessCommand(const std::wstring& data) {
NOTIMPLEMENTED();
}
#endif // !CHROME_DEBUGGER_DISABLED
MemoryDetails::MemoryDetails() {
NOTIMPLEMENTED();
}
void MemoryDetails::StartFetch() {
NOTIMPLEMENTED();
}
InfoBar* ConfirmInfoBarDelegate::CreateInfoBar() {
NOTIMPLEMENTED();
return NULL;
}
InfoBar* AlertInfoBarDelegate::CreateInfoBar() {
NOTIMPLEMENTED();
return NULL;
}
InfoBar* LinkInfoBarDelegate::CreateInfoBar() {
NOTIMPLEMENTED();
return NULL;
}
bool CanImportURL(const GURL& url) {
NOTIMPLEMENTED();
return false;
}
DownloadRequestDialogDelegate* DownloadRequestDialogDelegate::Create(
TabContents* tab,
DownloadRequestManager::TabDownloadState* host) {
NOTIMPLEMENTED();
return NULL;
}
views::Window* CreateInputWindow(gfx::NativeWindow parent_hwnd,
InputWindowDelegate* delegate) {
NOTIMPLEMENTED();
return new views::Window();
}
|