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

Side by Side Diff: chrome/browser/ui/views/notifications/balloon_view_views.cc

Issue 12096084: Cleanup BubbleFrameView and BubbleBorder construction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Additional refactoring and cleanup. Created 7 years, 10 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/views/notifications/balloon_view_views.h" 5 #include "chrome/browser/ui/views/notifications/balloon_view_views.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 html_contents_(NULL), 98 html_contents_(NULL),
99 close_button_(NULL), 99 close_button_(NULL),
100 animation_(NULL), 100 animation_(NULL),
101 options_menu_model_(NULL), 101 options_menu_model_(NULL),
102 options_menu_button_(NULL), 102 options_menu_button_(NULL),
103 enable_web_ui_(false), 103 enable_web_ui_(false),
104 closed_by_user_(false) { 104 closed_by_user_(false) {
105 // We're owned by Balloon and don't want to be deleted by our parent View. 105 // We're owned by Balloon and don't want to be deleted by our parent View.
106 set_owned_by_client(); 106 set_owned_by_client();
107 107
108 views::BubbleBorder* bubble_border = 108 set_border(new views::BubbleBorder(views::BubbleBorder::FLOAT,
109 new views::BubbleBorder(views::BubbleBorder::FLOAT, 109 views::BubbleBorder::NO_SHADOW, SK_ColorWHITE));
110 views::BubbleBorder::NO_SHADOW);
111 set_border(bubble_border);
112 } 110 }
113 111
114 BalloonViewImpl::~BalloonViewImpl() { 112 BalloonViewImpl::~BalloonViewImpl() {
115 } 113 }
116 114
117 void BalloonViewImpl::Close(bool by_user) { 115 void BalloonViewImpl::Close(bool by_user) {
118 animation_->Stop(); 116 animation_->Stop();
119 html_contents_->Shutdown(); 117 html_contents_->Shutdown();
120 // Detach contents from the widget before they close. 118 // Detach contents from the widget before they close.
121 // This is necessary because a widget may be deleted 119 // This is necessary because a widget may be deleted
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
530 return; 528 return;
531 } 529 }
532 530
533 // If the renderer process attached to this balloon is disconnected 531 // If the renderer process attached to this balloon is disconnected
534 // (e.g., because of a crash), we want to close the balloon. 532 // (e.g., because of a crash), we want to close the balloon.
535 notification_registrar_.Remove( 533 notification_registrar_.Remove(
536 this, chrome::NOTIFICATION_NOTIFY_BALLOON_DISCONNECTED, 534 this, chrome::NOTIFICATION_NOTIFY_BALLOON_DISCONNECTED,
537 content::Source<Balloon>(balloon_)); 535 content::Source<Balloon>(balloon_));
538 Close(false); 536 Close(false);
539 } 537 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698