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

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

Issue 8892011: Clean up TCW, make it solely a hub for 1:1 observer/helper objects. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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/gtk/browser_window_gtk.h" 5 #include "chrome/browser/ui/gtk/browser_window_gtk.h"
6 6
7 #include <gdk/gdkkeysyms.h> 7 #include <gdk/gdkkeysyms.h>
8 8
9 #include <dlfcn.h> 9 #include <dlfcn.h>
10 #include <string> 10 #include <string>
(...skipping 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after
1247 UpdateDevToolsForContents(NULL); 1247 UpdateDevToolsForContents(NULL);
1248 } 1248 }
1249 contents_container_->DetachTab(contents); 1249 contents_container_->DetachTab(contents);
1250 } 1250 }
1251 1251
1252 void BrowserWindowGtk::ActiveTabChanged(TabContentsWrapper* old_contents, 1252 void BrowserWindowGtk::ActiveTabChanged(TabContentsWrapper* old_contents,
1253 TabContentsWrapper* new_contents, 1253 TabContentsWrapper* new_contents,
1254 int index, 1254 int index,
1255 bool user_gesture) { 1255 bool user_gesture) {
1256 if (old_contents && !old_contents->tab_contents()->is_being_destroyed()) 1256 if (old_contents && !old_contents->tab_contents()->is_being_destroyed())
1257 old_contents->view()->StoreFocus(); 1257 old_contents->tab_contents()->view()->StoreFocus();
1258 1258
1259 // Update various elements that are interested in knowing the current 1259 // Update various elements that are interested in knowing the current
1260 // TabContents. 1260 // TabContents.
1261 infobar_container_->ChangeTabContents(new_contents->infobar_tab_helper()); 1261 infobar_container_->ChangeTabContents(new_contents->infobar_tab_helper());
1262 contents_container_->SetTab(new_contents); 1262 contents_container_->SetTab(new_contents);
1263 UpdateDevToolsForContents(new_contents->tab_contents()); 1263 UpdateDevToolsForContents(new_contents->tab_contents());
1264 1264
1265 new_contents->tab_contents()->DidBecomeSelected(); 1265 new_contents->tab_contents()->DidBecomeSelected();
1266 // TODO(estade): after we manage browser activation, add a check to make sure 1266 // TODO(estade): after we manage browser activation, add a check to make sure
1267 // we are the active browser before calling RestoreFocus(). 1267 // we are the active browser before calling RestoreFocus().
1268 if (!browser_->tabstrip_model()->closing_all()) { 1268 if (!browser_->tabstrip_model()->closing_all()) {
1269 new_contents->view()->RestoreFocus(); 1269 new_contents->tab_contents()->view()->RestoreFocus();
1270 if (new_contents->find_tab_helper()->find_ui_active()) 1270 if (new_contents->find_tab_helper()->find_ui_active())
1271 browser_->GetFindBarController()->find_bar()->SetFocusAndSelection(); 1271 browser_->GetFindBarController()->find_bar()->SetFocusAndSelection();
1272 } 1272 }
1273 1273
1274 // Update all the UI bits. 1274 // Update all the UI bits.
1275 UpdateTitleBar(); 1275 UpdateTitleBar();
1276 MaybeShowBookmarkBar(false); 1276 MaybeShowBookmarkBar(false);
1277 } 1277 }
1278 1278
1279 void BrowserWindowGtk::ActiveWindowChanged(GdkWindow* active_window) { 1279 void BrowserWindowGtk::ActiveWindowChanged(GdkWindow* active_window) {
(...skipping 1149 matching lines...) Expand 10 before | Expand all | Expand 10 after
2429 wm_type == ui::WM_OPENBOX || 2429 wm_type == ui::WM_OPENBOX ||
2430 wm_type == ui::WM_XFWM4); 2430 wm_type == ui::WM_XFWM4);
2431 } 2431 }
2432 2432
2433 // static 2433 // static
2434 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { 2434 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) {
2435 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser); 2435 BrowserWindowGtk* browser_window_gtk = new BrowserWindowGtk(browser);
2436 browser_window_gtk->Init(); 2436 browser_window_gtk->Init();
2437 return browser_window_gtk; 2437 return browser_window_gtk;
2438 } 2438 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/fullscreen_controller.cc ('k') | chrome/browser/ui/gtk/constrained_window_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698