| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 |
| 11 | 11 |
| 12 #include <algorithm> | 12 #include <algorithm> |
| 13 #include <string> | 13 #include <string> |
| 14 | 14 |
| 15 #include "base/base_paths.h" | 15 #include "base/base_paths.h" |
| 16 #include "base/command_line.h" | 16 #include "base/command_line.h" |
| 17 #include "base/logging.h" | 17 #include "base/logging.h" |
| 18 #include "base/metrics/histogram.h" | 18 #include "base/metrics/histogram.h" |
| 19 #include "base/path_service.h" | 19 #include "base/path_service.h" |
| 20 #include "base/string_number_conversions.h" |
| 20 #include "base/string_util.h" | 21 #include "base/string_util.h" |
| 21 #include "base/string_number_conversions.h" | |
| 22 #include "base/threading/thread.h" | 22 #include "base/threading/thread.h" |
| 23 #include "base/threading/thread_restrictions.h" | 23 #include "base/threading/thread_restrictions.h" |
| 24 #include "base/time.h" | 24 #include "base/time.h" |
| 25 #include "base/utf_string_conversions.h" | 25 #include "base/utf_string_conversions.h" |
| 26 #include "chrome/app/chrome_command_ids.h" | 26 #include "chrome/app/chrome_command_ids.h" |
| 27 #include "chrome/browser/autofill/autofill_manager.h" | 27 #include "chrome/browser/autofill/autofill_manager.h" |
| 28 #include "chrome/browser/background/background_contents_service.h" | 28 #include "chrome/browser/background/background_contents_service.h" |
| 29 #include "chrome/browser/bookmarks/bookmark_model.h" | 29 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 30 #include "chrome/browser/bookmarks/bookmark_utils.h" | 30 #include "chrome/browser/bookmarks/bookmark_utils.h" |
| 31 #include "chrome/browser/browser_process.h" | 31 #include "chrome/browser/browser_process.h" |
| (...skipping 3228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3260 } | 3260 } |
| 3261 | 3261 |
| 3262 void Browser::ContentsMouseEvent( | 3262 void Browser::ContentsMouseEvent( |
| 3263 TabContents* source, const gfx::Point& location, bool motion) { | 3263 TabContents* source, const gfx::Point& location, bool motion) { |
| 3264 if (!GetStatusBubble()) | 3264 if (!GetStatusBubble()) |
| 3265 return; | 3265 return; |
| 3266 | 3266 |
| 3267 if (source == GetSelectedTabContents()) { | 3267 if (source == GetSelectedTabContents()) { |
| 3268 GetStatusBubble()->MouseMoved(location, !motion); | 3268 GetStatusBubble()->MouseMoved(location, !motion); |
| 3269 if (!motion) | 3269 if (!motion) |
| 3270 GetStatusBubble()->SetURL(GURL(), string16()); | 3270 GetStatusBubble()->SetURL(GURL(), std::string()); |
| 3271 } | 3271 } |
| 3272 } | 3272 } |
| 3273 | 3273 |
| 3274 void Browser::UpdateTargetURL(TabContents* source, const GURL& url) { | 3274 void Browser::UpdateTargetURL(TabContents* source, const GURL& url) { |
| 3275 if (!GetStatusBubble()) | 3275 if (!GetStatusBubble()) |
| 3276 return; | 3276 return; |
| 3277 | 3277 |
| 3278 if (source == GetSelectedTabContents()) { | 3278 if (source == GetSelectedTabContents()) { |
| 3279 PrefService* prefs = profile_->GetPrefs(); | 3279 PrefService* prefs = profile_->GetPrefs(); |
| 3280 GetStatusBubble()->SetURL( | 3280 GetStatusBubble()->SetURL(url, prefs->GetString(prefs::kAcceptLanguages)); |
| 3281 url, UTF8ToUTF16(prefs->GetString(prefs::kAcceptLanguages))); | |
| 3282 } | 3281 } |
| 3283 } | 3282 } |
| 3284 | 3283 |
| 3285 void Browser::UpdateDownloadShelfVisibility(bool visible) { | 3284 void Browser::UpdateDownloadShelfVisibility(bool visible) { |
| 3286 if (GetStatusBubble()) | 3285 if (GetStatusBubble()) |
| 3287 GetStatusBubble()->UpdateDownloadShelfVisibility(visible); | 3286 GetStatusBubble()->UpdateDownloadShelfVisibility(visible); |
| 3288 } | 3287 } |
| 3289 | 3288 |
| 3290 bool Browser::UseVerticalTabs() const { | 3289 bool Browser::UseVerticalTabs() const { |
| 3291 return use_vertical_tabs_.GetValue(); | 3290 return use_vertical_tabs_.GetValue(); |
| (...skipping 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4875 } | 4874 } |
| 4876 | 4875 |
| 4877 void Browser::ShowSyncSetup() { | 4876 void Browser::ShowSyncSetup() { |
| 4878 ProfileSyncService* service = | 4877 ProfileSyncService* service = |
| 4879 profile()->GetOriginalProfile()->GetProfileSyncService(); | 4878 profile()->GetOriginalProfile()->GetProfileSyncService(); |
| 4880 if (service->HasSyncSetupCompleted()) | 4879 if (service->HasSyncSetupCompleted()) |
| 4881 ShowOptionsTab(chrome::kSyncSetupSubPage); | 4880 ShowOptionsTab(chrome::kSyncSetupSubPage); |
| 4882 else | 4881 else |
| 4883 service->ShowLoginDialog(); | 4882 service->ShowLoginDialog(); |
| 4884 } | 4883 } |
| OLD | NEW |