| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 #include "chrome/browser/ui/sync/browser_synced_window_delegate.h" | 124 #include "chrome/browser/ui/sync/browser_synced_window_delegate.h" |
| 125 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" | 125 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
| 126 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 126 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 127 #include "chrome/browser/ui/tabs/dock_info.h" | 127 #include "chrome/browser/ui/tabs/dock_info.h" |
| 128 #include "chrome/browser/ui/tabs/tab_finder.h" | 128 #include "chrome/browser/ui/tabs/tab_finder.h" |
| 129 #include "chrome/browser/ui/tabs/tab_menu_model.h" | 129 #include "chrome/browser/ui/tabs/tab_menu_model.h" |
| 130 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 130 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 131 #include "chrome/browser/ui/web_applications/web_app_ui.h" | 131 #include "chrome/browser/ui/web_applications/web_app_ui.h" |
| 132 #include "chrome/browser/ui/webui/feedback_ui.h" | 132 #include "chrome/browser/ui/webui/feedback_ui.h" |
| 133 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" | 133 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" |
| 134 #include "chrome/browser/ui/webui/ntp/new_tab_page_handler.h" | |
| 135 #include "chrome/browser/ui/webui/options2/content_settings_handler2.h" | 134 #include "chrome/browser/ui/webui/options2/content_settings_handler2.h" |
| 136 #include "chrome/browser/ui/webui/signin/login_ui_service.h" | 135 #include "chrome/browser/ui/webui/signin/login_ui_service.h" |
| 137 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" | 136 #include "chrome/browser/ui/webui/signin/login_ui_service_factory.h" |
| 138 #include "chrome/browser/ui/window_sizer.h" | 137 #include "chrome/browser/ui/window_sizer.h" |
| 139 #include "chrome/browser/upgrade_detector.h" | 138 #include "chrome/browser/upgrade_detector.h" |
| 140 #include "chrome/browser/web_applications/web_app.h" | 139 #include "chrome/browser/web_applications/web_app.h" |
| 141 #include "chrome/common/chrome_constants.h" | 140 #include "chrome/common/chrome_constants.h" |
| 142 #include "chrome/common/chrome_notification_types.h" | 141 #include "chrome/common/chrome_notification_types.h" |
| 143 #include "chrome/common/chrome_switches.h" | 142 #include "chrome/common/chrome_switches.h" |
| 144 #include "chrome/common/custom_handlers/protocol_handler.h" | 143 #include "chrome/common/custom_handlers/protocol_handler.h" |
| (...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 if (local_state && local_state->FindPreference( | 556 if (local_state && local_state->FindPreference( |
| 558 prefs::kAutofillPersonalDataManagerFirstRun) && | 557 prefs::kAutofillPersonalDataManagerFirstRun) && |
| 559 local_state->GetBoolean(prefs::kAutofillPersonalDataManagerFirstRun)) { | 558 local_state->GetBoolean(prefs::kAutofillPersonalDataManagerFirstRun)) { |
| 560 // Notify PDM that this is a first run. | 559 // Notify PDM that this is a first run. |
| 561 #if defined(OS_WIN) | 560 #if defined(OS_WIN) |
| 562 ImportAutofillDataWin(PersonalDataManagerFactory::GetForProfile(profile_)); | 561 ImportAutofillDataWin(PersonalDataManagerFactory::GetForProfile(profile_)); |
| 563 #endif // defined(OS_WIN) | 562 #endif // defined(OS_WIN) |
| 564 // Reset the preference so we don't call it again for subsequent windows. | 563 // Reset the preference so we don't call it again for subsequent windows. |
| 565 local_state->ClearPref(prefs::kAutofillPersonalDataManagerFirstRun); | 564 local_state->ClearPref(prefs::kAutofillPersonalDataManagerFirstRun); |
| 566 } | 565 } |
| 567 | |
| 568 // Permanently dismiss ntp4 bubble for new users. | |
| 569 if (first_run::IsChromeFirstRun()) | |
| 570 NewTabPageHandler::DismissIntroMessage(local_state); | |
| 571 } | 566 } |
| 572 | 567 |
| 573 void Browser::SetWindowForTesting(BrowserWindow* window) { | 568 void Browser::SetWindowForTesting(BrowserWindow* window) { |
| 574 DCHECK(!window_); | 569 DCHECK(!window_); |
| 575 window_ = window; | 570 window_ = window; |
| 576 fullscreen_controller_ = new FullscreenController(window_, profile_, this); | 571 fullscreen_controller_ = new FullscreenController(window_, profile_, this); |
| 577 } | 572 } |
| 578 | 573 |
| 579 /////////////////////////////////////////////////////////////////////////////// | 574 /////////////////////////////////////////////////////////////////////////////// |
| 580 // Getters & Setters | 575 // Getters & Setters |
| (...skipping 4649 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5230 if (contents && !allow_js_access) { | 5225 if (contents && !allow_js_access) { |
| 5231 contents->web_contents()->GetController().LoadURL( | 5226 contents->web_contents()->GetController().LoadURL( |
| 5232 target_url, | 5227 target_url, |
| 5233 content::Referrer(), | 5228 content::Referrer(), |
| 5234 content::PAGE_TRANSITION_LINK, | 5229 content::PAGE_TRANSITION_LINK, |
| 5235 std::string()); // No extra headers. | 5230 std::string()); // No extra headers. |
| 5236 } | 5231 } |
| 5237 | 5232 |
| 5238 return contents != NULL; | 5233 return contents != NULL; |
| 5239 } | 5234 } |
| OLD | NEW |