| 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 |
| (...skipping 2938 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2949 // We want to handle firing the unload event ourselves since we want to | 2949 // We want to handle firing the unload event ourselves since we want to |
| 2950 // fire all the beforeunload events before attempting to fire the unload | 2950 // fire all the beforeunload events before attempting to fire the unload |
| 2951 // events should the user cancel closing the browser. | 2951 // events should the user cancel closing the browser. |
| 2952 *proceed_to_fire_unload = false; | 2952 *proceed_to_fire_unload = false; |
| 2953 return; | 2953 return; |
| 2954 } | 2954 } |
| 2955 | 2955 |
| 2956 *proceed_to_fire_unload = true; | 2956 *proceed_to_fire_unload = true; |
| 2957 } | 2957 } |
| 2958 | 2958 |
| 2959 gfx::Rect Browser::GetRootWindowResizerRect() const { | |
| 2960 return window_->GetRootWindowResizerRect(); | |
| 2961 } | |
| 2962 | |
| 2963 void Browser::ShowHtmlDialog(HtmlDialogUIDelegate* delegate, | 2959 void Browser::ShowHtmlDialog(HtmlDialogUIDelegate* delegate, |
| 2964 gfx::NativeWindow parent_window) { | 2960 gfx::NativeWindow parent_window) { |
| 2965 window_->ShowHTMLDialog(delegate, parent_window); | 2961 window_->ShowHTMLDialog(delegate, parent_window); |
| 2966 } | 2962 } |
| 2967 | 2963 |
| 2968 void Browser::SetFocusToLocationBar(bool select_all) { | 2964 void Browser::SetFocusToLocationBar(bool select_all) { |
| 2969 // Two differences between this and FocusLocationBar(): | 2965 // Two differences between this and FocusLocationBar(): |
| 2970 // (1) This doesn't get recorded in user metrics, since it's called | 2966 // (1) This doesn't get recorded in user metrics, since it's called |
| 2971 // internally. | 2967 // internally. |
| 2972 // (2) This checks whether the location bar can be focused, and if not, clears | 2968 // (2) This checks whether the location bar can be focused, and if not, clears |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3059 | 3055 |
| 3060 void Browser::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { | 3056 void Browser::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) { |
| 3061 window()->HandleKeyboardEvent(event); | 3057 window()->HandleKeyboardEvent(event); |
| 3062 } | 3058 } |
| 3063 | 3059 |
| 3064 void Browser::ShowRepostFormWarningDialog(TabContents *tab_contents) { | 3060 void Browser::ShowRepostFormWarningDialog(TabContents *tab_contents) { |
| 3065 window()->ShowRepostFormWarningDialog(tab_contents); | 3061 window()->ShowRepostFormWarningDialog(tab_contents); |
| 3066 } | 3062 } |
| 3067 | 3063 |
| 3068 void Browser::ShowContentSettingsWindow(ContentSettingsType content_type) { | 3064 void Browser::ShowContentSettingsWindow(ContentSettingsType content_type) { |
| 3069 | |
| 3070 if (CommandLine::ForCurrentProcess()->HasSwitch( | 3065 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 3071 switches::kEnableTabbedOptions)) { | 3066 switches::kEnableTabbedOptions)) { |
| 3072 ShowOptionsTab( | 3067 ShowOptionsTab( |
| 3073 chrome::kContentSettingsSubPage + kHashMark + | 3068 chrome::kContentSettingsSubPage + kHashMark + |
| 3074 ContentSettingsHandler::ContentSettingsTypeToGroupName(content_type)); | 3069 ContentSettingsHandler::ContentSettingsTypeToGroupName(content_type)); |
| 3075 } else { | 3070 } else { |
| 3076 window()->ShowContentSettingsWindow(content_type, | 3071 window()->ShowContentSettingsWindow(content_type, |
| 3077 profile_->GetOriginalProfile()); | 3072 profile_->GetOriginalProfile()); |
| 3078 } | 3073 } |
| 3079 } | 3074 } |
| (...skipping 984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4064 NOTREACHED(); | 4059 NOTREACHED(); |
| 4065 return false; | 4060 return false; |
| 4066 } | 4061 } |
| 4067 | 4062 |
| 4068 void Browser::CreateInstantIfNecessary() { | 4063 void Browser::CreateInstantIfNecessary() { |
| 4069 if (type() == TYPE_NORMAL && InstantController::IsEnabled(profile()) && | 4064 if (type() == TYPE_NORMAL && InstantController::IsEnabled(profile()) && |
| 4070 !profile()->IsOffTheRecord()) { | 4065 !profile()->IsOffTheRecord()) { |
| 4071 instant_.reset(new InstantController(profile_, this)); | 4066 instant_.reset(new InstantController(profile_, this)); |
| 4072 } | 4067 } |
| 4073 } | 4068 } |
| OLD | NEW |