| 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 <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "chrome/app/chrome_command_ids.h" | 13 #include "chrome/app/chrome_command_ids.h" |
| 14 #include "chrome/browser/chromeos/frame/layout_mode_button.h" | 14 #include "chrome/browser/chromeos/frame/layout_mode_button.h" |
| 15 #include "chrome/browser/chromeos/frame/panel_browser_view.h" | 15 #include "chrome/browser/chromeos/frame/panel_browser_view.h" |
| 16 #include "chrome/browser/chromeos/status/input_method_menu_button.h" | 16 #include "chrome/browser/chromeos/status/input_method_menu_button.h" |
| 17 #include "chrome/browser/chromeos/status/network_menu_button.h" | 17 #include "chrome/browser/chromeos/status/network_menu_button.h" |
| 18 #include "chrome/browser/chromeos/status/status_area_button.h" | 18 #include "chrome/browser/chromeos/status/status_area_button.h" |
| 19 #include "chrome/browser/chromeos/status/status_area_view_chromeos.h" | 19 #include "chrome/browser/chromeos/status/status_area_view_chromeos.h" |
| 20 #include "chrome/browser/chromeos/system/runtime_environment.h" | 20 #include "chrome/browser/chromeos/system/runtime_environment.h" |
| 21 #include "chrome/browser/chromeos/view_ids.h" | |
| 22 #include "chrome/browser/themes/theme_service.h" | 21 #include "chrome/browser/themes/theme_service.h" |
| 23 #include "chrome/browser/themes/theme_service_factory.h" | 22 #include "chrome/browser/themes/theme_service_factory.h" |
| 24 #include "chrome/browser/ui/gtk/gtk_util.h" | 23 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 25 #include "chrome/browser/ui/views/frame/browser_view.h" | 24 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 26 #include "chrome/browser/ui/views/frame/browser_view_layout.h" | 25 #include "chrome/browser/ui/views/frame/browser_view_layout.h" |
| 27 #include "chrome/browser/ui/views/tabs/tab.h" | 26 #include "chrome/browser/ui/views/tabs/tab.h" |
| 28 #include "chrome/browser/ui/views/tabs/tab_strip.h" | 27 #include "chrome/browser/ui/views/tabs/tab_strip.h" |
| 29 #include "chrome/browser/ui/views/theme_background.h" | 28 #include "chrome/browser/ui/views/theme_background.h" |
| 30 #include "chrome/browser/ui/views/toolbar_view.h" | 29 #include "chrome/browser/ui/views/toolbar_view.h" |
| 31 #include "chrome/common/chrome_switches.h" | 30 #include "chrome/common/chrome_switches.h" |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 348 return static_cast<chromeos::BrowserView*>( | 347 return static_cast<chromeos::BrowserView*>( |
| 349 ::BrowserView::GetBrowserViewForBrowser(browser)); | 348 ::BrowserView::GetBrowserViewForBrowser(browser)); |
| 350 } | 349 } |
| 351 | 350 |
| 352 // BrowserView, ::BrowserView overrides: | 351 // BrowserView, ::BrowserView overrides: |
| 353 | 352 |
| 354 void BrowserView::Init() { | 353 void BrowserView::Init() { |
| 355 ::BrowserView::Init(); | 354 ::BrowserView::Init(); |
| 356 status_area_ = new StatusAreaViewChromeos(); | 355 status_area_ = new StatusAreaViewChromeos(); |
| 357 status_area_->Init(this, StatusAreaViewChromeos::BROWSER_MODE); | 356 status_area_->Init(this, StatusAreaViewChromeos::BROWSER_MODE); |
| 358 status_area_->set_id(VIEW_ID_STATUS_AREA); | |
| 359 AddChildView(status_area_); | 357 AddChildView(status_area_); |
| 360 | 358 |
| 361 layout_mode_button_ = new LayoutModeButton(); | 359 layout_mode_button_ = new LayoutModeButton(); |
| 362 layout_mode_button_->set_id(VIEW_ID_LAYOUT_MODE_BUTTON); | |
| 363 AddChildView(layout_mode_button_); | 360 AddChildView(layout_mode_button_); |
| 364 layout_mode_button_->Init(); | 361 layout_mode_button_->Init(); |
| 365 | 362 |
| 366 frame()->non_client_view()->set_context_menu_controller(this); | 363 frame()->non_client_view()->set_context_menu_controller(this); |
| 367 | 364 |
| 368 // Listen to wrench menu opens. | 365 // Listen to wrench menu opens. |
| 369 if (toolbar()) | 366 if (toolbar()) |
| 370 toolbar()->AddMenuListener(this); | 367 toolbar()->AddMenuListener(this); |
| 371 | 368 |
| 372 // Listen for PropertyChange events (which we receive in DidProcessEvent()). | 369 // Listen for PropertyChange events (which we receive in DidProcessEvent()). |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { | 657 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { |
| 661 // Create a browser view for chromeos. | 658 // Create a browser view for chromeos. |
| 662 BrowserView* view; | 659 BrowserView* view; |
| 663 if (browser->is_type_popup() || browser->is_type_panel()) | 660 if (browser->is_type_popup() || browser->is_type_panel()) |
| 664 view = new chromeos::PanelBrowserView(browser); | 661 view = new chromeos::PanelBrowserView(browser); |
| 665 else | 662 else |
| 666 view = new chromeos::BrowserView(browser); | 663 view = new chromeos::BrowserView(browser); |
| 667 (new BrowserFrame(view))->InitBrowserFrame(); | 664 (new BrowserFrame(view))->InitBrowserFrame(); |
| 668 return view; | 665 return view; |
| 669 } | 666 } |
| OLD | NEW |