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

Side by Side Diff: chrome/browser/ui/views/extensions/device_permissions_dialog_view.cc

Issue 1075593003: Initialize observer_ to nullptr in DevicePermissionsDialogView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/extensions/device_permissions_dialog_view.h" 5 #include "chrome/browser/ui/views/extensions/device_permissions_dialog_view.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/browser/extensions/api/chrome_device_permissions_prompt.h" 8 #include "chrome/browser/extensions/api/chrome_device_permissions_prompt.h"
9 #include "chrome/grit/generated_resources.h" 9 #include "chrome/grit/generated_resources.h"
10 #include "components/constrained_window/constrained_window_views.h" 10 #include "components/constrained_window/constrained_window_views.h"
(...skipping 26 matching lines...) Expand all
37 // ui::TableModel 37 // ui::TableModel
38 int RowCount() override; 38 int RowCount() override;
39 base::string16 GetText(int row, int column) override; 39 base::string16 GetText(int row, int column) override;
40 void SetObserver(ui::TableModelObserver* observer) override; 40 void SetObserver(ui::TableModelObserver* observer) override;
41 41
42 // extensions::DevicePermissionsPrompt::Prompt::Observer 42 // extensions::DevicePermissionsPrompt::Prompt::Observer
43 void OnDevicesChanged() override; 43 void OnDevicesChanged() override;
44 44
45 private: 45 private:
46 scoped_refptr<DevicePermissionsPrompt::Prompt> prompt_; 46 scoped_refptr<DevicePermissionsPrompt::Prompt> prompt_;
47 ui::TableModelObserver* observer_; 47 ui::TableModelObserver* observer_ = nullptr;
benwells 2015/04/08 22:53:22 since you already have an initializer list in the
Reilly Grant (use Gerrit) 2015/04/08 22:57:25 This method guarantees that any future constructor
benwells 2015/04/08 23:44:29 Yes, I understand that this will be caught by all
Reilly Grant (use Gerrit) 2015/04/09 00:06:35 I disagree that this is confusing. This method is
48 }; 48 };
49 49
50 int DevicePermissionsTableModel::RowCount() { 50 int DevicePermissionsTableModel::RowCount() {
51 return prompt_->GetDeviceCount(); 51 return prompt_->GetDeviceCount();
52 } 52 }
53 53
54 base::string16 DevicePermissionsTableModel::GetText(int row, int col_id) { 54 base::string16 DevicePermissionsTableModel::GetText(int row, int col_id) {
55 switch (col_id) { 55 switch (col_id) {
56 case IDS_DEVICE_PERMISSIONS_DIALOG_DEVICE_NAME_COLUMN: 56 case IDS_DEVICE_PERMISSIONS_DIALOG_DEVICE_NAME_COLUMN:
57 return prompt_->GetDeviceName(row); 57 return prompt_->GetDeviceName(row);
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 155
156 gfx::Size DevicePermissionsDialogView::GetPreferredSize() const { 156 gfx::Size DevicePermissionsDialogView::GetPreferredSize() const {
157 return gfx::Size(500, 250); 157 return gfx::Size(500, 250);
158 } 158 }
159 159
160 void ChromeDevicePermissionsPrompt::ShowDialog() { 160 void ChromeDevicePermissionsPrompt::ShowDialog() {
161 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); 161 DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
162 constrained_window::ShowWebModalDialogViews( 162 constrained_window::ShowWebModalDialogViews(
163 new DevicePermissionsDialogView(delegate(), prompt()), web_contents()); 163 new DevicePermissionsDialogView(delegate(), prompt()), web_contents());
164 } 164 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698