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

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

Issue 298813002: views: Move MenuButton from TextButton to LabelButton. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Disable DragDirectlyToSecondWindow. Created 6 years, 6 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/libgtk2ui/gtk2_ui.h" 5 #include "chrome/browser/ui/libgtk2ui/gtk2_ui.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/leak_annotations.h" 10 #include "base/debug/leak_annotations.h"
(...skipping 27 matching lines...) Expand all
38 #include "third_party/skia/include/core/SkColor.h" 38 #include "third_party/skia/include/core/SkColor.h"
39 #include "third_party/skia/include/core/SkShader.h" 39 #include "third_party/skia/include/core/SkShader.h"
40 #include "ui/base/resource/resource_bundle.h" 40 #include "ui/base/resource/resource_bundle.h"
41 #include "ui/gfx/canvas.h" 41 #include "ui/gfx/canvas.h"
42 #include "ui/gfx/image/image.h" 42 #include "ui/gfx/image/image.h"
43 #include "ui/gfx/rect.h" 43 #include "ui/gfx/rect.h"
44 #include "ui/gfx/size.h" 44 #include "ui/gfx/size.h"
45 #include "ui/gfx/skbitmap_operations.h" 45 #include "ui/gfx/skbitmap_operations.h"
46 #include "ui/gfx/skia_util.h" 46 #include "ui/gfx/skia_util.h"
47 #include "ui/views/controls/button/label_button.h" 47 #include "ui/views/controls/button/label_button.h"
48 #include "ui/views/controls/button/label_button_border.h"
48 #include "ui/views/linux_ui/window_button_order_observer.h" 49 #include "ui/views/linux_ui/window_button_order_observer.h"
49 50
50 #if defined(USE_GCONF) 51 #if defined(USE_GCONF)
51 #include "chrome/browser/ui/libgtk2ui/gconf_listener.h" 52 #include "chrome/browser/ui/libgtk2ui/gconf_listener.h"
52 #endif 53 #endif
53 54
54 // A minimized port of GtkThemeService into something that can provide colors 55 // A minimized port of GtkThemeService into something that can provide colors
55 // and images for aura. 56 // and images for aura.
56 // 57 //
57 // TODO(erg): There's still a lot that needs ported or done for the first time: 58 // TODO(erg): There's still a lot that needs ported or done for the first time:
(...skipping 492 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 DCHECK_EQ(size, bitmap.height()); 551 DCHECK_EQ(size, bitmap.height());
551 gfx::ImageSkia image_skia = gfx::ImageSkia::CreateFrom1xBitmap(bitmap); 552 gfx::ImageSkia image_skia = gfx::ImageSkia::CreateFrom1xBitmap(bitmap);
552 image_skia.MakeThreadSafe(); 553 image_skia.MakeThreadSafe();
553 return gfx::Image(image_skia); 554 return gfx::Image(image_skia);
554 } 555 }
555 return gfx::Image(); 556 return gfx::Image();
556 } 557 }
557 558
558 scoped_ptr<views::Border> Gtk2UI::CreateNativeBorder( 559 scoped_ptr<views::Border> Gtk2UI::CreateNativeBorder(
559 views::LabelButton* owning_button, 560 views::LabelButton* owning_button,
560 scoped_ptr<views::Border> border) { 561 scoped_ptr<views::LabelButtonBorder> border) {
561 if (owning_button->GetNativeTheme() != NativeThemeGtk2::instance()) 562 if (owning_button->GetNativeTheme() != NativeThemeGtk2::instance())
562 return border.Pass(); 563 return border.PassAs<views::Border>();
563 564
564 return scoped_ptr<views::Border>( 565 return scoped_ptr<views::Border>(
565 new Gtk2Border(this, owning_button, border.Pass())); 566 new Gtk2Border(this, owning_button, border.Pass()));
566 } 567 }
567 568
568 void Gtk2UI::AddWindowButtonOrderObserver( 569 void Gtk2UI::AddWindowButtonOrderObserver(
569 views::WindowButtonOrderObserver* observer) { 570 views::WindowButtonOrderObserver* observer) {
570 if (!leading_buttons_.empty() || !trailing_buttons_.empty()) { 571 if (!leading_buttons_.empty() || !trailing_buttons_.empty()) {
571 observer->OnWindowButtonOrderingChange(leading_buttons_, 572 observer->OnWindowButtonOrderingChange(leading_buttons_,
572 trailing_buttons_); 573 trailing_buttons_);
(...skipping 794 matching lines...) Expand 10 before | Expand all | Expand 10 after
1367 ClearAllThemeData(); 1368 ClearAllThemeData();
1368 LoadGtkValues(); 1369 LoadGtkValues();
1369 NativeThemeGtk2::instance()->NotifyObservers(); 1370 NativeThemeGtk2::instance()->NotifyObservers();
1370 } 1371 }
1371 1372
1372 } // namespace libgtk2ui 1373 } // namespace libgtk2ui
1373 1374
1374 views::LinuxUI* BuildGtk2UI() { 1375 views::LinuxUI* BuildGtk2UI() {
1375 return new libgtk2ui::Gtk2UI; 1376 return new libgtk2ui::Gtk2UI;
1376 } 1377 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/libgtk2ui/gtk2_ui.h ('k') | chrome/browser/ui/views/autofill/autofill_dialog_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698