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

Side by Side Diff: chrome/browser/ui/views/translate/translate_bubble_view.cc

Issue 2802703004: Log creation for many dialog box types. (Closed)
Patch Set: qualify RecordDialogCreation with chrome:: Created 3 years, 8 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/translate/translate_bubble_view.h" 5 #include "chrome/browser/ui/views/translate/translate_bubble_view.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 advanced_done_button_(NULL), 356 advanced_done_button_(NULL),
357 denial_menu_button_(NULL), 357 denial_menu_button_(NULL),
358 model_(std::move(model)), 358 model_(std::move(model)),
359 error_type_(error_type), 359 error_type_(error_type),
360 is_in_incognito_window_( 360 is_in_incognito_window_(
361 web_contents && web_contents->GetBrowserContext()->IsOffTheRecord()), 361 web_contents && web_contents->GetBrowserContext()->IsOffTheRecord()),
362 should_always_translate_(false) { 362 should_always_translate_(false) {
363 translate_bubble_view_ = this; 363 translate_bubble_view_ = this;
364 if (web_contents) // web_contents can be null in unit_tests. 364 if (web_contents) // web_contents can be null in unit_tests.
365 mouse_handler_.reset(new WebContentMouseHandler(this, web_contents)); 365 mouse_handler_.reset(new WebContentMouseHandler(this, web_contents));
366 RecordDialogCreation(chrome::DialogIdentifier::TRANSLATE); 366 chrome::RecordDialogCreation(chrome::DialogIdentifier::TRANSLATE);
367 } 367 }
368 368
369 views::View* TranslateBubbleView::GetCurrentView() const { 369 views::View* TranslateBubbleView::GetCurrentView() const {
370 switch (model_->GetViewState()) { 370 switch (model_->GetViewState()) {
371 case TranslateBubbleModel::VIEW_STATE_BEFORE_TRANSLATE: 371 case TranslateBubbleModel::VIEW_STATE_BEFORE_TRANSLATE:
372 return before_translate_view_; 372 return before_translate_view_;
373 case TranslateBubbleModel::VIEW_STATE_TRANSLATING: 373 case TranslateBubbleModel::VIEW_STATE_TRANSLATING:
374 return translating_view_; 374 return translating_view_;
375 case TranslateBubbleModel::VIEW_STATE_AFTER_TRANSLATE: 375 case TranslateBubbleModel::VIEW_STATE_AFTER_TRANSLATE:
376 return after_translate_view_; 376 return after_translate_view_;
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
943 base::string16 label; 943 base::string16 label;
944 if (model_->IsPageTranslatedInCurrentLanguages()) 944 if (model_->IsPageTranslatedInCurrentLanguages())
945 label = l10n_util::GetStringUTF16(IDS_DONE); 945 label = l10n_util::GetStringUTF16(IDS_DONE);
946 else 946 else
947 label = l10n_util::GetStringUTF16(IDS_TRANSLATE_BUBBLE_ACCEPT); 947 label = l10n_util::GetStringUTF16(IDS_TRANSLATE_BUBBLE_ACCEPT);
948 advanced_done_button_->SetText(label); 948 advanced_done_button_->SetText(label);
949 advanced_done_button_->SizeToPreferredSize(); 949 advanced_done_button_->SizeToPreferredSize();
950 if (advanced_view_) 950 if (advanced_view_)
951 advanced_view_->Layout(); 951 advanced_view_->Layout();
952 } 952 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698