OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser.h" | 5 #include "chrome/browser/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 #include <windows.h> | 9 #include <windows.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
11 | 11 |
12 #include <algorithm> | 12 #include <algorithm> |
13 #include <string> | 13 #include <string> |
14 | 14 |
15 #include "app/animation.h" | 15 #include "app/animation.h" |
16 #include "app/l10n_util.h" | 16 #include "app/l10n_util.h" |
17 #include "base/base_paths.h" | 17 #include "base/base_paths.h" |
18 #include "base/command_line.h" | 18 #include "base/command_line.h" |
19 #include "base/logging.h" | 19 #include "base/logging.h" |
20 #include "base/metrics/histogram.h" | 20 #include "base/metrics/histogram.h" |
21 #include "base/path_service.h" | 21 #include "base/path_service.h" |
22 #include "base/string_util.h" | 22 #include "base/string_util.h" |
23 #include "base/thread.h" | 23 #include "base/thread.h" |
24 #include "base/thread_restrictions.h" | 24 #include "base/thread_restrictions.h" |
25 #include "base/utf_string_conversions.h" | 25 #include "base/utf_string_conversions.h" |
26 #include "gfx/point.h" | 26 #include "gfx/point.h" |
27 #include "chrome/app/chrome_command_ids.h" | 27 #include "chrome/app/chrome_command_ids.h" |
28 #include "chrome/browser/autofill/autofill_manager.h" | 28 #include "chrome/browser/autofill/autofill_manager.h" |
29 #if defined(OS_WIN) | |
30 #include "chrome/browser/autofill/autofill_ie_toolbar_import_win.h" | |
31 #endif // defined(OS_WIN) | |
32 #include "chrome/browser/bookmarks/bookmark_model.h" | 29 #include "chrome/browser/bookmarks/bookmark_model.h" |
33 #include "chrome/browser/bookmarks/bookmark_utils.h" | 30 #include "chrome/browser/bookmarks/bookmark_utils.h" |
34 #include "chrome/browser/browser_list.h" | 31 #include "chrome/browser/browser_list.h" |
35 #include "chrome/browser/browser_process.h" | 32 #include "chrome/browser/browser_process.h" |
36 #include "chrome/browser/browser_shutdown.h" | 33 #include "chrome/browser/browser_shutdown.h" |
37 #include "chrome/browser/browser_window.h" | 34 #include "chrome/browser/browser_window.h" |
38 #include "chrome/browser/browser_url_handler.h" | 35 #include "chrome/browser/browser_url_handler.h" |
39 #include "chrome/browser/character_encoding.h" | 36 #include "chrome/browser/character_encoding.h" |
40 #include "chrome/browser/debugger/devtools_manager.h" | 37 #include "chrome/browser/debugger/devtools_manager.h" |
41 #include "chrome/browser/debugger/devtools_toggle_action.h" | 38 #include "chrome/browser/debugger/devtools_toggle_action.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 #include "net/base/static_cookie_policy.h" | 105 #include "net/base/static_cookie_policy.h" |
109 #include "net/url_request/url_request_context.h" | 106 #include "net/url_request/url_request_context.h" |
110 #include "webkit/glue/window_open_disposition.h" | 107 #include "webkit/glue/window_open_disposition.h" |
111 | 108 |
112 #if defined(ENABLE_REMOTING) | 109 #if defined(ENABLE_REMOTING) |
113 #include "chrome/browser/remoting/remoting_setup_flow.h" | 110 #include "chrome/browser/remoting/remoting_setup_flow.h" |
114 #endif | 111 #endif |
115 | 112 |
116 #if defined(OS_WIN) | 113 #if defined(OS_WIN) |
117 #include "app/win_util.h" | 114 #include "app/win_util.h" |
| 115 #include "chrome/browser/autofill/autofill_ie_toolbar_import_win.h" |
118 #include "chrome/browser/browser_child_process_host.h" | 116 #include "chrome/browser/browser_child_process_host.h" |
119 #include "chrome/browser/cert_store.h" | 117 #include "chrome/browser/cert_store.h" |
120 #include "chrome/browser/download/save_package.h" | 118 #include "chrome/browser/download/save_package.h" |
121 #include "chrome/browser/ssl/ssl_error_info.h" | 119 #include "chrome/browser/ssl/ssl_error_info.h" |
122 #include "chrome/browser/shell_integration.h" | 120 #include "chrome/browser/shell_integration.h" |
123 #include "chrome/browser/task_manager/task_manager.h" | 121 #include "chrome/browser/task_manager/task_manager.h" |
124 #include "chrome/browser/view_ids.h" | 122 #include "chrome/browser/view_ids.h" |
125 #include "chrome/browser/views/location_bar/location_bar_view.h" | 123 #include "chrome/browser/views/location_bar/location_bar_view.h" |
126 #endif // OS_WIN | 124 #endif // OS_WIN |
127 | 125 |
(...skipping 3202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3330 const bool show_main_ui = (type() == TYPE_NORMAL); | 3328 const bool show_main_ui = (type() == TYPE_NORMAL); |
3331 #endif | 3329 #endif |
3332 | 3330 |
3333 command_updater_.UpdateCommandEnabled(IDC_SYNC_BOOKMARKS, | 3331 command_updater_.UpdateCommandEnabled(IDC_SYNC_BOOKMARKS, |
3334 show_main_ui && profile_->IsSyncAccessible()); | 3332 show_main_ui && profile_->IsSyncAccessible()); |
3335 } | 3333 } |
3336 | 3334 |
3337 /////////////////////////////////////////////////////////////////////////////// | 3335 /////////////////////////////////////////////////////////////////////////////// |
3338 // Browser, InstantDelegate implementation: | 3336 // Browser, InstantDelegate implementation: |
3339 | 3337 |
| 3338 void Browser::PrepareForInstant() { |
| 3339 window_->PrepareForInstant(); |
| 3340 } |
| 3341 |
3340 void Browser::ShowInstant(TabContents* preview_contents) { | 3342 void Browser::ShowInstant(TabContents* preview_contents) { |
3341 DCHECK(instant_->tab_contents() == GetSelectedTabContents()); | 3343 DCHECK(instant_->tab_contents() == GetSelectedTabContents()); |
3342 window_->ShowInstant(preview_contents); | 3344 window_->ShowInstant(preview_contents); |
3343 } | 3345 } |
3344 | 3346 |
3345 void Browser::HideInstant() { | 3347 void Browser::HideInstant() { |
3346 window_->HideInstant(); | 3348 window_->HideInstant(); |
3347 } | 3349 } |
3348 | 3350 |
3349 void Browser::CommitInstant(TabContents* preview_contents) { | 3351 void Browser::CommitInstant(TabContents* preview_contents) { |
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4094 NOTREACHED(); | 4096 NOTREACHED(); |
4095 return false; | 4097 return false; |
4096 } | 4098 } |
4097 | 4099 |
4098 void Browser::CreateInstantIfNecessary() { | 4100 void Browser::CreateInstantIfNecessary() { |
4099 if (type() == TYPE_NORMAL && InstantController::IsEnabled(profile()) && | 4101 if (type() == TYPE_NORMAL && InstantController::IsEnabled(profile()) && |
4100 !profile()->IsOffTheRecord()) { | 4102 !profile()->IsOffTheRecord()) { |
4101 instant_.reset(new InstantController(profile_, this)); | 4103 instant_.reset(new InstantController(profile_, this)); |
4102 } | 4104 } |
4103 } | 4105 } |
OLD | NEW |