OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 // defined(OS_WIN) | 10 #endif // defined(OS_WIN) |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 CHECK(IncognitoModePrefs::CanOpenBrowser(profile_)); | 360 CHECK(IncognitoModePrefs::CanOpenBrowser(profile_)); |
361 CHECK(!profile_->IsGuestSession() || profile_->IsOffTheRecord()) | 361 CHECK(!profile_->IsGuestSession() || profile_->IsOffTheRecord()) |
362 << "Only off the record browser may be opened in guest mode"; | 362 << "Only off the record browser may be opened in guest mode"; |
363 | 363 |
364 // TODO(jeremy): Move to initializer list once flag is removed. | 364 // TODO(jeremy): Move to initializer list once flag is removed. |
365 if (IsFastTabUnloadEnabled()) | 365 if (IsFastTabUnloadEnabled()) |
366 fast_unload_controller_.reset(new chrome::FastUnloadController(this)); | 366 fast_unload_controller_.reset(new chrome::FastUnloadController(this)); |
367 else | 367 else |
368 unload_controller_.reset(new chrome::UnloadController(this)); | 368 unload_controller_.reset(new chrome::UnloadController(this)); |
369 | 369 |
370 if (!app_name_.empty()) | |
371 chrome::RegisterAppPrefs(app_name_, profile_); | |
372 tab_strip_model_->AddObserver(this); | 370 tab_strip_model_->AddObserver(this); |
373 | 371 |
374 toolbar_model_.reset(new ToolbarModelImpl(toolbar_model_delegate_.get())); | 372 toolbar_model_.reset(new ToolbarModelImpl(toolbar_model_delegate_.get())); |
375 search_model_.reset(new SearchModel()); | 373 search_model_.reset(new SearchModel()); |
376 search_delegate_.reset(new SearchDelegate(search_model_.get())); | 374 search_delegate_.reset(new SearchDelegate(search_model_.get())); |
377 | 375 |
378 registrar_.Add(this, | 376 registrar_.Add(this, |
379 extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, | 377 extensions::NOTIFICATION_EXTENSION_LOADED_DEPRECATED, |
380 content::Source<Profile>(profile_->GetOriginalProfile())); | 378 content::Source<Profile>(profile_->GetOriginalProfile())); |
381 registrar_.Add(this, | 379 registrar_.Add(this, |
(...skipping 2091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2473 if (contents && !allow_js_access) { | 2471 if (contents && !allow_js_access) { |
2474 contents->web_contents()->GetController().LoadURL( | 2472 contents->web_contents()->GetController().LoadURL( |
2475 target_url, | 2473 target_url, |
2476 content::Referrer(), | 2474 content::Referrer(), |
2477 content::PAGE_TRANSITION_LINK, | 2475 content::PAGE_TRANSITION_LINK, |
2478 std::string()); // No extra headers. | 2476 std::string()); // No extra headers. |
2479 } | 2477 } |
2480 | 2478 |
2481 return contents != NULL; | 2479 return contents != NULL; |
2482 } | 2480 } |
OLD | NEW |