OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <windows.h> | 8 #include <windows.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 #include "chrome/browser/extensions/browser_extension_window_controller.h" | 53 #include "chrome/browser/extensions/browser_extension_window_controller.h" |
54 #include "chrome/browser/extensions/default_apps_trial.h" | 54 #include "chrome/browser/extensions/default_apps_trial.h" |
55 #include "chrome/browser/extensions/extension_prefs.h" | 55 #include "chrome/browser/extensions/extension_prefs.h" |
56 #include "chrome/browser/extensions/extension_service.h" | 56 #include "chrome/browser/extensions/extension_service.h" |
57 #include "chrome/browser/extensions/tab_helper.h" | 57 #include "chrome/browser/extensions/tab_helper.h" |
58 #include "chrome/browser/favicon/favicon_tab_helper.h" | 58 #include "chrome/browser/favicon/favicon_tab_helper.h" |
59 #include "chrome/browser/file_select_helper.h" | 59 #include "chrome/browser/file_select_helper.h" |
60 #include "chrome/browser/first_run/first_run.h" | 60 #include "chrome/browser/first_run/first_run.h" |
61 #include "chrome/browser/google/google_url_tracker.h" | 61 #include "chrome/browser/google/google_url_tracker.h" |
62 #include "chrome/browser/infobars/infobar_tab_helper.h" | 62 #include "chrome/browser/infobars/infobar_tab_helper.h" |
| 63 #include "chrome/browser/intents/device_attached_intent_source.h" |
63 #include "chrome/browser/intents/register_intent_handler_infobar_delegate.h" | 64 #include "chrome/browser/intents/register_intent_handler_infobar_delegate.h" |
64 #include "chrome/browser/intents/web_intents_util.h" | 65 #include "chrome/browser/intents/web_intents_util.h" |
65 #include "chrome/browser/lifetime/application_lifetime.h" | 66 #include "chrome/browser/lifetime/application_lifetime.h" |
66 #include "chrome/browser/media/media_stream_devices_controller.h" | 67 #include "chrome/browser/media/media_stream_devices_controller.h" |
67 #include "chrome/browser/net/url_fixer_upper.h" | 68 #include "chrome/browser/net/url_fixer_upper.h" |
68 #include "chrome/browser/notifications/notification_ui_manager.h" | 69 #include "chrome/browser/notifications/notification_ui_manager.h" |
69 #include "chrome/browser/platform_util.h" | 70 #include "chrome/browser/platform_util.h" |
70 #include "chrome/browser/prefs/incognito_mode_prefs.h" | 71 #include "chrome/browser/prefs/incognito_mode_prefs.h" |
71 #include "chrome/browser/prefs/pref_service.h" | 72 #include "chrome/browser/prefs/pref_service.h" |
72 #include "chrome/browser/printing/cloud_print/cloud_print_setup_flow.h" | 73 #include "chrome/browser/printing/cloud_print/cloud_print_setup_flow.h" |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 ALLOW_THIS_IN_INITIALIZER_LIST( | 345 ALLOW_THIS_IN_INITIALIZER_LIST( |
345 toolbar_model_delegate_( | 346 toolbar_model_delegate_( |
346 new BrowserToolbarModelDelegate(this))), | 347 new BrowserToolbarModelDelegate(this))), |
347 ALLOW_THIS_IN_INITIALIZER_LIST( | 348 ALLOW_THIS_IN_INITIALIZER_LIST( |
348 tab_restore_service_delegate_( | 349 tab_restore_service_delegate_( |
349 new BrowserTabRestoreServiceDelegate(this))), | 350 new BrowserTabRestoreServiceDelegate(this))), |
350 ALLOW_THIS_IN_INITIALIZER_LIST( | 351 ALLOW_THIS_IN_INITIALIZER_LIST( |
351 synced_window_delegate_( | 352 synced_window_delegate_( |
352 new BrowserSyncedWindowDelegate(this))), | 353 new BrowserSyncedWindowDelegate(this))), |
353 bookmark_bar_state_(BookmarkBar::HIDDEN), | 354 bookmark_bar_state_(BookmarkBar::HIDDEN), |
354 device_attached_intent_source_(this, this), | |
355 ALLOW_THIS_IN_INITIALIZER_LIST( | 355 ALLOW_THIS_IN_INITIALIZER_LIST( |
356 command_controller_(new chrome::BrowserCommandController(this))), | 356 command_controller_(new chrome::BrowserCommandController(this))), |
357 window_has_shown_(false) { | 357 window_has_shown_(false) { |
358 if (!app_name_.empty()) | 358 if (!app_name_.empty()) |
359 chrome::RegisterAppPrefs(app_name_, profile_); | 359 chrome::RegisterAppPrefs(app_name_, profile_); |
360 tab_strip_model_->AddObserver(this); | 360 tab_strip_model_->AddObserver(this); |
361 | 361 |
362 toolbar_model_.reset(new ToolbarModel(toolbar_model_delegate_.get())); | 362 toolbar_model_.reset(new ToolbarModel(toolbar_model_delegate_.get())); |
363 search_model_.reset(new chrome::search::SearchModel(NULL)); | 363 search_model_.reset(new chrome::search::SearchModel(NULL)); |
364 search_delegate_.reset( | 364 search_delegate_.reset( |
(...skipping 24 matching lines...) Expand all Loading... |
389 profile_pref_registrar_.Add(prefs::kHomePage, this); | 389 profile_pref_registrar_.Add(prefs::kHomePage, this); |
390 | 390 |
391 BrowserList::AddBrowser(this); | 391 BrowserList::AddBrowser(this); |
392 | 392 |
393 // NOTE: These prefs all need to be explicitly destroyed in the destructor | 393 // NOTE: These prefs all need to be explicitly destroyed in the destructor |
394 // or you'll get a nasty surprise when you run the incognito tests. | 394 // or you'll get a nasty surprise when you run the incognito tests. |
395 encoding_auto_detect_.Init(prefs::kWebKitUsesUniversalDetector, | 395 encoding_auto_detect_.Init(prefs::kWebKitUsesUniversalDetector, |
396 profile_->GetPrefs(), NULL); | 396 profile_->GetPrefs(), NULL); |
397 | 397 |
398 instant_controller_.reset(new chrome::BrowserInstantController(this)); | 398 instant_controller_.reset(new chrome::BrowserInstantController(this)); |
| 399 device_attached_intent_source_.reset( |
| 400 new DeviceAttachedIntentSource(this, (this))); |
399 | 401 |
400 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_INIT); | 402 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_INIT); |
401 | 403 |
402 FilePath profile_path = profile_->GetPath(); | 404 FilePath profile_path = profile_->GetPath(); |
403 ProfileMetrics::LogProfileLaunch(profile_path); | 405 ProfileMetrics::LogProfileLaunch(profile_path); |
404 | 406 |
405 window_ = params.window ? params.window : CreateBrowserWindow(this); | 407 window_ = params.window ? params.window : CreateBrowserWindow(this); |
406 | 408 |
407 // TODO(beng): move to BrowserFrameWin. | 409 // TODO(beng): move to BrowserFrameWin. |
408 #if defined(OS_WIN) && !defined(USE_AURA) | 410 #if defined(OS_WIN) && !defined(USE_AURA) |
(...skipping 1880 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2289 if (contents && !allow_js_access) { | 2291 if (contents && !allow_js_access) { |
2290 contents->web_contents()->GetController().LoadURL( | 2292 contents->web_contents()->GetController().LoadURL( |
2291 target_url, | 2293 target_url, |
2292 content::Referrer(), | 2294 content::Referrer(), |
2293 content::PAGE_TRANSITION_LINK, | 2295 content::PAGE_TRANSITION_LINK, |
2294 std::string()); // No extra headers. | 2296 std::string()); // No extra headers. |
2295 } | 2297 } |
2296 | 2298 |
2297 return contents != NULL; | 2299 return contents != NULL; |
2298 } | 2300 } |
OLD | NEW |