| 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/chromeos/frame/browser_view.h" | 5 #include "chrome/browser/chromeos/frame/browser_view.h" | 
| 6 | 6 | 
| 7 #include <algorithm> | 7 #include <algorithm> | 
| 8 #include <string> | 8 #include <string> | 
| 9 #include <vector> | 9 #include <vector> | 
| 10 | 10 | 
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 230   InitSystemMenu(); | 230   InitSystemMenu(); | 
| 231 | 231 | 
| 232   // The ContextMenuController has to be set to a NonClientView but | 232   // The ContextMenuController has to be set to a NonClientView but | 
| 233   // not to a NonClientFrameView because a TabStrip is not a child of | 233   // not to a NonClientFrameView because a TabStrip is not a child of | 
| 234   // a NonClientFrameView even though visually a TabStrip is over a | 234   // a NonClientFrameView even though visually a TabStrip is over a | 
| 235   // NonClientFrameView. | 235   // NonClientFrameView. | 
| 236   BrowserFrameGtk* gtk_frame = static_cast<BrowserFrameGtk*>(frame()); | 236   BrowserFrameGtk* gtk_frame = static_cast<BrowserFrameGtk*>(frame()); | 
| 237   gtk_frame->GetNonClientView()->SetContextMenuController(this); | 237   gtk_frame->GetNonClientView()->SetContextMenuController(this); | 
| 238 | 238 | 
| 239   // Listen to wrench menu opens. | 239   // Listen to wrench menu opens. | 
| 240   toolbar()->AddMenuListener(this); | 240   if (toolbar()) | 
|  | 241     toolbar()->AddMenuListener(this); | 
| 241 | 242 | 
| 242   // Make sure the window is set to the right type. | 243   // Make sure the window is set to the right type. | 
| 243   std::vector<int> params; | 244   std::vector<int> params; | 
| 244   params.push_back(browser()->tab_count()); | 245   params.push_back(browser()->tab_count()); | 
| 245   params.push_back(browser()->selected_index()); | 246   params.push_back(browser()->selected_index()); | 
| 246   params.push_back(gtk_get_current_event_time()); | 247   params.push_back(gtk_get_current_event_time()); | 
| 247   WmIpc::instance()->SetWindowType( | 248   WmIpc::instance()->SetWindowType( | 
| 248       GTK_WIDGET(frame()->GetWindow()->GetNativeWindow()), | 249       GTK_WIDGET(frame()->GetWindow()->GetNativeWindow()), | 
| 249       WM_IPC_WINDOW_CHROME_TOPLEVEL, | 250       WM_IPC_WINDOW_CHROME_TOPLEVEL, | 
| 250       ¶ms); | 251       ¶ms); | 
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 385 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { | 386 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { | 
| 386   // Create a browser view for chromeos. | 387   // Create a browser view for chromeos. | 
| 387   BrowserView* view; | 388   BrowserView* view; | 
| 388   if (browser->type() & Browser::TYPE_POPUP) | 389   if (browser->type() & Browser::TYPE_POPUP) | 
| 389     view = new chromeos::PanelBrowserView(browser); | 390     view = new chromeos::PanelBrowserView(browser); | 
| 390   else | 391   else | 
| 391     view = new chromeos::BrowserView(browser); | 392     view = new chromeos::BrowserView(browser); | 
| 392   BrowserFrame::Create(view, browser->profile()); | 393   BrowserFrame::Create(view, browser->profile()); | 
| 393   return view; | 394   return view; | 
| 394 } | 395 } | 
| OLD | NEW | 
|---|