Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Side by Side Diff: chrome/browser/ui/browser.cc

Issue 7880003: content: Move constrained window code from TabContents to TabContentsWrapper (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix mac regression now that shutdown timing was changed for views. Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
(...skipping 3489 matching lines...) Expand 10 before | Expand all | Expand 10 after
3500 } 3500 }
3501 3501
3502 bool Browser::UseVerticalTabs() const { 3502 bool Browser::UseVerticalTabs() const {
3503 return use_vertical_tabs_.GetValue(); 3503 return use_vertical_tabs_.GetValue();
3504 } 3504 }
3505 3505
3506 void Browser::ContentsZoomChange(bool zoom_in) { 3506 void Browser::ContentsZoomChange(bool zoom_in) {
3507 ExecuteCommand(zoom_in ? IDC_ZOOM_PLUS : IDC_ZOOM_MINUS); 3507 ExecuteCommand(zoom_in ? IDC_ZOOM_PLUS : IDC_ZOOM_MINUS);
3508 } 3508 }
3509 3509
3510 void Browser::SetTabContentBlocked(TabContents* contents, bool blocked) {
3511 int index = tabstrip_model()->GetWrapperIndex(contents);
3512 if (index == TabStripModel::kNoTab) {
3513 NOTREACHED();
3514 return;
3515 }
3516 tabstrip_model()->SetTabBlocked(index, blocked);
3517 }
3518
3519 void Browser::TabContentsFocused(TabContents* tab_content) { 3510 void Browser::TabContentsFocused(TabContents* tab_content) {
3520 window_->TabContentsFocused(tab_content); 3511 window_->TabContentsFocused(tab_content);
3521 } 3512 }
3522 3513
3523 bool Browser::TakeFocus(bool reverse) { 3514 bool Browser::TakeFocus(bool reverse) {
3524 NotificationService::current()->Notify( 3515 NotificationService::current()->Notify(
3525 chrome::NOTIFICATION_FOCUS_RETURNED_TO_BROWSER, 3516 chrome::NOTIFICATION_FOCUS_RETURNED_TO_BROWSER,
3526 Source<Browser>(this), 3517 Source<Browser>(this),
3527 NotificationService::NoDetails()); 3518 NotificationService::NoDetails());
3528 return false; 3519 return false;
(...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after
4150 4141
4151 void Browser::SwapTabContents(TabContentsWrapper* old_tab_contents, 4142 void Browser::SwapTabContents(TabContentsWrapper* old_tab_contents,
4152 TabContentsWrapper* new_tab_contents) { 4143 TabContentsWrapper* new_tab_contents) {
4153 int index = 4144 int index =
4154 tab_handler_->GetTabStripModel()->GetIndexOfTabContents(old_tab_contents); 4145 tab_handler_->GetTabStripModel()->GetIndexOfTabContents(old_tab_contents);
4155 DCHECK_NE(TabStripModel::kNoTab, index); 4146 DCHECK_NE(TabStripModel::kNoTab, index);
4156 tab_handler_->GetTabStripModel()->ReplaceTabContentsAt(index, 4147 tab_handler_->GetTabStripModel()->ReplaceTabContentsAt(index,
4157 new_tab_contents); 4148 new_tab_contents);
4158 } 4149 }
4159 4150
4151 void Browser::SetTabContentBlocked(TabContentsWrapper* wrapper, bool blocked) {
4152 int index = tabstrip_model()->GetIndexOfTabContents(wrapper);
4153 if (index == TabStripModel::kNoTab) {
4154 NOTREACHED();
4155 return;
4156 }
4157 tabstrip_model()->SetTabBlocked(index, blocked);
4158 }
4159
4160 void Browser::SetSuggestedText(const string16& text, 4160 void Browser::SetSuggestedText(const string16& text,
4161 InstantCompleteBehavior behavior) { 4161 InstantCompleteBehavior behavior) {
4162 if (window()->GetLocationBar()) 4162 if (window()->GetLocationBar())
4163 window()->GetLocationBar()->SetSuggestedText(text, behavior); 4163 window()->GetLocationBar()->SetSuggestedText(text, behavior);
4164 } 4164 }
4165 4165
4166 gfx::Rect Browser::GetInstantBounds() { 4166 gfx::Rect Browser::GetInstantBounds() {
4167 return window()->GetInstantBounds(); 4167 return window()->GetInstantBounds();
4168 } 4168 }
4169 4169
(...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after
5240 } else if (is_type_tabbed()) { 5240 } else if (is_type_tabbed()) {
5241 GlobalErrorService* service = 5241 GlobalErrorService* service =
5242 GlobalErrorServiceFactory::GetForProfile(profile()); 5242 GlobalErrorServiceFactory::GetForProfile(profile());
5243 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); 5243 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView();
5244 if (error) { 5244 if (error) {
5245 error->ShowBubbleView(this); 5245 error->ShowBubbleView(this);
5246 did_show_bubble = true; 5246 did_show_bubble = true;
5247 } 5247 }
5248 } 5248 }
5249 } 5249 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698