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

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

Issue 10260028: Update Panel mininimize/restore button on strip and expansion state change. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: feedback changes Created 8 years, 7 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/panels/panel_browser_window_gtk.h" 5 #include "chrome/browser/ui/panels/panel_browser_window_gtk.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "chrome/browser/ui/browser_list.h" 8 #include "chrome/browser/ui/browser_list.h"
9 #include "chrome/browser/ui/gtk/browser_titlebar.h" 9 #include "chrome/browser/ui/gtk/browser_titlebar.h"
10 #include "chrome/browser/ui/gtk/custom_button.h" 10 #include "chrome/browser/ui/gtk/custom_button.h"
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
267 IDR_THEME_FRAME : IDR_THEME_FRAME_INACTIVE); 267 IDR_THEME_FRAME : IDR_THEME_FRAME_INACTIVE);
268 } 268 }
269 269
270 return theme_provider->GetImageNamed(paint_state == PAINT_AS_ACTIVE ? 270 return theme_provider->GetImageNamed(paint_state == PAINT_AS_ACTIVE ?
271 IDR_THEME_TOOLBAR : IDR_THEME_TAB_BACKGROUND); 271 IDR_THEME_TOOLBAR : IDR_THEME_TAB_BACKGROUND);
272 } 272 }
273 273
274 void PanelBrowserWindowGtk::DrawCustomFrame(cairo_t* cr, 274 void PanelBrowserWindowGtk::DrawCustomFrame(cairo_t* cr,
275 GtkWidget* widget, 275 GtkWidget* widget,
276 GdkEventExpose* event) { 276 GdkEventExpose* event) {
277 GetPanelTitlebar()->UpdateMinimizeRestoreButtonVisibility();
278
279 gfx::CairoCachedSurface* surface = GetThemeFrameImage()->ToCairo(); 277 gfx::CairoCachedSurface* surface = GetThemeFrameImage()->ToCairo();
280 278
281 surface->SetSource(cr, widget, 0, 0); 279 surface->SetSource(cr, widget, 0, 0);
282 cairo_pattern_set_extend(cairo_get_source(cr), CAIRO_EXTEND_REPEAT); 280 cairo_pattern_set_extend(cairo_get_source(cr), CAIRO_EXTEND_REPEAT);
283 cairo_rectangle(cr, event->area.x, event->area.y, 281 cairo_rectangle(cr, event->area.x, event->area.y,
284 event->area.width, event->area.height); 282 event->area.width, event->area.height);
285 cairo_fill(cr); 283 cairo_fill(cr);
286 } 284 }
287 285
288 void PanelBrowserWindowGtk::ActiveWindowChanged(GdkWindow* active_window) { 286 void PanelBrowserWindowGtk::ActiveWindowChanged(GdkWindow* active_window) {
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 } 462 }
465 463
466 void PanelBrowserWindowGtk::DestroyPanelBrowser() { 464 void PanelBrowserWindowGtk::DestroyPanelBrowser() {
467 DestroyBrowser(); 465 DestroyBrowser();
468 } 466 }
469 467
470 void PanelBrowserWindowGtk::EnsurePanelFullyVisible() { 468 void PanelBrowserWindowGtk::EnsurePanelFullyVisible() {
471 gtk_window_present(window()); 469 gtk_window_present(window());
472 } 470 }
473 471
474 void PanelBrowserWindowGtk::SetPanelAppIconVisibility(bool visible) {
475 return;
476 }
477
478 void PanelBrowserWindowGtk::SetPanelAlwaysOnTop(bool on_top) { 472 void PanelBrowserWindowGtk::SetPanelAlwaysOnTop(bool on_top) {
479 gtk_window_set_keep_above(window(), on_top); 473 gtk_window_set_keep_above(window(), on_top);
480 } 474 }
481 475
482 void PanelBrowserWindowGtk::EnableResizeByMouse(bool enable) { 476 void PanelBrowserWindowGtk::EnableResizeByMouse(bool enable) {
483 } 477 }
484 478
479 void PanelBrowserWindowGtk::UpdatePanelMinimizeRestoreButtonVisibility() {
480 GetPanelTitlebar()->UpdateMinimizeRestoreButtonVisibility();
481 }
482
485 gfx::Size PanelBrowserWindowGtk::WindowSizeFromContentSize( 483 gfx::Size PanelBrowserWindowGtk::WindowSizeFromContentSize(
486 const gfx::Size& content_size) const { 484 const gfx::Size& content_size) const {
487 return gfx::Size(content_size.width() + frame_size_.width(), 485 return gfx::Size(content_size.width() + frame_size_.width(),
488 content_size.height() + frame_size_.height()); 486 content_size.height() + frame_size_.height());
489 } 487 }
490 488
491 gfx::Size PanelBrowserWindowGtk::ContentSizeFromWindowSize( 489 gfx::Size PanelBrowserWindowGtk::ContentSizeFromWindowSize(
492 const gfx::Size& window_size) const { 490 const gfx::Size& window_size) const {
493 return gfx::Size(window_size.width() - frame_size_.width(), 491 return gfx::Size(window_size.width() - frame_size_.width(),
494 window_size.height() - frame_size_.height()); 492 window_size.height() - frame_size_.height());
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
680 break; 678 break;
681 case RESTORE_BUTTON: 679 case RESTORE_BUTTON:
682 button = titlebar->unminimize_button(); 680 button = titlebar->unminimize_button();
683 break; 681 break;
684 default: 682 default:
685 NOTREACHED(); 683 NOTREACHED();
686 return false; 684 return false;
687 } 685 }
688 return gtk_widget_get_visible(button->widget()); 686 return gtk_widget_get_visible(button->widget());
689 } 687 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/panels/panel_browser_window_gtk.h ('k') | chrome/browser/ui/panels/panel_window_controller_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698